Skip to content

Commit efa03ea

Browse files
committed
Prep credential packages
Mark unstable Fix spotless Fix spotbugs
1 parent 1410933 commit efa03ea

12 files changed

Lines changed: 64 additions & 6 deletions

File tree

aws/aws-config/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# AWS Config
22

3+
> [!WARNING]
4+
> This is a developer-preview module and may contain bugs. No guarantee is made about API stability.
5+
36
Provides credential resolution from AWS shared configuration files (`~/.aws/config` and `~/.aws/credentials`). Ships handlers for static keys, session keys, and credential_process.
47

58
## Dependency
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Parsing of AWS shared config and credentials files ({@code ~/.aws/config},
3+
* {@code ~/.aws/credentials}) and the profile data model.
4+
*
5+
* <p>This package is unstable and its API may change without notice. (Intentionally not annotated
6+
* with {@code @SmithyUnstableApi} to avoid taking on a dependency solely for the annotation; see
7+
* this module's README.)
8+
*/
9+
package software.amazon.smithy.java.aws.config;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Handlers for resolving credentials from AWS shared config and credentials files.
3+
*/
4+
@SmithyUnstableApi
5+
package software.amazon.smithy.java.aws.credentials.chain.config;
6+
7+
import software.amazon.smithy.utils.SmithyUnstableApi;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* AWS credential provider chain with SPI-based provider discovery.
3+
*/
4+
@SmithyUnstableApi
5+
package software.amazon.smithy.java.aws.credentials.chain;
6+
7+
import software.amazon.smithy.utils.SmithyUnstableApi;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* IMDS-based credential provider for EC2 instances.
3+
*/
4+
@SmithyUnstableApi
5+
package software.amazon.smithy.java.aws.credentials.imds;
6+
7+
import software.amazon.smithy.utils.SmithyUnstableApi;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* STS-based credential providers (assume-role, web identity token).
3+
*/
4+
@SmithyUnstableApi
5+
package software.amazon.smithy.java.aws.credentials.sts;
6+
7+
import software.amazon.smithy.utils.SmithyUnstableApi;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* SigV4-S3Express auth scheme: bucket-scoped session credentials for S3 Express One Zone.
3+
*/
4+
@SmithyUnstableApi
5+
package software.amazon.smithy.java.aws.client.auth.scheme.s3express;
6+
7+
import software.amazon.smithy.utils.SmithyUnstableApi;

aws/aws-sigv4/src/main/java/software/amazon/smithy/java/aws/client/auth/scheme/sigv4/AwsChunkedDataStream.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package software.amazon.smithy.java.aws.client.auth.scheme.sigv4;
77

8+
import java.io.ByteArrayInputStream;
89
import java.io.ByteArrayOutputStream;
910
import java.io.IOException;
1011
import java.io.InputStream;
@@ -62,7 +63,8 @@ public AwsChunkedDataStream(DataStream inner) {
6263
int hexSizeLen = hexLen(decodedLength);
6364
int trailerLineLen = TRAILER_NAME.length + 8 /* base64(crc32) */ + CRLF.length;
6465
this.encodedLength = (long) hexSizeLen + CRLF.length
65-
+ decodedLength + CRLF.length
66+
+ decodedLength
67+
+ CRLF.length
6668
+ TERMINATOR.length
6769
+ trailerLineLen
6870
+ CRLF.length;
@@ -104,7 +106,7 @@ public InputStream asInputStream() {
104106
} catch (IOException e) {
105107
throw new UncheckedIOException(e);
106108
}
107-
return new java.io.ByteArrayInputStream(out.toByteArray());
109+
return new ByteArrayInputStream(out.toByteArray());
108110
}
109111

110112
@Override

aws/aws-sigv4/src/main/java/software/amazon/smithy/java/aws/client/auth/scheme/sigv4/SigV4Settings.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public interface SigV4Settings<B extends ClientSetting<B>> extends ClockSetting<
6161
* adjusting {@code Content-Length} / {@code Content-Encoding} accordingly. The signer just
6262
* stamps the override string and trusts the caller's framing.
6363
*/
64-
Context.Key<String> PAYLOAD_HASH_OVERRIDE = Context.key("SigV4 body-hash override (e.g. STREAMING-UNSIGNED-PAYLOAD-TRAILER).");
64+
Context.Key<String> PAYLOAD_HASH_OVERRIDE =
65+
Context.key("SigV4 body-hash override (e.g. STREAMING-UNSIGNED-PAYLOAD-TRAILER).");
6566

6667
/**
6768
* If true, the signer does not add {@code x-amz-security-token} even when the identity has

aws/aws-sigv4/src/main/java/software/amazon/smithy/java/aws/client/auth/scheme/sigv4/SigV4Signer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ private byte[] sign(byte[] data, int offset, int length, byte[] key, byte[] outp
621621
return output;
622622
} catch (InvalidKeyException e) {
623623
throw new RuntimeException(e);
624-
} catch (javax.crypto.ShortBufferException e) {
624+
} catch (ShortBufferException e) {
625625
throw new RuntimeException(e);
626626
}
627627
}

0 commit comments

Comments
 (0)