Skip to content

Commit 9e03e43

Browse files
committed
'Version 1.6.2 of the AWS CloudTrail Processing Library'
1 parent 6ef0c0d commit 9e03e43

File tree

7 files changed

+110
-9
lines changed

7 files changed

+110
-9
lines changed

META-INF/MANIFEST.MF

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: AWS CloudTrail Processing Library for Java
44
Bundle-SymbolicName: com.amazonaws.awscloudtrailprocessinglibrary;singleton:=true
5-
Bundle-Version: 1.6.1
5+
Bundle-Version: 1.6.2
66
Bundle-Vendor: Amazon Technologies, Inc
77
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
88
Require-Bundle: com.amazonaws.sdk;bundle-version="1.12.261"

README.rst

+8-4
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,18 @@ build, use this command::
6565
Release Notes
6666
-------------
6767

68-
Release 1.6.1 (May19,2023)
68+
Release 1.6.2 (Nov 30, 2023)
69+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
70+
* Added support for modeling EdgeDeviceDetails
71+
72+
Release 1.6.1 (May 19,2023)
6973
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70-
* Added Ssupport for test scenario for UserType IdentityCenterUser
74+
* Added support for test scenario for UserType IdentityCenterUser
7175

72-
Release 1.6.0 (May8,2023)
76+
Release 1.6.0 (May 8,2023)
7377
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7478
* Updated CloudTrailEvent version to 1.12
75-
* Added support for USerIdentity
79+
* Added support for UserIdentity
7680

7781
Release 1.5.2 (Sep 6, 2022)
7882
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>aws-cloudtrail-processing-library</artifactId>
66
<packaging>jar</packaging>
77
<name>AWS CloudTrail Processing Library for Java</name>
8-
<version>1.6.1</version>
8+
<version>1.6.2</version>
99
<description>AWS CloudTrail Processing Library for Java helps Java
1010
developers to easily consume and process log files from AWS
1111
CloudTrail.

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/model/CloudTrailEventData.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.amazonaws.services.cloudtrail.processinglibrary.model.internal.InsightDetails;
2222
import com.amazonaws.services.cloudtrail.processinglibrary.model.internal.Resource;
2323
import com.amazonaws.services.cloudtrail.processinglibrary.model.internal.TlsDetails;
24+
import com.amazonaws.services.cloudtrail.processinglibrary.model.internal.EdgeDeviceDetails;
2425
import com.amazonaws.services.cloudtrail.processinglibrary.model.internal.UserIdentity;
2526

2627
import java.util.Date;
@@ -339,8 +340,8 @@ public Addendum getAddendum() {
339340
*
340341
* @return Information about the edge device, such as device type, device ID.
341342
*/
342-
public String getEdgeDeviceDetails() {
343-
return (String) get(CloudTrailEventField.edgeDeviceDetails.name());
343+
public EdgeDeviceDetails getEdgeDeviceDetails() {
344+
return (EdgeDeviceDetails) get(CloudTrailEventField.edgeDeviceDetails.name());
344345
}
345346

346347
/**

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/model/internal/CloudTrailEventField.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public enum CloudTrailEventField {
3939
cipherSuite,
4040
clientProvidedHostHeader,
4141
credentialId,
42+
deviceFamily,
43+
deviceId,
4244
edgeDeviceDetails,
4345
errorCode,
4446
errorMessage,
@@ -76,6 +78,7 @@ public enum CloudTrailEventField {
7678
sessionCredentialFromConsole,
7779
sessionIssuer,
7880
sharedEventID,
81+
snowJobId,
7982
sourceIPAddress,
8083
state,
8184
statistics,
@@ -89,4 +92,4 @@ public enum CloudTrailEventField {
8992
value,
9093
vpcEndpointId,
9194
webIdFederationData
92-
}
95+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*******************************************************************************
2+
* Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
******************************************************************************/
15+
16+
package com.amazonaws.services.cloudtrail.processinglibrary.model.internal;
17+
18+
import java.util.Map;
19+
20+
/**
21+
* Information about the Edge device details of a service API call.
22+
*/
23+
public class EdgeDeviceDetails extends CloudTrailDataStore{
24+
public String getType() {
25+
return (String) this.get(CloudTrailEventField.type.name());
26+
}
27+
28+
public String getSnowJobId() {
29+
return (String) this.get(CloudTrailEventField.snowJobId.name());
30+
}
31+
32+
public String getDeviceId() {
33+
return (String) this.get(CloudTrailEventField.deviceId.name());
34+
}
35+
36+
public String getDeviceFamily() {
37+
return (String) this.get(CloudTrailEventField.deviceFamily.name());
38+
}
39+
40+
/**
41+
* Get attributes
42+
*
43+
* @return additional edge device attributes
44+
*/
45+
@SuppressWarnings({ "unchecked", "rawtypes" })
46+
public Map<String, String> getAttributes() {
47+
return (Map) this.get(CloudTrailEventField.attributes.name());
48+
}
49+
}

src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java

+44
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ public CloudTrailEvent getNextEvent() throws IOException {
168168
case "tlsDetails":
169169
this.parseTlsDetails(eventData);
170170
break;
171+
case "edgeDeviceDetails":
172+
this.parseEdgeDeviceDetails(eventData);
173+
break;
171174
default:
172175
eventData.add(key, parseDefaultValue(key));
173176
break;
@@ -811,6 +814,47 @@ private void parseTlsDetails(CloudTrailEventData eventData) throws IOException {
811814
eventData.add(CloudTrailEventField.tlsDetails.name(), tlsDetails);
812815
}
813816

817+
private void parseEdgeDeviceDetails(CloudTrailEventData eventData) throws IOException {
818+
JsonToken nextToken = jsonParser.nextToken();
819+
if (nextToken == JsonToken.VALUE_NULL) {
820+
eventData.add(CloudTrailEventField.edgeDeviceDetails.name(), null);
821+
return;
822+
}
823+
824+
if (nextToken != JsonToken.START_OBJECT) {
825+
throw new JsonParseException("Not a EdgeDevice Details object", jsonParser.getCurrentLocation());
826+
}
827+
828+
EdgeDeviceDetails edgeDeviceDetails = new EdgeDeviceDetails();
829+
830+
while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
831+
String key = jsonParser.getCurrentName();
832+
833+
switch (key) {
834+
case "attributes":
835+
edgeDeviceDetails.add(CloudTrailEventField.attributes.name(), parseAttributes());
836+
break;
837+
case "type":
838+
edgeDeviceDetails.add(CloudTrailEventField.type.name(), jsonParser.nextTextValue());
839+
break;
840+
case "snowJobId":
841+
edgeDeviceDetails.add(CloudTrailEventField.snowJobId.name(), jsonParser.nextTextValue());
842+
break;
843+
case "deviceId":
844+
edgeDeviceDetails.add(CloudTrailEventField.deviceId.name(), jsonParser.nextTextValue());
845+
break;
846+
case "deviceFamily":
847+
edgeDeviceDetails.add(CloudTrailEventField.deviceFamily.name(), jsonParser.nextTextValue());
848+
break;
849+
default:
850+
edgeDeviceDetails.add(key, this.parseDefaultValue(key));
851+
break;
852+
}
853+
}
854+
855+
eventData.add(CloudTrailEventField.edgeDeviceDetails.name(), edgeDeviceDetails);
856+
}
857+
814858
/**
815859
* Parses the event with key as default value.
816860
*

0 commit comments

Comments
 (0)