https://github.com/awslabs/aws-crt-java

Java bindings for the AWS Common Runtime

https://github.com/awslabs/aws-crt-java

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.6%) to scientific vocabulary

Keywords

hacktoberfest

Keywords from Contributors

labels
Last synced: 10 months ago · JSON representation

Repository

Java bindings for the AWS Common Runtime

Basic Info
  • Host: GitHub
  • Owner: awslabs
  • License: apache-2.0
  • Language: Java
  • Default Branch: main
  • Homepage:
  • Size: 6.57 MB
Statistics
  • Stars: 69
  • Watchers: 18
  • Forks: 41
  • Open Issues: 14
  • Releases: 334
Topics
hacktoberfest
Created over 7 years ago · Last pushed 10 months ago
Metadata Files
Readme Contributing License Code of conduct Notice

README.md

AWS CRT Java

Java Bindings for the AWS Common Runtime

License

This library is licensed under the Apache 2.0 License.

Jump To:

Platform

Linux/Unix

Requirements: * Clang 6+ or GCC 4.4+ * cmake 3.9+ * Java: Any JDK8 or above, ensure JAVA_HOME is set * Maven

Building: 1) apt-get install cmake3 maven openjdk-8-jdk-headless -y 2) git clone https://github.com/awslabs/aws-crt-java.git 3) cd aws-crt-java 4) git submodule update --init --recursive 5) mvn compile

OSX

Requirements: * MacOS: 10.15+ * cmake 3.9+ * ninja * Java: Any JDK8 or above, ensure JAVA_HOME is set * Maven

Building: 1) brew install maven cmake (if you have homebrew installed, otherwise install these manually) 2) git clone https://github.com/awslabs/aws-crt-java.git 3) cd aws-crt-java 4) git submodule update --init --recursive 5) mvn compile

Windows

Requirements: * Visual Studio 2015 or above * CMake 3.9+ * Java: Any JDK8 or above, ensure JAVA_HOME is set * Maven

Building: 1) choco install maven (if you have chocolatey installed), otherwise install maven and the JDK manually 2) git clone https://github.com/awslabs/aws-crt-java.git 3) cd aws-crt-java 4) git submodule update --init --recursive 5) mvn compile

NOTE: Make sure you run this from a VS Command Prompt or have run VCVARSALL.BAT in your current shell so CMake can find Visual Studio.

Documentation

Java CRT Documentation

Installing

