Skip to content

All V2 SDK samples can share policies. #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ repositories {
}
}

dependencies {
dependencies {
implementation 'software.amazon.awssdk.crt:android:0.6.2'
}
```
Expand All @@ -91,11 +91,9 @@ dependencies {
[Samples README](samples)



## Getting Help

Use the following sources for information :

* Check api and developer guides.
* Check for similar issues already opened.

Expand All @@ -106,13 +104,11 @@ If you still can’t find a solution to your problem open an [issue](https://git
## Giving Feedback and Contributions

We need your help in making this SDK great. Please participate in the community and contribute to this effort by submitting issues, participating in discussion forums and submitting pull requests through the following channels.

* [Contributions Guidelines](master/CONTRIBUTING.md)
* Articulate your feature request or upvote existing ones on our [Issues](https://github.com/aws/aws-iot-device-sdk-java-v2/issues?q=is%3Aissue+is%3Aopen+label%3Afeature-request) page.
* Submit [Issues](https://github.com/aws/aws-iot-device-sdk-java-v2/issues)



## More Resources

* [AWS IoT Core Documentation](https://docs.aws.amazon.com/iot/)
Expand All @@ -127,7 +123,6 @@ Integration with AWS IoT Services such as
is provided by code that been generated from a model of the service.



# License

This library is licensed under the Apache 2.0 License.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class MainActivity : AppCompatActivity(), AdapterView.OnItemSelectedListener {
)
if (name == "pubsub.PubSub") {
args.addAll(arrayOf(
"--topic", assetContentsOr("topic.txt", "/samples/test"),
"--topic", assetContentsOr("topic.txt", "test/topic"),
"--message", assetContentsOr("message.txt", "Hello World From Android")))
} else if (name in arrayOf("jobs.JobsSample", "shadow.ShadowSample")) {
args.addAll(arrayOf(
Expand Down
5 changes: 3 additions & 2 deletions samples/BasicPubSub/src/main/java/pubsub/PubSub.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
import software.amazon.awssdk.iot.iotjobs.model.RejectedError;

import java.io.UnsupportedEncodingException;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

class PubSub {
static String clientId = "samples-client-id";
static String clientId = "test-" + UUID.randomUUID().toString();
static String rootCaPath;
static String certPath;
static String keyPath;
static String endpoint;
static String topic = "/samples/test";
static String topic = "test/topic";
static String message = "Hello World!";
static int messagesToPublish = 10;
static boolean showHelp = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BasicDiscovery {
static String certPath;
static String keyPath;
static String region = "us-east-1";
static String topic = "/samples/test";
static String topic = "test/topic";
static String mode = "both";
static boolean showHelp = false;

Expand Down Expand Up @@ -246,7 +246,7 @@ private int ordinalValue(ConnectivityInfo info) {
group.getGGGroupId(), core.getThingArn(), dnsOrIp, port));

final AwsIotMqttConnectionBuilder connectionBuilder = AwsIotMqttConnectionBuilder.newMtlsBuilderFromPath(certPath, keyPath)
.withClientId("RaspberryPi")
.withClientId("test-" + UUID.randomUUID().toString())
.withPort(port.shortValue())
.withEndpoint(dnsOrIp)
.withBootstrap(bootstrap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@
import com.google.gson.Gson;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class FleetProvisioningSample {
static String clientId = "samples-client-id";
static String clientId = "test-" + UUID.randomUUID().toString();
static String rootCaPath;
static String certPath;
static String keyPath;
Expand Down
3 changes: 2 additions & 1 deletion samples/Jobs/src/main/java/jobs/JobsSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@

import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class JobsSample {
static String clientId = "samples-client-id";
static String clientId = "test-" + UUID.randomUUID().toString();
static String thingName;
static String rootCaPath;
static String certPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
class PubSubStress {
private static final int PROGRESS_OP_COUNT = 100;

static String clientId = "samples-client-id";
static String clientId = "test-" + UUID.randomUUID().toString();
static String rootCaPath;
static String certPath;
static String keyPath;
static String endpoint;
static String topic = "/samples/test";
static String topic = "test/topic";
static String message = "Hello World!";
static int messagesToPublish = 5000;
static boolean showHelp = false;
Expand Down
10 changes: 5 additions & 5 deletions samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ and receive.
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": "arn:aws:iot:<b>region</b>:<b>account</b>:client/samples-client-id"
"Resource": "arn:aws:iot:<b>region</b>:<b>account</b>:client/test-*"
}
]
}
Expand Down Expand Up @@ -152,7 +152,7 @@ and receive.
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": "arn:aws:iot:<b>region</b>:<b>account</b>:client/samples-client-id"
"Resource": "arn:aws:iot:<b>region</b>:<b>account</b>:client/test-*"
}
]
}
Expand All @@ -175,14 +175,14 @@ cd ~/samples/Identity
Run the sample using CreateKeysAndCertificate:

```
mvn exec:java -Dexec.mainClass="identity.FleetProvisioningSample" -Dexec.args="--endpoint <endpoint> --rootca <root ca path>
mvn exec:java -Dexec.mainClass="identity.FleetProvisioningSample" -Dexec.args="--endpoint <endpoint> --rootca <root ca path>
--cert <cert path> --key <private key path> --templateName <templatename> --templateParameters <templateParams>"
```

Run the sample using CreateCertificateFromCsr:

```
mvn exec:java -Dexec.mainClass="identity.FleetProvisioningSample" -Dexec.args="--endpoint <endpoint> --rootca <root ca path>
mvn exec:java -Dexec.mainClass="identity.FleetProvisioningSample" -Dexec.args="--endpoint <endpoint> --rootca <root ca path>
--cert <cert path> --key <private key path> --templateName <templatename> --templateParameters <templateParams> --csr <csr path>"
```

Expand Down Expand Up @@ -226,7 +226,7 @@ and receive.
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": "arn:aws:iot:<b>region</b>:<b>account</b>:client/samples-client-id"
"Resource": "arn:aws:iot:<b>region</b>:<b>account</b>:client/test-*"
}
]
}
Expand Down
5 changes: 3 additions & 2 deletions samples/RawPubSub/src/main/java/rawpubsub/RawPubSub.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

class RawPubSub {
static String clientId = "samples-client-id";
static String clientId = "test-" + UUID.randomUUID().toString();
static String rootCaPath;
static String certPath;
static String keyPath;
static String endpoint;
static String topic = "/samples/test";
static String topic = "test/topic";
static String message = "Hello World!";
static int messagesToPublish = 10;
static boolean showHelp = false;
Expand Down
3 changes: 2 additions & 1 deletion samples/Shadow/src/main/java/shadow/ShadowSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.Scanner;
import java.util.UUID;

public class ShadowSample {
static String clientId = "samples-client-id";
static String clientId = "test-" + UUID.randomUUID().toString();
static String thingName;
static String rootCaPath;
static String certPath;
Expand Down