Граф коммитов

1959 Коммитов

Автор SHA1 Сообщение Дата
Brian Caswell 1936e9be73
Prep 0.19.0 release (#1551) 2024-01-05 14:01:36 -05:00
Brian Caswell 38597f0565
work around hang issue in hyper (#1550)
As indicated in #1549, there is an issue with hyper (the underlying
layer used by reqwest) that hangs in some cases on connection pools.
This PR uses a commonly discussed workaround of setting
`pool_max_idle_per_host` to 0.

Ref: https://github.com/hyperium/hyper/issues/2312
2024-01-05 13:37:47 -05:00
Brian Caswell 5f9258fd2d
update generated crates (#1545) 2024-01-05 13:37:13 -05:00
Brian Caswell 612e0d551c
include source stack in aggregated errors in DefaultAzureCredential (#1546)
* include source stack in aggregated errors in DefaultAzureCredential

As indicated in #1543, error details are swallowed when building an
aggregate error message.

Currently, we format each of the errors using to_string, which results
in the following:

```
Error {
    context: Full(
        Custom {
            kind: Credential,
            error: Error {
                context: Message {
                    kind: Credential,
                    message: "Multiple errors were encountered while attempting to authenticate:\nenvironment credential\nIMDS timeout\naz-cli",
                },
            },
        },
        "failed to get bearer token",
    ),
}
```

This doesn't help the user understand how to fix the issue.

With this update, we recurse through the error sources, building a more
detailed message.   This results in:

```
Error {
    context: Full(
        Custom {
            kind: Credential,
            error: Error {
                context: Message {
                    kind: Credential,
                    message: "Multiple errors were encountered while attempting to authenticate:\nenvironment credential - request token error - Server returned error response\nIMDS timeout - operation timed out\naz-cli - 'az account get-access-token' command failed: ERROR: AADSTS70011: The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid. The scope https://storage.azure.com/ offline_access openid profile is not valid. The scope format is invalid. Scope must be in a valid URI form <https://example/scope> or a valid Guid <guid/scope>.  Trace ID: 346f391a-48f2-4e96-849f-9ecd6c589d02 Correlation ID: 7888c325-56ff-4100-8ce2-c8cf41561b40 Timestamp: 2024-01-05 01:31:04Z\nInteractive authentication is needed. Please run:\naz login --scope https://storage.azure.com/\n",
                },
            },
        },
        "failed to get bearer token",
    ),
}
```

When printed, this message looks like:
```
Multiple errors were encountered while attempting to authenticate:
environment credential - request token error - Server returned error response
IMDS timeout - operation timed out
az-cli - 'az account get-access-token' command failed: ERROR: AADSTS70011: The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid. The scope https://storage.azure.com/ offline_access openid profile is not valid. The scope format is invalid. Scope must be in a valid URI form <https://example/scope> or a valid Guid <guid/scope>.  Trace ID: 02aecb08-69b4-4a5d-9ebb-784ea788c102 Correlation ID: dddc061a-ca11-4b21-b857-6d765a564597 Timestamp: 2024-01-05 01:43:45Z
Interactive authentication is needed. Please run:
az login --scope https://storage.azure.com/
```
2024-01-05 13:36:54 -05:00
dependabot[bot] bfa073dde1
Update hyper-rustls requirement from 0.24 to 0.25 (#1548)
Updates the requirements on [hyper-rustls](https://github.com/rustls/hyper-rustls) to permit the latest version.
- [Release notes](https://github.com/rustls/hyper-rustls/releases)
- [Commits](https://github.com/rustls/hyper-rustls/compare/v/0.24.0...v/0.25.0)

---
updated-dependencies:
- dependency-name: hyper-rustls
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-05 10:24:16 -05:00
Brian Caswell e1773e1c94
allow users to provide continuation token (#1537) 2024-01-03 10:47:54 -05:00
Brian Caswell 7895a1947e
fix token scopes for azure_storage and azure_iot_hub (#1541) 2024-01-03 10:47:39 -05:00
Brian Caswell e3e0d22289
make delete path a Stream response (#1540) 2024-01-03 10:45:41 -05:00
Brian Caswell 4e3a4f3f10
enable AccessToken to be serialized & deserialized (#1538) 2024-01-03 10:44:26 -05:00
Cameron Taggart 207cb5467a
use expire_on from Azure CLI 2.54.0 if it exists (#1534)
* use expire_on from Azure CLI 2.54.0

* spelling

* rename to local_expires_on & expires_on

* fix test
2024-01-02 14:58:21 -05:00
Sandeep Bansal 1160d50541
Fixing the naive implementation of sleep and adding a tokio based (#1523) 2023-12-27 14:25:48 -05:00
Jose Torres c999ef3df4
Fix service bus queue SAS token generation (#1518) 2023-12-18 17:11:09 -05:00
John Batty d561a6a5c7
Add throttling support using retry-after headers (#1517) 2023-12-18 17:10:23 -05:00
Brian Caswell aac41053c0
fix hmac features related to docs.rs build failures (#1513) 2023-12-11 11:56:28 -05:00
Brian Caswell 7273f1156f
move away from directory listings for finding generated crates (#1509)
As identified in #1479, we do not currently handle deleted/renamed specifications well.

This update addresses this via the following:
* Moves to using parsing `cargo_toml` to parse services/Cargo.toml to know what crates already exist
* Replaces all uses of `list_crate_names` with using the results of `gen_crates`

As a byproduct, this identifies that the previously existing spec that would result in `azure_svc_codesigning` was removed.

ref: https://github.com/Azure/azure-rest-api-specs/pull/26635
2023-12-08 14:41:50 -05:00
Brian Caswell e04f5c3590
Bump version for release (#1508) 2023-12-08 14:40:25 -05:00
Brian Caswell 3d49b6fcd5
fix clippy lint with hmac_openssl feature (#1507) 2023-12-08 14:39:48 -05:00
Brian Caswell 6d03297138
simplify use of `default_tag` (#1506)
Most of the time, tag is analogous to "API version", but not always.  The idea is to allow the following:

* Allow the generated crate user to specify which tags they want if they want something specific
* Allow the SDK developer to rely on the "usual" behavior where it's API version, and use the "latest" without having to continuously update the SDK crate based on a steady churn of the generated crates
* When user uses both the generated crate and the SDK-crate, it doesn't violate either of the above ideals
* Allow users to use both generated crates and the SDK-crate _without_ multiple imports of the same crate as the generated crates can be huge.  (For reference, azure_svc_blobstorage is ~5M of source, and each feature is ~1M)

This change modifies the generated import behavior thusly:
* Any tag that is selected by feature name is available for use via `use crate_name::tag_name::models;`
* If the `default_tag` feature is selected, then the tag is included by feature name (and can be used via `use crate_name::tag_name::models;`
* If the `default_tag` feature is selected, then the implementation for that specific tag is imported at the top level for the crate, such that it can _also_ be used as `use crate_name::models;`
2023-12-08 14:39:30 -05:00
Brian Caswell 85d13b31d5
Standardize on json & xml helpers (#1505) 2023-12-08 08:59:14 -05:00
Brian Caswell 838f181ea3
fix handling application/xml for body (#1504)
This includes two changes:
1. Align `to_xml` to `to_json` by returning Bytes instead of String
2. Updates generator to use `to_xml` when the content-type is set to `application/xml`
2023-12-08 08:57:42 -05:00
Brian Caswell 03618cc8d2
Regenerate crates with latest specs (#1496) 2023-12-07 09:27:39 -05:00
Brian Caswell 6c8289a656
add error context to autorust (#1497) 2023-12-07 07:31:33 -05:00
Brian Caswell da2e4294ce
add blob service client get properties (#1499) 2023-12-07 07:25:36 -05:00
Brian Caswell a0b90670e0
fix azure_storage_queue set_blob_service_properties (#1498) 2023-12-07 07:17:34 -05:00
Brian Caswell 588f415813
update lints for generated crates (#1501) 2023-12-06 17:13:49 -05:00
Brian Caswell 704194ecc0
don't generate docs with all features (#1502) 2023-12-06 17:13:35 -05:00
Brian Caswell f8f852593c
Move to azure identity scopes (#1493) 2023-12-06 10:37:00 -05:00
Brian Caswell 588d27d260
use a temp directory for the emulator (#1494) 2023-12-06 08:52:04 -05:00
Brian Caswell 8ab1801886
enable caching at the top level DefaultAzureCredential (#1491) 2023-12-06 08:51:45 -05:00
Brian Caswell 5ceb1253d0
Expose default tag as feature (#1492) 2023-12-06 08:49:54 -05:00
dependabot[bot] 93f4c3248a
Update crates_io_api requirement from 0.8 to 0.9 in /services/autorust (#1488) 2023-12-05 10:11:34 -05:00
Lars Hagen 953ee98228
support user-supplied marker in list_blobs (#1468) 2023-12-05 10:10:12 -05:00
Krishan aa6f23480b
split AutoRust codegen_operations into multiple files (#1485) 2023-12-01 19:25:42 -05:00
Brian Caswell 0b3e2d13e0
implement caching for all identity implementations (#1484) 2023-12-01 14:18:14 -05:00
Brian Caswell 3dd2391041
add features to docs.rs build config (#1483) 2023-12-01 11:40:17 -05:00
Brian Caswell d3fed3ef40
add support for partial range headers (#1482) 2023-12-01 11:16:24 -05:00
Brian Caswell 3bf1e2ef1f
Support user delegated sas urls (#1481) 2023-12-01 11:16:04 -05:00
Brian Caswell 6e3e342d7e
use azure_core::Url reexport (#1480) 2023-11-30 16:35:50 -05:00
Brian Caswell 6f2cd13b65
Use Url instead of strings (#1478) 2023-11-30 14:54:30 -05:00
Brian Caswell 88d55f4885
Add support for authenticating using azureauth cli (#1464) 2023-11-29 12:02:28 -05:00
Brian Caswell 3c57ac491e
move to RwLock rather than Mutex for storage credentials (#1477)
Rather than using a Mutex, use a write-preferred RwLock implementation
which should increase performance in many common situations.
2023-11-29 11:42:13 -05:00
Brian Caswell de1def2f1e
Rename TokenResponse to AccessToken (#1476)
This does 3 things:
1. Renames `AccessToken` to `Secret`
2. Prevents `Debug` of the `AccessToken` from actually showing the secret
3. Starts expanding the use of `Secret` to other areas, such as client certificates
2023-11-29 11:25:03 -05:00
Brian Caswell f91d648043
expose updating credentials to sub-clients of a BlobServiceClient (#1474) 2023-11-29 10:59:45 -05:00
Brian Caswell e7c28453e5
rename AccessToken to Secret and expand it's usage (#1472) 2023-11-29 10:55:32 -05:00
Brian Caswell a32e4115d4
standardize hmac_sha256 implementation (#1473) 2023-11-29 09:31:11 -05:00
dependabot[bot] 69d431433a
Update comrak requirement from 0.19 to 0.20 in /services/autorust (#1475)
Updates the requirements on [comrak](https://github.com/kivikakk/comrak) to permit the latest version.
- [Release notes](https://github.com/kivikakk/comrak/releases)
- [Changelog](https://github.com/kivikakk/comrak/blob/main/changelog.txt)
- [Commits](https://github.com/kivikakk/comrak/compare/0.19.0...0.20.0)

---
updated-dependencies:
- dependency-name: comrak
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-29 09:30:09 -05:00
Jianjun Liao 4e66f73c26
provide an option to hash data by openssl (#1467) 2023-11-27 10:18:50 -05:00
Krishan 0d09ed39eb
Search for discriminator children through multiple levels of allOf nesting (#1460) 2023-11-17 11:53:25 -05:00
Brian Caswell 6671dd3d98
address 1.74.0 lints (#1463) 2023-11-16 17:05:24 -05:00
dependabot[bot] 569d7a8e38
Update hyper requirement from 0.14 to 1.0 (#1462)
Updates the requirements on [hyper](https://github.com/hyperium/hyper) to permit the latest version.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.14.0...v1.0.0)

---
updated-dependencies:
- dependency-name: hyper
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-16 09:04:21 -05:00