-
Notifications
You must be signed in to change notification settings - Fork 188
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
Introduced new cli options #204
Conversation
We promised customer to maximize network throughput. The change enables automatic network throughput configuration if customer specified throughput is missing. Signed-off-by: Charles Zhang <zyaoshen@amazon.com>
1. Simplify the throughput configuration logic - main.rs(commit#:65432b) 2. Introduce "version" to network_performance.json.
The program reads network throughput form network_performance.json, adds unit tests for checking throughput correctness. Signed-off-by: Charles Zhang <zyaoshen@amazon.com>
By using #[test_case] in stead of #[test] Signed-off-by: Charles Zhang <zyaoshen@amazon.com>
Some(profile_name_override) => { | ||
let credentials_profile_options = CredentialsProviderProfileOptions { | ||
profile_name_override: &profile_name_override, | ||
}; |
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.
Shouldn't we pass client_bootstrap in this case as well?
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.
client_bootstrap
usage to profile based credential is for customer who uses assume role with STS. My understanding now is customer only uses IAM Role
or IAM User
as per README.md
mentioned.
However, I think we should add client_bootstrap to support any customer use assume role and sending http/https request to STS
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.
Profiles can specify a role to assume, so we do need to include the bootstrap here.
Looks related to:
Possibly also?: #197 |
bootstrap: &mut client_bootstrap, | ||
let mut client_config = ClientConfig::new(); | ||
|
||
let mut credentials_provider = match config.profile_name_override { |
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.
Should this be moved under the if at line 113?
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.
It should not, we need to bump ref count of CredentialProvider
to 1 all the way until S3CrtClient
owns the client config.
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.
I think I see what you mean, but maybe it's the signature of init_default_signing_config
that's an issue: why is it taking a (mutable) reference instead of taking ownership of CredentialProvider
? Is this a similar issue to what @jamesbornholt pointed out about the options parameter below? (or am I missing something?)
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.
We need to write tests for this, as they would have caught the missing bootstrap in the profile credentials provider.
- Test mounting an anonymous-readable bucket
- Test specifying profile provider with STS credentials
#[derive(Debug)] | ||
pub struct CredentialsProviderProfileOptions<'a> { | ||
/// The name of profile to use. | ||
pub profile_name_override: &'a str, |
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.
This should be Option<&'a str>
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.
nice catch! will fix
@@ -42,6 +54,25 @@ impl CredentialsProvider { | |||
|
|||
Ok(Self { inner }) | |||
} | |||
|
|||
/// Creates the profile credential provider. | |||
pub fn new_profile(allocator: &Allocator, options: &CredentialsProviderProfileOptions) -> Result<Self, Error> { |
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.
We should take ownership of the options here.
pub fn new_profile(allocator: &Allocator, options: &CredentialsProviderProfileOptions) -> Result<Self, Error> { | |
pub fn new_profile(allocator: &Allocator, options: CredentialsProviderProfileOptions) -> Result<Self, Error> { |
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.
what about the new_chain_default
should that method take the ownership of CredentialsProviderChainDefaultOption
?
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.
that should too
Some(profile_name_override) => { | ||
let credentials_profile_options = CredentialsProviderProfileOptions { | ||
profile_name_override: &profile_name_override, | ||
}; |
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.
Profiles can specify a role to assume, so we do need to include the bootstrap here.
* --no-sign-request: allow customer to omit credential. * --profile: customer can specify credentials name. Signed-off-by: Charles Zhang <zyaoshen@amazon.com>
…ug (#201) Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
* Add error handling for FUSE worker threads that panic When encountering a panic in a FUSE operation, the filesystem was not exiting cleanly. We were not handling the panicking thread case before this change. With this change, we log at error and allow the unmount process to continue. Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com> * Make thread name optional, add panic message to log if possible Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com> * Appease fmt-check Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com> --------- Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
…tus code (#205) * Update to debug/warn based on status code Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com> * Appease fmt-check Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com> * Appease clippy Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com> --------- Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
* Do some basic validation of bucket names This will help catch common CLI errors like #203. Customers coming from the AWS CLI might expect to be able to pass an s3:// URI as a bucket name, which we don't support. It's also possible to accidentally swap the bucket name and mount point arguments -- mount points will often be invalid bucket names, so some validation helps us catch some of these cases more quickly. Arguably we could support parsing s3:// URIs, including using the key as a prefix for the mount. But that would be a bigger feature and I'm not totally sure it's the right thing, so for now some validation is better than nothing. Signed-off-by: James Bornholt <bornholt@amazon.com> * Allow underscores in bucket names Signed-off-by: James Bornholt <bornholt@amazon.com> --------- Signed-off-by: James Bornholt <bornholt@amazon.com>
Bumps [h2](https://github.com/hyperium/h2) from 0.3.16 to 0.3.17. - [Release notes](https://github.com/hyperium/h2/releases) - [Changelog](https://github.com/hyperium/h2/blob/master/CHANGELOG.md) - [Commits](hyperium/h2@v0.3.16...v0.3.17) --- updated-dependencies: - dependency-name: h2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Introduced Cli options.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).