Skip to content

Commit

Permalink
renaming FIPS classifier to be more clear (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK authored Mar 20, 2024
1 parent 42b09c3 commit b04445e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ From maven: (https://search.maven.org/artifact/software.amazon.awssdk.crt/aws-cr

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>`.

The classifier `fips-compat` provides an "uber" jar with FIPS compliance on *some platforms*. **WARNING:** Platforms without FIPS compliance are also included in this jar, for compatibility's sake. Check `CRT.isFIPS()` at runtime to ensure you are on a FIPS compliant platform. The current breakdown is:
* **FIPS compliant**: linux-aarch_64, linux-x86_64
* **NOT compliant**: linux-armv6, linux-armv7, linux-armv7-musl, linux-aarch_64-musl, linux-x86_32, linux-x86_64-musl, osx-aarch_64, osx-x86_64, windows-x86_32, windows-x86_64

Sample to use classifier from aws-crt:
``` xml
<!-- Platform-specific Linux x86_64 JAR -->
<dependency>
Expand All @@ -105,7 +102,7 @@ The classifier `fips-compat` provides an "uber" jar with FIPS compliance on *som
</dependency>
```

### Available platform classifiers
### Available classifiers

- linux-armv6 (no auto-detect)
- linux-armv7 (no auto-detect)
Expand All @@ -119,7 +116,7 @@ The classifier `fips-compat` provides an "uber" jar with FIPS compliance on *som
- osx-x86_64
- windows-x86_32
- windows-x86_64
- fips-compat (no auto-detect)
- fips-where-available (no auto-detect)

### Auto-detect

Expand Down Expand Up @@ -151,6 +148,18 @@ a classifier-based jar, you must specify the classifier name yourself.
<dependencies>
```

## FIPS Compliance

Currently the classifier `fips-where-available` provides an "uber" jar with FIPS compliance on *some platforms*.

Platforms without FIPS compliance are also included in this jar, for compatibility's sake. Check `CRT.isFIPS()` at runtime to ensure you are on a FIPS compliant platform. The current breakdown is:
* **FIPS compliant**: linux-aarch_64, linux-x86_64
* **NOT compliant**: linux-armv6, linux-armv7, linux-armv7-musl, linux-aarch_64-musl, linux-x86_32, linux-x86_64-musl, osx-aarch_64, osx-x86_64, windows-x86_32, windows-x86_64

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

## System Properties

- To enable logging, set `aws.crt.log.destination` or `aws.crt.log.level`:
Expand Down
2 changes: 1 addition & 1 deletion codebuild/cd/deploy-platform-specific-jars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ else
DEPLOY_REPOSITORY_URL=https://aws.oss.sonatype.org:443/service/local/staging/deployByRepositoryId/${STAGING_REPO_ID}
fi

CLASSIFIERS_ARRAY=("linux-armv6" "linux-armv7" "linux-aarch_64" "linux-x86_32" "linux-x86_64" "osx-aarch_64" "osx-x86_64" "windows-x86_32" "windows-x86_64" "linux-x86_64-musl" "linux-armv7-musl" "linux-aarch_64-musl" "fips-compat")
CLASSIFIERS_ARRAY=("linux-armv6" "linux-armv7" "linux-aarch_64" "linux-x86_32" "linux-x86_64" "osx-aarch_64" "osx-x86_64" "windows-x86_32" "windows-x86_64" "linux-x86_64-musl" "linux-armv7-musl" "linux-aarch_64-musl" "fips-where-available")

for str in ${CLASSIFIERS_ARRAY[@]}; do
FILES="${FILES}target/aws-crt-1.0.0-SNAPSHOT-$str.jar,"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ phases:
# upload artifacts to S3
- export GIT_TAG=$(git describe --tags)
- mkdir -p target/cmake-build/lib
# prepare fips-compat uber jar, download the regular libs
# prepare fips-where-available uber jar, download the regular libs
- aws s3 cp --recursive s3://aws-crt-java-pipeline/${GIT_TAG}/lib $CODEBUILD_SRC_DIR/aws-crt-java/target/cmake-build/lib
# Override with the FIPS libs
- aws s3 cp --recursive s3://aws-crt-java-pipeline/${GIT_TAG}/fips_lib $CODEBUILD_SRC_DIR/aws-crt-java/target/cmake-build/lib
# Run a test to make sure we get the FIPS libs
- CRT_FIPS=ON mvn test -Dtest=software.amazon.awssdk.crt.test.SystemInfoTest#testIsFIPS -Dshared-lib.skip=true
- mvn -B package -DskipTests -Dshared-lib.skip=true -Dcrt.classifier=fips-compat
- mvn -B package -DskipTests -Dshared-lib.skip=true -Dcrt.classifier=fips-where-available

post_build:
commands:
Expand Down
2 changes: 1 addition & 1 deletion codebuild/cd/test-platform-specific-jar-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex

PLATFORM_ARRAY=("linux-armv6" "linux-armv7" "linux-aarch_64" "linux-x86_32" "linux-x86_64" "osx-aarch_64" "osx-x86_64" "windows-x86_32" "windows-x86_64" "linux-x86_64-musl" "linux-armv7-musl" "linux-aarch_64-musl" "fips-compat")
PLATFORM_ARRAY=("linux-armv6" "linux-armv7" "linux-aarch_64" "linux-x86_32" "linux-x86_64" "osx-aarch_64" "osx-x86_64" "windows-x86_32" "windows-x86_64" "linux-x86_64-musl" "linux-armv7-musl" "linux-aarch_64-musl" "fips-where-available")

# test uber jar
mvn -B dependency:get -DrepoUrl=https://aws.oss.sonatype.org/content/repositories/snapshots -Dartifact=software.amazon.awssdk.crt:aws-crt:${CRT_VERSION}-SNAPSHOT -Dtransitive=false
Expand Down

0 comments on commit b04445e

Please sign in to comment.