aws-sdk-kotlin
aws-sdk-kotlin copied to clipboard
feat(rt): add ProcessCredentialsProvider
Adds a ProcessCredentialsProvider which will be used to support process credentials resolution
Issue #
N/A
Description of changes
This change is required to achieve feature parity with existing SDKs. It allows more customization on where the SDK gets users' credentials from.
Process credentials may be returned without an expiration field. In this case, we are expected to treat the credentials as non-expiring, and no credential refreshes should be attempted. To support this behavior, the concept of NonExpiringCredentials was added to the JSON deserializer used for credentials. If we receive non-expiring credentials, we set the expiration to Instant.MAX_VALUE to ensure they "never" expire.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
A new generated diff is ready to view: https://github.com/awslabs/aws-sdk-kotlin/compare/__generated-main...__generated-feat-extensible-credential-providers
Question: should I add @InternalSdkAPI decorators to the new functions such as executeCommand? It's not really intended for SDK users and could be subject to breaking changes in the future (i.e if we want to return stdout and stderr instead of just one of them, or generalize it even more with a larger refactor)
Question: should I add
@InternalSdkAPIdecorators to the new functions such asexecuteCommand? It's not really intended for SDK users and could be subject to breaking changes in the future (i.e if we want to return stdout and stderr instead of just one of them, or generalize it even more with a larger refactor)
It's marked internal already so it isn't consumable by anything other than from this project/compilation unit.
InternalApi/InternalSdkApi are for functions that have to be public to be consumable from generated code but aren't meant for general consumption (i.e. it's an internal detail of generated code)
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
Looks great. Nice work. Have you tested this out with real CLI process on different OS (e.g. linux + windows)?
Yeah, I just finished manual testing on all platforms (mac, linux, windows) and it works everywhere. I tested for command successes and failures (where stderr message is expected) for both absolute command paths and resolving the command from the system's PATH.
SonarCloud Quality Gate failed. 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
9 Code Smells
No Coverage information
12.9% Duplication
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
Changes since last review:
- Add a configurable max bytes read from stdout
- Add a configurable command timeout
- Handle spaces in command by wrapping the entire string in quotes
- Add security warning to the KDocs
- Prevent calling getCredentials() after close() in CachedCredentialsProvider
SonarCloud Quality Gate failed. 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
11 Code Smells
No Coverage information
9.1% Duplication
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
A new generated diff is ready to view.
- No codegen difference in the AWS SDK
SonarCloud Quality Gate failed. 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
11 Code Smells
No Coverage information
9.0% Duplication