From the aws-crt-java directory: mvn install From maven: (https://search.maven.org/artifact/software.amazon.awssdk.crt/aws-crt/)

Platform-Specific JARs

The aws-crt JAR in Maven Central is a large "uber" jar that contains compiled C libraries for many different platforms (Windows, Linux, etc). If size is an issue, you can pick a smaller platform-specific JAR by setting the <classifier>.

Sample to use classifier from aws-crt: xml <!-- Platform-specific Linux x86_64 JAR --> <dependency> <groupId>software.amazon.awssdk.crt</groupId> <artifactId>aws-crt</artifactId> <version>0.20.5</version> <classifier>linux-x86_64</classifier> </dependency>

xml <!-- "Uber" JAR that works on all platforms --> <dependency> <groupId>software.amazon.awssdk.crt</groupId> <artifactId>aws-crt</artifactId> <version>0.20.5</version> </dependency>

Available classifiers

  • linux-armv6 (no auto-detect)
  • linux-armv7 (no auto-detect)
  • linux-aarch_64
  • linux-x86_32
  • linux-x86_64
  • linux-x86_64-musl (no auto-detect)
  • linux-armv7-musl (no auto-detect)
  • linux-aarch_64-musl (no auto-detect)
  • osx-aarch_64
  • osx-x86_64
  • windows-x86_32
  • windows-x86_64
  • fips-where-available (no auto-detect)

Auto-detect

The os-maven-plugin can automatically detect your platform's classifier at build time.

NOTES: The auto-detected linux-arm_32 platform classifier is not supported, you must specify linux-armv6 or linux-armv7. Additionally, musl vs glibc detection is not supported either. If you are deploying to a musl-based system and wish to use a classifier-based jar, you must specify the classifier name yourself.

``` xml <!-- Generate os.detected.classifier property --> kr.motd.maven os-maven-plugin 1.7.0

software.amazon.awssdk.crt aws-crt 0.20.5 ${os.detected.classifier} ```

FIPS Cryptography

Currently the classifier fips-where-available provides an "uber" jar with FIPS tested cryptography on some platforms. Platforms that were not part of the FIPS testing are also included in this jar, for compatibility's sake. Check CRT.isFIPS() at runtime to ensure that AWS-LC is being run in FIPS mode, and follow the security policy of AWS-LC-FIPS 3.0.0 (static).

[!WARNING] The classifier, and platforms with FIPS testing are subject to change in the future.

Refer to the NIST Cryptographic Module Validation Program's Modules In Progress List for the latest status of the static AWS-LC 3.0 Cryptographic Module. A complete list of supported operating environments will be made available in the vendor security policy once the validation certificate has been issued. We will also update our release notes and documentation to reflect any changes in FIPS certification status. Previous versions of AWS-LC have already received FIPS cryptographic module certificates (NIST Certificate #4816 & NIST Certificate #4631).

GraalVM support

Since version v0.29.20, GraalVM native image was supported. You can compile your application with AWS CRT in a GraalVM native image project without any additional configuration.

Since version v0.31.1, GraalVM support was updated. Instead of packaging the JNI shared libraries with native image as resources, the corresponding shared lib will be written to the same directory as the native image. In this way, it reduces the native image size around 30% (142 MB to 101 MB for a sample application), and avoids the extra loading time needed for extracting the JNI lib to the temporary path for load. No additional configuration needed.

[!NOTE] The JNI shared lib must be in the same directory as the GraalVM native image. If you move the native image, you must move this file too. It is aws-crt-jni.dll on Windows, libaws-crt-jni.dylib on macOS, and libaws-crt-jni.so on Unix.

System Properties

  • To enable logging, set aws.crt.log.destination or aws.crt.log.level:
    • aws.crt.log.level - Log level. May be: "None", "Fatal", "Error", "Warn" (default), "Info", "Debug", "Trace".
    • aws.crt.log.destination - Log destination. May be: "Stderr" (default), "Stdout", "File", "None".
    • aws.crt.log.filename - File to use when aws.crt.log.destination is "File".
  • aws.crt.libc - (Linux only) Set to "musl" or "glibc" if CRT cannot properly detect which to use.
  • aws.crt.lib.dir - Set directory where CRT may extract its native library (by default, java.io.tmpdir is used)
  • aws.crt.memory.tracing - May be: "0" (default, no tracing), "1" (track bytes), "2" (more detail). Allows the CRT.nativeMemory() and CRT.dumpNativeMemory() functions to report native memory usage.

TLS Behavior

The CRT uses native libraries for TLS, rather than Java's typical Secure Socket Extension (JSSE), KeyStore, and TrustStore. On Windows and Apple devices, the built-in OS libraries are used. On Linux/Unix/etc s2n-tls is used.

If you need to add certificates to the trust store, add them to your OS trust store. The CRT does not use the Java TrustStore. For more customization options, see TlsContextOptions and TlsConnectionOptions.

Mac-Only TLS Behavior

Please note that on Mac, once a private key is used with a certificate, that certificate-key pair is imported into the Mac Keychain. All subsequent uses of that certificate will use the stored private key and ignore anything passed in programmatically. Beginning in v0.6.6, when a stored private key from the Keychain is used, the following will be logged at the "info" log level:

static: certificate has an existing certificate-key pair that was previously imported into the Keychain. Using key from Keychain instead of the one provided.

Testing

Some tests require pre-configured resources and proper environment variables to be set to run properly. These tests will be quietly skipped if the environment variables they require are not set.

IoT tests

Many IoT related tests require that you have set up an AWS IoT Thing.

  • Some required environment variables
    • AWS_TEST_MQTT311_IOT_CORE_HOST: AWS IoT service endpoint hostname for MQTT3
    • AWS_TEST_MQTT311_IOT_CORE_RSA_CERT: Path to the IoT thing certificate for MQTT3
    • AWS_TEST_MQTT311_IOT_CORE_RSA_KEY: Path to the IoT thing private key for MQTT3
    • AWS_TEST_MQTT311_IOT_CORE_ECC_CERT: Path to the IoT thing with EC-based certificate for MQTT3
    • AWS_TEST_MQTT311_IOT_CORE_ECC_KEY: Path to the IoT thing with ECC private key for MQTT3 (The ECC key file should only contains the ECC Private Key section to working on MacOS.)
    • AWS_TEST_MQTT311_ROOT_CA: Path to the root certificate

Other Environment Variables that can be set can be found in the SetupTestProperties() function in CrtTestFixture.java

These can be set persistently via Maven settings (usually in ~/.m2/settings.xml): xml <settings> ... <profiles> <profile> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <crt.test.endpoint>XXXXXXXXXX-ats.iot.us-east-1.amazonaws.com</crt.test.endpoint> <crt.test.certificate>/path/to/XXXXXXXX-certificate.pem.crt</crt.test.certificate> <crt.test.privatekey>/path/to/XXXXXXXX-private.pem.key</crt.test.privatekey> <crt.test.rootca>/path/to/AmazonRootCA1.pem</crt.test.rootca> ... etc ... </properties> </profile> </profiles> </settings>%

Proxy Tests

Most of proxy related tests need pre-configured Proxy host to run the tests properly.

  • Required environment variables:
    • AWS_TEST_HTTP_PROXY_HOST: Hostname of proxy
    • AWS_TEST_HTTP_PROXY_PORT: Port of proxy
    • NETWORK_TESTS_DISABLED: Set this if tests are running in a constrained environment where network access is not guaranteed/allowed.

S3 Tests

Most of S3 related tests require AWS credentials and a set of pre-configured S3 buckets. There is a helper script from aws-c-s3 that can be used to set up the test environment, here.

Example to use the helper and run the S3 tests:

``` sh cd aws-crt-java python3 -m pip install boto3 export CRTS3TESTBUCKETNAME= python3 crt/aws-c-s3/tests/testhelper/testhelper.py init

Run S3ClientTest. eg: mvn -Dtest=S3ClientTest test

```

more details about the helper can be found from here.

  • Required environment variable:
    • CRT_S3_TEST_BUCKET_NAME: The basic bucket name for S3 tests.

IDEs

  • CMake is configured to export a compilation database at target/cmake-build/compile_commands.json
  • CLion: Build once with maven, then import the project as a Compilation Database Project
  • VSCode: will detect that this is both a java project and if you have the CMake extension, you can point that at CMakeLists.txt and the compilation database

Debugging

Tests can be debugged in Java/Kotlin via the built-in tooling in VSCode and IntelliJ. If you need to debug the native code, it's a bit trickier.

To debug native code with VSCode or CLion or any other IDE: 1. Find your mvn launch script(e.g. realpath $(which mvn)) and pull the command line at the bottom from it. This changes between versions of maven, so it is difficult to give consistent directions.

As an example, for Maven 3.6.0 on Linux: /path/to/java -classpath /usr/share/java/plexus-classworlds-2.5.2.jar -Dclassworlds.conf=/usr/share/maven/bin/m2.conf -Dmaven.home=/usr/share/maven -Dlibrary.jansi.path=/usr/share/maven/lib/jansi-native -Dmaven.multiModuleProjectDirectory=. org.codehaus.plexus.classworlds.launcher.Launcher test -DforkCount=0 -Ddebug.native -Dtest=HttpClientConnectionManager#testMaxParallelConnections

The important parts are: * -DforkCount=0 - prevents the Maven process from forking to run tests, so your debugger will be attached to the right process. You can ignore this if you configure your debugger to attach to child processes. * -Ddebug.native - Makes CMake compile the JNI bindings and core libraries in debug. By default, we compile in release with symbols, which will help for call stacks, but less so for live debugging. 2. Set the executable to launch to be your java binary (e.g. /usr/bin/java) 3. Set the parameters to be the ones used by the mvn script, as per above 4. Set the working directory to the aws-crt-java directory 5. On windows, you will need to manually load the PDB via the Modules window in Visual Studio, as it is not embedded in the JAR. It will be in the target/cmake-build/lib/windows/<arch> folder.

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 488
  • Total Committers: 33
  • Avg Commits per committer: 14.788
  • Development Distribution Score (DDS): 0.791
Top Committers
Name Email Commits
Justin Boswell b****j@a****m 102
Bret Ambrose b****e@g****m 86
Michael Graeb g****m@a****m 45
Justin Boswell j****l@g****m 38
Alex Weibel a****l@a****m 38
Dengke Tang 8****5@q****m 29
Dengke Tang d****t@a****m 22
Ryan Carper 5****r@u****m 18
Jonathan M. Henson h****o@a****m 18
TwistedTwigleg n****d@a****m 15
ilevyor 8****r@u****m 14
David Oguns 3****S@u****m 10
Cesar Mello m****r@a****m 9
xiazhvera z****a@a****m 7
James Siri j****i@a****m 7
Dmitriy Musatkin 6****n@u****m 5
Waqar Ahmed Khan w****7@g****m 5
Ken Gilmer 6****r@u****m 3
Aaron Todd a****d@u****m 3
Alex Weibel a****1@g****m 1
Dongie Agnir 2****r@u****m 1
Cesar Mello c****o@g****m 1
Colden Cullen c****n@c****m 1
TwistedTwigleg t****g@g****m 1
Andrew Tang t****1@1****m 1
Will Childs-Klein w****3@g****m 1
dependabot[bot] 4****]@u****m 1
mttwise m****e@g****m 1
Matthew Miller m****m@a****m 1
Zoe Wang 3****g@u****m 1
and 3 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 51
  • Total pull requests: 296
  • Average time to close issues: 11 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 42
  • Total pull request authors: 29
  • Average comments per issue: 3.94
  • Average comments per pull request: 0.34
  • Merged pull requests: 200
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 8
  • Pull requests: 64
  • Average time to close issues: 29 days
  • Average time to close pull requests: 4 days
  • Issue authors: 8
  • Pull request authors: 11
  • Average comments per issue: 6.63
  • Average comments per pull request: 0.16
  • Merged pull requests: 32
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • klopfdreh (3)
  • aajtodd (3)
  • timmattison (2)
  • kggilmer (2)
  • bgklika (2)
  • steven-aerts (2)
  • MikeDombo (2)
  • saso5 (1)
  • bcoromina (1)
  • nicolas-laduguie (1)
  • thai-op (1)
  • noCharger (1)
  • yzarubin (1)
  • steffeng (1)
  • pranikum (1)
