Skip to content

Commit 22b3875

Browse files
authored
Greengrass 2.4 (#173)
1 parent e4b9f23 commit 22b3875

36 files changed

+2100
-12
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ mvn clean install
6464
``` sh
6565
# NOTE: use the latest version of the CRT here
6666

67+
6768
git clone --branch v0.11.5 https://github.com/awslabs/aws-crt-java.git
6869

6970
git clone https://github.com/awslabs/aws-iot-device-sdk-java-v2.git

samples/BasicPubSub/src/main/java/pubsub/PubSub.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import software.amazon.awssdk.iot.AwsIotMqttConnectionBuilder;
2323
import software.amazon.awssdk.iot.iotjobs.model.RejectedError;
2424

25-
import java.io.UnsupportedEncodingException;
2625
import java.nio.charset.StandardCharsets;
2726
import java.util.UUID;
2827
import java.util.concurrent.CompletableFuture;

samples/Greengrass/src/main/java/greengrass/BasicDiscovery.java

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

66
package greengrass;
77

8-
import software.amazon.awssdk.crt.CRT;
98
import software.amazon.awssdk.crt.CrtResource;
109
import software.amazon.awssdk.crt.CrtRuntimeException;
1110
import software.amazon.awssdk.crt.Log;
@@ -25,7 +24,6 @@
2524
import java.util.*;
2625
import java.util.concurrent.CompletableFuture;
2726
import java.util.concurrent.ExecutionException;
28-
import java.util.regex.Pattern;
2927

3028
import static software.amazon.awssdk.iot.discovery.DiscoveryClient.TLS_EXT_ALPN;
3129

@@ -165,8 +163,8 @@ public static void main(String[] args) {
165163
try(final DiscoveryClientConfig discoveryClientConfig =
166164
new DiscoveryClientConfig(clientBootstrap, tlsCtxOptions,
167165
new SocketOptions(), region, 1, proxyOptions);
168-
final DiscoveryClient discoveryClient = new DiscoveryClient(discoveryClientConfig);
169-
final MqttClientConnection connection = getClientFromDiscovery(discoveryClient, clientBootstrap)) {
166+
final DiscoveryClient discoveryClient = new DiscoveryClient(discoveryClientConfig);
167+
final MqttClientConnection connection = getClientFromDiscovery(discoveryClient, clientBootstrap)) {
170168

171169
if ("subscribe".equals(mode) || "both".equals(mode)) {
172170
final CompletableFuture<Integer> subFuture = connection.subscribe(topic, QualityOfService.AT_MOST_ONCE, message -> {

samples/Identity/src/main/java/identity/FleetProvisioningSample.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,10 @@
2828
import software.amazon.awssdk.iot.iotidentity.model.RegisterThingSubscriptionRequest;
2929

3030
import java.nio.file.Files;
31-
import java.nio.file.Path;
3231
import java.nio.file.Paths;
3332

3433
import java.util.HashMap;
35-
import java.util.Map;
3634
import com.google.gson.Gson;
37-
import java.util.LinkedList;
38-
import java.util.List;
3935
import java.util.UUID;
4036
import java.util.concurrent.CompletableFuture;
4137
import java.util.concurrent.ExecutionException;

samples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [fleet provisioning](#fleet-provisioning)
66

77
**Additional sample apps not described below:**
8+
89
* [BasicPubSub](https://github.com/aws/aws-iot-device-sdk-java-v2/tree/main/samples/BasicPubSub)
910
* [Greengrass](https://github.com/aws/aws-iot-device-sdk-java-v2/tree/main/samples/Greengrass)
1011
* [PubSubStress](https://github.com/aws/aws-iot-device-sdk-java-v2/tree/main/samples/PubSubStress)

samples/RawPubSub/src/main/java/rawpubsub/RawPubSub.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import software.amazon.awssdk.crt.mqtt.*;
1717
import software.amazon.awssdk.iot.iotjobs.model.RejectedError;
1818

19-
import java.io.UnsupportedEncodingException;
2019
import java.nio.charset.StandardCharsets;
2120
import java.util.Arrays;
2221
import java.util.List;

sdk/greengrass/.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# These are explicitly windows files and should use crlf
5+
*.bat text eol=crlf
6+

sdk/greengrass/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
6+
7+
.idea
8+
*.swp
9+
*.swo
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package software.amazon.awssdk.eventstreamrpc;
2+
3+
/**
4+
* Exact implementation of this is between the EventStreamRPCServiceHandler at the Authentication handler itself
5+
*/
6+
public interface AuthenticationData {
7+
8+
/**
9+
* Return a human readable string for who the identity of the client/caller is. This
10+
* string must be appropriate for audit logs and enable tracing specific callers/clients
11+
* to relevant decision and operations executed
12+
*
13+
* @return
14+
*/
15+
public String getIdentityLabel();
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package software.amazon.awssdk.eventstreamrpc;
2+
3+
import software.amazon.awssdk.crt.eventstream.Header;
4+
5+
import java.util.List;
6+
import java.util.function.BiFunction;
7+
8+
/**
9+
* apply() accepts the connection message and produces authentication data from it to at least be
10+
* used for authorization decisions
11+
*
12+
* Exact implementation is up to service implementations to decide what it is and how to handle it
13+
*/
14+
public interface AuthenticationHandler extends BiFunction<List<Header>, byte[], AuthenticationData> { }

0 commit comments

Comments
 (0)