Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
peniakoff authored Feb 17, 2025
2 parents e8852a0 + cfb3ece commit a52db3a
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ jobs:

- name: Upload coverage to Codecov
if: env.CODECOV_TOKEN != null
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/runtime-interface-client_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ jobs:

- name: Upload coverage to Codecov
if: env.CODECOV_TOKEN != null
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
19 changes: 16 additions & 3 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
# Set up both Java 8 and 21
- name: Set up Java 8 and 21
uses: actions/setup-java@v4
with:
java-version: 21
java-version: |
8
21
distribution: corretto

# Install events module using Java 8
- name: Install events with Maven
run: |
export JAVA_HOME=$JAVA_HOME_8_X64
mvn -B clean install \
-Dmaven.compiler.source=1.8 \
-Dmaven.compiler.target=1.8 \
--file aws-lambda-java-events/pom.xml
# Build custom-serialization samples
- name: install sam
uses: aws-actions/setup-sam@v2
Expand All @@ -57,4 +71,3 @@ jobs:
run: cd samples/custom-serialization/moshi && sam build && sam local invoke -e events/event.json | grep 200
- name: test request-stream-handler
run: cd samples/custom-serialization/request-stream-handler && sam build && sam local invoke -e events/event.json | grep 200

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class SqsHandler implements RequestHandler<SQSEvent, String> {
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
</dependency>
```

Expand Down
3 changes: 2 additions & 1 deletion aws-lambda-java-events/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* `CognitoUserPoolPreAuthenticationEvent`
* `CognitoUserPoolPreSignUpEvent`
* `CognitoUserPoolPreTokenGenerationEvent`
* `CognitoUserPoolPreTokenGenerationEventV2`
* `CognitoUserPoolVerifyAuthChallengeResponseEvent`
* `ConfigEvent`
* `ConnectEvent`
Expand Down Expand Up @@ -74,7 +75,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
</dependency>
...
</dependencies>
Expand Down
6 changes: 6 additions & 0 deletions aws-lambda-java-events/RELEASE.CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### January 31, 2025
`3.15.0`:
- Fix `CognitoUserPoolPreTokenGenerationEventV2` model ([#519](https://github.com/aws/aws-lambda-java-libs/pull/519))
- Add RotationToken to SecretsManagerRotationEvent ([#520](https://github.com/aws/aws-lambda-java-libs/pull/520))


### September 13, 2024
`3.14.0`:
- Fix name of s3Bucket field of Task class in S3BatchEventV2 ([#506](https://github.com/aws/aws-lambda-java-libs/pull/506))
Expand Down
2 changes: 1 addition & 1 deletion aws-lambda-java-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
<packaging>jar</packaging>

<name>AWS Lambda Java Events Library</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public static class AccessTokenGeneration {
@Builder(setterPrefix = "with")
@NoArgsConstructor
public static class GroupOverrideDetails {
private Map<String, String> groupsToOverride;
private Map<String, String> iamRolesToOverride;
private String[] groupsToOverride;
private String[] iamRolesToOverride;
private String preferredRole;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ public class SecretsManagerRotationEvent {
private String step;
private String secretId;
private String clientRequestToken;
private String rotationToken;

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ public abstract class SecretsManagerRotationEventMixin {
// needed because Jackson expects "clientRequestToken" instead of "ClientRequestToken"
@JsonProperty("ClientRequestToken") abstract String getClientRequestToken();
@JsonProperty("ClientRequestToken") abstract void setClientRequestToken(String clientRequestToken);

// needed because Jackson expects "rotationToken" instead of "RotationToken"
@JsonProperty("RotationToken") abstract String getRotationToken();
@JsonProperty("RotationToken") abstract void setRotationToken(String rotationToken);
}
2 changes: 1 addition & 1 deletion aws-lambda-java-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ public void testLoadSecretsManagerRotationEvent() {
assertThat(event)
.returns("123e4567-e89b-12d3-a456-426614174000", from(SecretsManagerRotationEvent::getClientRequestToken))
.returns("arn:aws:secretsmanager:eu-central-1:123456789012:secret:/powertools/secretparam-xBPaJ5", from(SecretsManagerRotationEvent::getSecretId))
.returns("CreateSecret", from(SecretsManagerRotationEvent::getStep));
.returns("CreateSecret", from(SecretsManagerRotationEvent::getStep))
.returns("8a4cc1ac-82ea-47c7-bd9f-aeb370b1b6a6", from(SecretsManagerRotationEvent::getRotationToken));
;
}

@Test
Expand Down Expand Up @@ -435,6 +437,17 @@ public void testLoadCognitoUserPoolPreTokenGenerationEventV2() {
CognitoUserPoolPreTokenGenerationEventV2.Request request = event.getRequest();
String[] requestScopes = request.getScopes();
assertThat("aws.cognito.signin.user.admin").isEqualTo(requestScopes[0]);

CognitoUserPoolPreTokenGenerationEventV2.Response response = event.getResponse();
String[] groupsToOverride = response.getClaimsAndScopeOverrideDetails().getGroupOverrideDetails().getGroupsToOverride();
String[] iamRolesToOverride = response.getClaimsAndScopeOverrideDetails().getGroupOverrideDetails().getIamRolesToOverride();
String preferredRole = response.getClaimsAndScopeOverrideDetails().getGroupOverrideDetails().getPreferredRole();

assertThat("group-99").isEqualTo(groupsToOverride[0]);
assertThat("group-98").isEqualTo(groupsToOverride[1]);
assertThat("arn:aws:iam::123456789012:role/sns_caller99").isEqualTo(iamRolesToOverride[0]);
assertThat("arn:aws:iam::123456789012:role/sns_caller98").isEqualTo(iamRolesToOverride[1]);
assertThat("arn:aws:iam::123456789012:role/sns_caller_99").isEqualTo(preferredRole);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@
"groupConfiguration": {
"groupsToOverride": ["group-1", "group-2", "group-3"],
"iamRolesToOverride": ["arn:aws:iam::123456789012:role/sns_caller1", "arn:aws:iam::123456789012:role/sns_caller2", "arn:aws:iam::123456789012:role/sns_caller3"],
"preferredRole": ["arn:aws:iam::123456789012:role/sns_caller"]
"preferredRole": "arn:aws:iam::123456789012:role/sns_caller"
},
"scopes": [
"aws.cognito.signin.user.admin", "openid", "email", "phone"
]
},
"response": {
"claimsAndScopeOverrideDetails": []
"claimsAndScopeOverrideDetails": {
"groupOverrideDetails": {
"groupsToOverride": ["group-99", "group-98"],
"iamRolesToOverride": ["arn:aws:iam::123456789012:role/sns_caller99", "arn:aws:iam::123456789012:role/sns_caller98"],
"preferredRole": "arn:aws:iam::123456789012:role/sns_caller_99"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"Step" : "CreateSecret",
"SecretId" : "arn:aws:secretsmanager:eu-central-1:123456789012:secret:/powertools/secretparam-xBPaJ5",
"ClientRequestToken" : "123e4567-e89b-12d3-a456-426614174000"
"ClientRequestToken" : "123e4567-e89b-12d3-a456-426614174000",
"RotationToken": "8a4cc1ac-82ea-47c7-bd9f-aeb370b1b6a6"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
2 changes: 1 addition & 1 deletion samples/kinesis-firehose-event-handler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.14.0</version>
<version>3.15.0</version>
</dependency>

<dependency>
Expand Down

0 comments on commit a52db3a

Please sign in to comment.