Pull Request Authors
  • TingDaoK (61)
  • sbSteveK (37)
  • waahm7 (35)
  • bretambrose (28)
  • graebm (25)
  • sfod (25)
  • xiazhvera (23)
  • TwistedTwigleg (17)
  • DmitriyMusatkin (12)
  • jmklix (4)
  • alexw91 (3)
  • alfred2g (2)
  • RackovychV (2)
  • JonathanHenson (2)
  • maschnetwork (2)
Top Labels
Issue Labels
bug (26) p2 (21) feature-request (18) needs-triage (11) closed-for-staleness (11) response-requested (10) p3 (8) CRT/SDK (5) CRT/IoT (4) needs-review (3) closing-soon (2) pending-release (2) needs-discussion (1) third-party (1)
Pull Request Labels
feature-request (2) needs-review (2) pr/needs-review (1)

Packages

  • Total packages: 2
  • Total downloads: unknown
  • Total docker downloads: 1,266,158
  • Total dependent packages: 41
    (may contain duplicates)
  • Total dependent repositories: 103
    (may contain duplicates)
  • Total versions: 475
repo1.maven.org: software.amazon.awssdk.crt:aws-crt

Java bindings for the AWS SDK Common Runtime

  • Versions: 293
  • Dependent Packages: 40
  • Dependent Repositories: 101
  • Docker Downloads: 1,266,158
