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

1950 Коммитов

Автор SHA1 Сообщение Дата
Merlin d5b8a4c2a1
Support xml error respsonse (#1631)
* core: make HttpError use content-type header to deserialize body

* core: respect Content-Type in ErrorKind::http_response_from_body

* core: correctly de-serialize XML errors with different case-ing

* cleanup if statements

* core: only parse xml error bodies if 'xml' feature is present

* core: refactor ErrorKind::HttpResponse to make use of headers

* Update sdk/core/src/error/mod.rs

Co-authored-by: Heath Stewart <heaths@outlook.com>

* Update sdk/core/src/error/http_error.rs

Co-authored-by: Heath Stewart <heaths@outlook.com>

* Update sdk/core/src/error/mod.rs

Co-authored-by: Heath Stewart <heaths@outlook.com>

* Revert "Update sdk/core/src/error/http_error.rs"

This reverts commit a2f3b4bfcf.

---------

Co-authored-by: Merlin Maggi <merlin.maggi@jls.ch>
Co-authored-by: Heath Stewart <heaths@outlook.com>
2024-04-19 07:58:27 +02:00
Heath Stewart e3e174e146
Use package properties, dependencies (#1642)
* Use package properties, dependencies

* Fix build breaks

* Checkout source before linting
2024-04-18 15:38:26 -07:00
Heath Stewart 201aaae2c5
Remove all but core, identity (#1641)
* Remove all but core, identity

* Disable emulator tests
2024-04-18 15:29:01 -07:00
dependabot[bot] bf92c438e9
Update crates_io_api requirement from 0.9 to 0.11 in /services/autorust (#1640)
---
updated-dependencies:
- dependency-name: crates_io_api
  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-04-15 10:01:20 -07:00
dependabot[bot] 70f7a377b4
Update heck requirement from 0.4 to 0.5 in /services/autorust (#1624)
---
updated-dependencies:
- dependency-name: heck
  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-04-02 13:53:30 -07:00
dependabot[bot] 57b5863a19
Update comrak requirement from 0.21 to 0.22 in /services/autorust (#1635)
Updates the requirements on comrak to permit the latest version.

---
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>
2024-04-02 09:49:50 -07:00
dependabot[bot] a2cf587772
Update hyper-rustls requirement from 0.26 to 0.27 (#1628)
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.26.0...v/0.27.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-03-29 16:49:25 -07:00
Heath Stewart f0705f5115
Fix new warnings (as errors) (#1633) 2024-03-29 23:16:05 +00:00
dependabot[bot] 9f737e154c
Update reqwest requirement from 0.11.14 to 0.12.0 (#1626)
Updates the requirements on [reqwest](https://github.com/seanmonstar/reqwest) to permit the latest version.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.14...v0.12.0)

---
updated-dependencies:
- dependency-name: reqwest
  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-03-21 15:10:58 -07:00
Heath Stewart 22ab1128f1
Fix build issues (#1625)
* Fix build issues, inherit workspace lints

* More fixes

* Add empty workspace.lints to resolve services/ errors

* services/autorest/Cargo.toml is a workspace
2024-03-13 15:38:02 -07:00
dependabot[bot] e88ec52695
Update base64 requirement from 0.21 to 0.22 (#1620)
Updates the requirements on [base64](https://github.com/marshallpierce/rust-base64) to permit the latest version.
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: base64
  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-03-04 09:15:13 -08:00
Heath Stewart 7b4e43843c
Add Rust script to verify centralized dependencies (#1618)
* Add Rust script to verify centralized dependencies

Partial, short-term solution for #1591. Still need to hook it into the
build after we centralize all dependencies.

* Check all dependencies
2024-02-27 14:29:15 -08:00
Thomas Johnson f72ad46310
fix: naive_redirect_server TCP Port should be a u16 (#1611)
The Naive Redirect Server function accepts a u32 for what should be a 16-bit unsigned integer.

This change changes the function to accept a u16 to avoid out-of-bounds input.
2024-02-20 16:29:40 -08:00
Heath Stewart 9d112d18b4
Fix build errors (#1613) 2024-02-20 15:58:55 -08:00
Rick Winter fa15fac316
Add codeowner file (#1610) 2024-02-16 10:39:43 -08:00
dependabot[bot] ddedf470b0
Update cargo_toml requirement from 0.18 to 0.19 in /services/autorust (#1597)
Updates the requirements on [cargo_toml](https://gitlab.com/lib.rs/cargo_toml) to permit the latest version.
- [Commits](https://gitlab.com/lib.rs/cargo_toml/compare/v0.18.0...v0.19.0)

---
updated-dependencies:
- dependency-name: cargo_toml
  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-29 12:42:49 -05:00
Jose Torres f782dcc6e6
Add missing serde attribute for correct deserialization. (#1589) 2024-01-26 13:05:31 -05:00
dependabot[bot] 2ee8d1e0eb
Update comrak requirement from 0.20 to 0.21 in /services/autorust (#1596)
Updates the requirements on comrak to permit the latest version.

---
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>
2024-01-26 09:49:19 -05:00
Brian Caswell f473bc948c
move to using `tracing` instead of `log` (#1579)
In order to move towards supporting OpenTelemetry, we need to move the
underlying logging implementation to use `tracing`.

This does _not_ start exposing spans or tracing state yet.

ref: https://azure.github.io/azure-sdk/general_implementation.html
2024-01-22 10:10:59 -05:00
Brian Caswell a3a681cbb4
don't run `cargo clean` as part of clippy build script (#1580)
Co-authored-by: Brian Caswell <bcaswell@microsoft.com>
2024-01-16 14:53:10 -08:00
Cameron Taggart b28ca1d05c
add azure_identity::create_credential(), SpecificAzureCredential, AppServiceManagedIdentityCredential, VirtualMachineManagedIdentityCredential (#1532)
* add azure_identity::new_credential(), SpecificAzureCredential, AppServiceManagedIdentityCredential, VirtualMachineManagedIdentityCredential

* examples

* clippy NoopClient

* clippy test_options

* rename feature to unit_test

* spelling

* "noop_client"

* rename as create_sources

* fix compilation

* remove SpecificAzureCredential from DefaultAzureCredential

* add create_default_credential

* add create_specific_credential

* use create_credential

* update changelog

* make Env pub(crate)

* authority_host URL parsing in create

* cargo test --all

* update vm_list example

* vm_list

* create_credential docs

* back out noop_client feature

* make noop_client private

* opt out of cli for wasm

* make ImdsManagedIdentityCredential internal

* all spaces in AZURE_CREDENTIAL_TYPE

* clippy

* Update sdk/identity/README.md

Co-authored-by: Heath Stewart <heaths@outlook.com>

* Update sdk/identity/CHANGELOG.md

Co-authored-by: Heath Stewart <heaths@outlook.com>

* ./eng/scripts/cargo_readme.sh

* rename to Kind

* rename as AZURE_CREDENTIAL_KIND

* add DefaultAzureCredential::create

* put back VM credential by default :-(

* env is not pub

---------

Co-authored-by: Heath Stewart <heaths@outlook.com>
2024-01-16 14:51:56 -08:00
Kyle Rader decf450b34
Upgrade AzureauthCliCredential to latest TokenCredential trait and use TokenCache (#1575) 2024-01-16 10:06:53 -05:00
dependabot[bot] 51de13e843
Update hyper-rustls requirement from 0.25 to 0.26 (#1577)
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.25.0...v/0.26.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-16 10:03:42 -05:00
Brian Caswell 9cd67babbf
use async-process for executing commands (#1560) 2024-01-09 21:23:26 -05:00
Brian Caswell 2993625fe8
address example name collisions (#1558)
As identified in recent builds, an example in azure_storage_blobs and azure_storage_queues have the same name (service_properties).  This issue currently causes a warning that could become a hard error in the future.

This PR renames the examples to resolve the issue.

Ref: https://github.com/Azure/azure-sdk-for-rust/actions/runs/7451526251/job/20272841803#step:4:145
2024-01-09 19:27:35 -05:00
Brian Caswell ea8bdf2a00
address `clippy::explicit_clone` (#1567) 2024-01-09 19:10:55 -05:00
Brian Caswell e70cf9777d
address `match_same_arms` (#1561) 2024-01-09 19:10:40 -05:00
Brian Caswell 74271f9dbf
address `clippy::doc_markdown` (#1562) 2024-01-09 19:10:28 -05:00
Brian Caswell 8de1c73ac4
address clippy::map_unwrap_or (#1563) 2024-01-09 19:10:16 -05:00
Brian Caswell aab1d5ee16
address clippy::redundant_closure_for_method_calls (#1564) 2024-01-09 19:10:06 -05:00
Brian Caswell ce0cfe00ec
address `clippy::inefficient_to_string` (#1568) 2024-01-09 19:09:46 -05:00
Brian Caswell 4673d7e984
address `clippy::manual_string_new` (#1569) 2024-01-09 19:09:27 -05:00
Brian Caswell b65164834a
address `clippy::if_not_else` (#1570) 2024-01-09 19:09:16 -05:00
dependabot[bot] 34f58a45c4
Update cargo_toml requirement from 0.17 to 0.18 in /services/autorust (#1565)
Updates the requirements on [cargo_toml](https://gitlab.com/lib.rs/cargo_toml) to permit the latest version.
- [Commits](https://gitlab.com/lib.rs/cargo_toml/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: cargo_toml
  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-09 09:02:10 -05:00
Brian Caswell fe425a33ba
address unused_async lint (#1559)
> Async functions with no async code create overhead, both mentally and
> computationally. Callers of async methods either need to be calling
> from an async function themselves or run it on an executor, both of
> which causes runtime overhead and hassle for the caller.

https://rust-lang.github.io/rust-clippy/master/index.html#/unused_async
2024-01-09 09:01:37 -05:00
Brian Caswell aff7692a01
check wasm with default features (#1557)
As indicated in #1554, we're not catching changes that impact real-world
WASM use in CICD.

Originally, our WASM implementation was a best-effort path as reqwest
(our first-class supported HTTP backend) did not support WASM.  Now that
reqwest supports WASM, we should update our CICD to validate WASM with
the default features.
2024-01-08 13:17:37 -05:00
John Batty f75406d92c
Remove call to reqwest::ClientBuilder::pool_max_idle_per_host() on wasm (#1555) 2024-01-08 10:14:02 -05:00
dependabot[bot] 9b2bd2e54a
Update serial_test requirement from 2.0 to 3.0 (#1556)
Updates the requirements on [serial_test](https://github.com/palfrey/serial_test) to permit the latest version.
- [Release notes](https://github.com/palfrey/serial_test/releases)
- [Commits](https://github.com/palfrey/serial_test/compare/v2.0.0...v3.0.0)

---
updated-dependencies:
- dependency-name: serial_test
  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-08 10:13:28 -05:00
Brian Caswell 148a7ac600
use `cargo-docs-rs` to validate docs as part of the build pipeline (#1553) 2024-01-08 10:12:36 -05:00
Krishan 49134c9a81
Fix docs.rs build for iot_hub, messaging_eventgrid, message_servicebus (#1552) 2024-01-05 15:29:34 -05:00
Brian Caswell a42325c884
add wrapper script to generate & build services (#1544) 2024-01-05 14:28:24 -05:00
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