-
Notifications
You must be signed in to change notification settings - Fork 363
feat(eventhubs): support AMQP-over-WebSockets transport #4596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Johnathan W (j7nw4r)
wants to merge
25
commits into
Azure:main
from
j7nw4r:worktree-eventhubs-amqp-websockets
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
67c6930
feat(eventhubs): support AMQP-over-WebSockets transport
j7nw4r 818bc2e
docs(eventhubs): document WebSocket transport for EventProcessor
j7nw4r 9a43d25
docs(eventhubs): add AMQP-over-WebSockets sample
j7nw4r a882b24
fix(amqp): address review feedback on WebSocket transport
j7nw4r 951f6e9
feat(amqp): model the TLS backend and seal AmqpConnectionOptions
j7nw4r 5f71122
fix(amqp): drop the rustls feature, which pulls in banned ring
j7nw4r 4272a8d
test(eventhubs): cover the transport plumbing, fix the changelog example
j7nw4r 1e677df
docs(amqp): state the TLS feature that the WebSocket transport needs
j7nw4r edbe578
docs(eventhubs): correct the TLS feature statement on the transport
j7nw4r d839b9f
fix(eventhubs): add the transport argument to a new test call site
j7nw4r dd68885
docs(eventhubs): use a fully qualified namespace in the transport exa…
j7nw4r e57a598
docs(amqp): qualify the WebSocket TLS note by the backend feature
j7nw4r 13b4ba3
refactor(amqp): give WebSockets a feature and keep the options bag open
j7nw4r bf0a508
refactor(eventhubs): select the transport with AmqpTransport
j7nw4r e58ab67
refactor(amqp): split the WebSocket features by TLS stack
j7nw4r ed66060
fix(eventhubs): add the transport argument to new test call sites
j7nw4r 761edfa
refactor(amqp): drop the parity WebSocket TLS feature
j7nw4r 7c31ed3
feat(amqp): move the TLS stack to rustls with aws-lc-rs
j7nw4r 63453f5
fix(amqp): open the WebSocket through the ungated connect entry point
j7nw4r 42b5c7d
fix(eventhubs): pass the transport to the call sites added on main
j7nw4r bdc7245
docs(amqp): document the TCP TLS feature on docs.rs
j7nw4r 3d786e4
docs(eventhubs): correct the close-order comment in the WebSocket sample
j7nw4r 0fe4022
docs(amqp): record the breaking entries under Breaking Changes
j7nw4r 284be2c
docs(amqp): state how custom_endpoint treats the port on WebSockets
j7nw4r ff03820
fix(amqp): keep the AMQP TLS handshake on the OS trust store
j7nw4r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,14 +21,18 @@ edition.workspace = true | |
| async-trait.workspace = true | ||
| azure_core = { path = "../azure_core", version = "1.2.0-beta.1", default-features = false } | ||
| fe2o3-amqp = { workspace = true, optional = true } | ||
| fe2o3-amqp-ws = { workspace = true, optional = true } | ||
| fe2o3-amqp-cbs = { workspace = true, optional = true } | ||
| fe2o3-amqp-ext = { workspace = true, optional = true } | ||
| fe2o3-amqp-management = { workspace = true, optional = true } | ||
| fe2o3-amqp-types = { workspace = true, optional = true } | ||
| rustls = { workspace = true, optional = true } | ||
| rustls-platform-verifier = { workspace = true, optional = true } | ||
| serde.workspace = true | ||
| serde_amqp = { workspace = true, optional = true } | ||
| serde_bytes = { workspace = true, optional = true } | ||
| tokio.workspace = true | ||
| tokio-rustls = { workspace = true, optional = true } | ||
| tracing.workspace = true | ||
| typespec = { path = "../typespec", version = "1.2.0-beta.1" } | ||
| typespec_macros = { path = "../typespec_macros", version = "1.1.0-beta.1" } | ||
|
|
@@ -38,7 +42,12 @@ serde_json.workspace = true | |
| tracing-subscriber = { workspace = true, features = ["env-filter"] } | ||
|
|
||
| [features] | ||
| default = ["fe2o3_amqp", "fe2o3-amqp/native-tls"] | ||
| default = [ | ||
| "fe2o3_amqp", | ||
| "fe2o3_amqp_rustls", | ||
| "fe2o3_amqp_ws", | ||
| "fe2o3_amqp_ws_rustls", | ||
| ] | ||
| ffi = [] | ||
| test = [] | ||
| fe2o3_amqp = [ | ||
|
|
@@ -51,9 +60,100 @@ fe2o3_amqp = [ | |
| "serde_bytes", | ||
| "azure_core/tokio", | ||
| ] | ||
| # The TLS stack for AMQP framed directly on TCP (`amqps://`, port 5671). | ||
| # `fe2o3_amqp` is the base, and this feature adds the stack, in the same shape | ||
| # that `azure_core` uses for HTTP, where `reqwest` is the base and | ||
| # `reqwest_rustls` adds the stack. It is rustls with the aws-lc-rs provider, and | ||
| # `default` selects it. | ||
| # | ||
| # The connection builds its own TLS connector on `rustls-platform-verifier`. | ||
| # The default connector of `fe2o3-amqp` fills its root store from | ||
| # `webpki-roots`, which holds a compiled-in copy of the Mozilla root set and | ||
| # ignores the trust store of the operating system. The platform verifier reads | ||
| # the trust store of the operating system, so this feature trusts the same roots | ||
| # as `reqwest/rustls` on the HTTP side, and a broker behind a private or an | ||
| # enterprise certificate authority keeps working. `webpki-roots` still arrives | ||
| # as a dependency, because the `rustls` feature of `fe2o3-amqp` always names it, | ||
| # but nothing reads it. | ||
| # | ||
| # The direct `rustls` dependency selects the crypto provider. | ||
| # `ClientConfig::builder()` panics when no process-level default is installed | ||
| # and the crate features name no single provider. The default features of | ||
| # `rustls` give aws-lc-rs, std, and tls12, and `deny.toml` bans `ring`, so this | ||
| # repository cannot reach that panic. An application that unifies a second | ||
| # provider into the graph makes the choice ambiguous again, and it must call | ||
| # `CryptoProvider::install_default()` before it opens a connection. The | ||
| # WebSocket feature below carries the same condition. | ||
| # | ||
| # This feature needs `fe2o3-amqp` 0.16 or later. The rustls backend of 0.14 was | ||
| # built on `ring`, which `deny.toml` bans (#4189). | ||
| # | ||
| # There is no matching native-tls feature, because `fe2o3-amqp` accepts one TLS | ||
| # stack only and reports `TlsConnectorNotFound` at run time when both are on. | ||
| # Two features that cannot both be on would break `--all-features`. To use | ||
| # another stack, turn off the default features, name `fe2o3_amqp`, and take a | ||
| # direct dependency on `fe2o3-amqp` with the stack you want. Cargo unifies the | ||
| # features, and nothing pulls rustls in: | ||
| # | ||
| # azure_core_amqp = { version = "...", default-features = false, features = [ | ||
| # "fe2o3_amqp", | ||
| # ] } | ||
| # fe2o3-amqp = { version = "0.16", features = ["native-tls"] } | ||
| # | ||
| # `samples/list_blobs_native_tls` shows the same pattern for `reqwest`. | ||
| fe2o3_amqp_rustls = [ | ||
| "fe2o3_amqp", | ||
| "fe2o3-amqp/rustls", | ||
| "dep:rustls", | ||
| "dep:rustls-platform-verifier", | ||
| "dep:tokio-rustls", | ||
| ] | ||
| # AMQP over WebSockets. `fe2o3_amqp_ws` is the base feature: it turns on the | ||
| # transport code and the `fe2o3-amqp-ws` dependency, and it names no TLS stack. | ||
| # `fe2o3_amqp_ws_rustls` adds the stack that the rest of `sdk/core` uses, rustls | ||
| # with the aws-lc-rs provider, and `default` selects it. | ||
| # | ||
| # To build the transport on another TLS stack, turn off the default features, | ||
| # name `fe2o3_amqp_ws`, and take a direct dependency on the backend crate with | ||
| # the stack you want. Cargo unifies the features, so the transport then uses | ||
| # your stack and nothing pulls rustls in: | ||
| # | ||
| # azure_core_amqp = { version = "...", default-features = false, features = [ | ||
| # "fe2o3_amqp", "fe2o3_amqp_ws", | ||
| # ] } | ||
| # fe2o3-amqp = { version = "0.16", features = ["native-tls"] } | ||
| # fe2o3-amqp-ws = { version = "0.16", features = ["native-tls"] } | ||
| # | ||
| # `samples/list_blobs_native_tls` shows the same pattern for `reqwest`. | ||
| # | ||
| # One stack must be selected somewhere in the graph. `fe2o3_amqp_ws` on its own | ||
| # builds, and the connection reports `TlsFeatureNotEnabled` when it opens. | ||
| # `reqwest` behaves the same way. | ||
| fe2o3_amqp_ws = ["fe2o3_amqp", "dep:fe2o3-amqp-ws"] | ||
|
|
||
| # The direct `rustls` dependency is only here to select the crypto provider. | ||
| # This crate names no `rustls` type. `reqwest/rustls` selects aws-lc-rs itself, | ||
| # so `typespec_client_core` needs no such dependency. The `tokio-tungstenite` | ||
| # chain under `fe2o3-amqp-ws` is different. It takes rustls with | ||
| # `default-features = false` and names no provider, so `ClientConfig::builder()` | ||
| # panics when no process-level default is installed. The default features of | ||
| # `rustls` give aws-lc-rs, std, and tls12. | ||
| # | ||
| # `fe2o3_amqp_rustls` selects the same provider, so the dependency is redundant | ||
| # when `default` is on. This feature has to stand on its own, because a consumer | ||
| # can turn the default features off and name only the WebSocket transport. | ||
| fe2o3_amqp_ws_rustls = [ | ||
| "fe2o3_amqp_ws", | ||
| "fe2o3-amqp-ws/rustls-tls-native-roots", | ||
| "dep:rustls", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do we need an explicit dependency on it if we get it from |
||
| ] | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [package.metadata.docs.rs] | ||
| features = ["fe2o3_amqp"] | ||
| features = [ | ||
| "fe2o3_amqp", | ||
| "fe2o3_amqp_rustls", | ||
| "fe2o3_amqp_ws", | ||
| "fe2o3_amqp_ws_rustls", | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.