-
Notifications
You must be signed in to change notification settings - Fork 190
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
add: tests to ensure all interceptors are run if an error occurs in one #2664
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3ac9c1e
add: tests to ensure all interceptors are if an error occurs in one
Velfi 5725d56
Merge branch 'main' into add/interceptor-error-handling-tests
Velfi c5b76ee
udpate: respond to PR comments
Velfi 3d545d5
fix: clippy lints
Velfi 12bc394
Merge branch 'main' into add/interceptor-error-handling-tests
Velfi 9c5f1e3
fix: duplicate imports
Velfi 7014da4
Merge remote-tracking branch 'origin/main' into add/interceptor-error…
Velfi c135c68
update: interceptor tests to work with John's phase refactor
Velfi fb83922
refactor: usage of auth and identity resolvers in orchestrator interc…
Velfi 8e3f6aa
Merge branch 'main' into add/interceptor-error-handling-tests
Velfi e4690ee
fix: cargo doc links
Velfi 21e27dc
update: move anonymous auth runtime plugin to aws-smithy-runtime
Velfi 07dc309
fix: doc links
Velfi 80d59cb
move: more anonymous auth stuff into the runtime crate from runtime-api
Velfi fe3026e
remove: feature that gates nothing
Velfi 3c56aa1
fix: clippy lint
Velfi 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
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -65,30 +65,6 @@ impl Identity { | |
} | ||
} | ||
|
||
#[derive(Debug)] | ||
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. Moved to |
||
pub struct AnonymousIdentity; | ||
|
||
impl AnonymousIdentity { | ||
pub fn new() -> Self { | ||
Self | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct AnonymousIdentityResolver; | ||
|
||
impl AnonymousIdentityResolver { | ||
pub fn new() -> Self { | ||
AnonymousIdentityResolver | ||
} | ||
} | ||
|
||
impl IdentityResolver for AnonymousIdentityResolver { | ||
fn resolve_identity(&self, _: &ConfigBag) -> Future<Identity> { | ||
Future::ready(Ok(Identity::new(AnonymousIdentity::new(), None))) | ||
} | ||
} | ||
|
||
pub mod builders { | ||
use super::*; | ||
use crate::client::auth::AuthSchemeId; | ||
|
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#[cfg(feature = "anonymous-auth")] | ||
pub mod anonymous; |
32 changes: 32 additions & 0 deletions
32
rust-runtime/aws-smithy-runtime/src/client/identity/anonymous.rs
This file contains 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
use aws_smithy_runtime_api::client::identity::{Identity, IdentityResolver}; | ||
use aws_smithy_runtime_api::client::orchestrator::Future; | ||
use aws_smithy_runtime_api::config_bag::ConfigBag; | ||
|
||
#[derive(Debug, Default)] | ||
pub struct AnonymousIdentity; | ||
|
||
impl AnonymousIdentity { | ||
pub fn new() -> Self { | ||
Self | ||
} | ||
} | ||
|
||
#[derive(Debug, Default)] | ||
pub struct AnonymousIdentityResolver; | ||
|
||
impl AnonymousIdentityResolver { | ||
pub fn new() -> Self { | ||
Self | ||
} | ||
} | ||
|
||
impl IdentityResolver for AnonymousIdentityResolver { | ||
fn resolve_identity(&self, _: &ConfigBag) -> Future<Identity> { | ||
Future::ready(Ok(Identity::new(AnonymousIdentity::new(), None))) | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter was complaining about an unnecessary explicit lifetime here and in the auth option resolver so I switched it to an anonymous lifetime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I take it to mean that the compiler deterministically derives the anomalous lifeitme in this case from the first
&
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's what happens AFAICT