Skip to content

Commit 56808c3

Browse files
committed
Remove jackson from explicit depndencies. Add more tests
1 parent 2f8bfd3 commit 56808c3

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

services/signin/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,5 @@
5656
<artifactId>http-auth-aws</artifactId>
5757
<version>${awsjavasdk.version}</version>
5858
</dependency>
59-
<dependency>
60-
<groupId>software.amazon.awssdk</groupId>
61-
<artifactId>third-party-jackson-core</artifactId>
62-
<version>${awsjavasdk.version}</version>
63-
</dependency>
6459
</dependencies>
6560
</project>

services/signin/src/test/java/software/amazon/awssdk/services/signin/auth/internal/DpopHeaderGeneratorTest.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import static org.junit.jupiter.api.Assertions.assertEquals;
1919
import static org.junit.jupiter.api.Assertions.assertNotNull;
20+
import static org.junit.jupiter.api.Assertions.assertThrows;
2021
import static org.junit.jupiter.api.Assertions.assertTrue;
2122

2223
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -37,11 +38,12 @@
3738
import software.amazon.awssdk.services.signin.internal.DpopHeaderGenerator;
3839

3940
public class DpopHeaderGeneratorTest {
40-
private static final String VALID_TEST_PEM = "-----BEGIN EC PRIVATE KEY-----\n"
41-
+ "MHcCAQEEICeY73qhQO/3o1QnrL5Nu3HMDB9h3kVW6imRdcHks0tboAoGCCqGSM49"
42-
+ "AwEHoUQDQgAEbefyxjd/UlGwAPF6hy0k4yCW7dSghc6yPd4To0sBqX0tPS/aoLrl"
43-
+ "QnPjfDslgD29p4+Pgwxj1s8cFHVeDKdKTQ==\n"
44-
+ "-----END EC PRIVATE KEY-----";
41+
private static final String VALID_TEST_PEM =
42+
"-----BEGIN EC PRIVATE KEY-----\n"
43+
+ "MHcCAQEEICeY73qhQO/3o1QnrL5Nu3HMDB9h3kVW6imRdcHks0tboAoGCCqGSM49"
44+
+ "AwEHoUQDQgAEbefyxjd/UlGwAPF6hy0k4yCW7dSghc6yPd4To0sBqX0tPS/aoLrl"
45+
+ "QnPjfDslgD29p4+Pgwxj1s8cFHVeDKdKTQ==\n"
46+
+ "-----END EC PRIVATE KEY-----";
4547
private static final ObjectMapper MAPPER = new ObjectMapper();
4648

4749
@Test
@@ -84,6 +86,15 @@ public void testGenerateAndVerifyDPoPHeader() throws Exception {
8486
assertTrue(verified, "DPoP ES256 signature should verify correctly");
8587
}
8688

89+
@Test
90+
public void invalidKey_raisesException() {
91+
assertThrows(IllegalArgumentException.class, () -> {
92+
DpopHeaderGenerator.generateDPoPProofHeader(
93+
"INVALID-KEY", "https://example.com",
94+
Instant.now().getEpochSecond(), UUID.randomUUID().toString());
95+
});
96+
}
97+
8798
/**
8899
* Verifies an ES256 signature given base64url-encoded JWT parts and the JWK public key.
89100
*/

0 commit comments

Comments
 (0)