Rankings
Dependent packages count: 1.7%
Dependent repos count: 1.9%
Docker downloads count: 5.3%
Average: 13.6%
Forks count: 25.8%
Stargazers count: 33.1%
Last synced: 10 months ago
repo1.maven.org: software.amazon.awssdk.crt:aws-crt-android

Java Android bindings for the AWS SDK Common Runtime

  • Versions: 182
  • Dependent Packages: 1
  • Dependent Repositories: 2
Rankings
Dependent repos count: 16.1%
Forks count: 25.8%
Average: 27.0%
Dependent packages count: 33.0%
Stargazers count: 33.1%
Last synced: 10 months ago

Dependencies

build.gradle.kts maven
  • junit:junit 4.13.2 testImplementation
  • org.mockito:mockito-core 3.11.2 testImplementation
pom.xml maven
  • commons-cli:commons-cli 1.4 test
  • junit:junit 4.13.1 test
  • org.mockito:mockito-all 1.10.19 test
samples/s3/pom.xml maven
  • software.amazon.awssdk.crt:aws-crt 0.10.2
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/checkout v2 composite
  • awslabs/aws-crt-builder/.github/actions/check-submodules main composite
.github/workflows/clang-format.yml actions
  • DoozyX/clang-format-lint-action v0.3.1 composite
  • actions/checkout v3 composite
.github/workflows/docs.yml actions
  • actions/checkout v3 composite
  • ad-m/github-push-action v0.6.0 composite
samples/CustomKeyOps/pom.xml maven
  • software.amazon.awssdk.crt:aws-crt 1.0.0-SNAPSHOT
samples/mqtt5/pom.xml maven
  • software.amazon.awssdk.crt:aws-crt 1.0.0-SNAPSHOT
utils/Canary/pom.xml maven
  • software.amazon.awssdk.crt:aws-crt 1.0.0-SNAPSHOT
.github/workflows/closed-issue-message.yml actions
  • aws-actions/closed-issue-message v1 composite
.github/workflows/handle-stale-discussions.yml actions
  • aws-github-ops/handle-stale-discussions v1 composite
.github/workflows/stale_issue.yml actions
  • aws-actions/stale-issue-cleanup v3 composite
android/build.gradle maven
android/crt/build.gradle maven
src/native/build.gradle.kts maven
src/test/android/testapp/build.gradle maven
  • software.amazon.awssdk.crt:aws-crt-android 1.0.0-SNAPSHOT api
  • androidx.appcompat:appcompat 1.1.0 implementation
  • androidx.constraintlayout:constraintlayout 1.1.3 implementation
  • androidx.core:core 1.2.0 implementation
  • androidx.core:core-ktx 1.2.0 implementation
  • com.sun.net.httpserver:http 20070405 implementation
  • commons-cli:commons-cli 1.5.0 implementation
  • junit:junit 4.13 implementation
  • org.jetbrains.kotlin:kotlin-stdlib-jdk7 $kotlin_version implementation
  • junit:junit 4.13 testImplementation