Skip to content

Commit 6c04478

Browse files
authored
Update repo dependencies and github action (#24)
* add new parsec version and remove unsupported periods from target names Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: update and add missing JUnit Jupiter dependencies Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: update lombok Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * feat: update dependency versions in parent POM - Add JUnit Jupiter version property (5.11.4) - Add SLF4J version property (2.0.16) - Update JUnit Jupiter dependency to use property - Update Mockito JUnit Jupiter from 4.0.0 to 5.15.2 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * docs: improve README formatting and add development instructions - Use consistent formatting for emphasis (_text_ instead of *text*) - Add instructions for initializing submodules - Add instructions for running GitHub Actions locally - Fix whitespace and formatting throughout file 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * refactor: use property variables for dependency versions - Replace hardcoded SLF4J version with property reference in all modules - Replace hardcoded JUnit Jupiter version with property reference - Update testcontainers junit-jupiter from 1.20.4 to 1.20.5 Improves consistency and eases future version updates by centralizing version definitions in the parent POM. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: only move parsec_docker_cache_new if it exists, improve logging Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: update maven surefire plugin Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: get rid of old parsec build & run with latest since previous releases fail Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * refactor: use project properties for internal dependencies - Replace hardcoded JUnit Jupiter version with property reference - Use project properties for group ID and version in internal dependencies - Replace hardcoded group ID with ${project.groupId} - Replace hardcoded version with ${project.version} This improves maintainability by avoiding duplicated version information. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: update build_demo for new Dockerfile, not yet fixed Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: update and consolidate dependencies Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: update formatting Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: shorten default timeout Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: update socket path for new docker file Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: update and augment BasicClientTest with ECC and RSA signing and verification Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: add logging configurations Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: adapt parsec configs to new Dockerfile Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: update formatting and add toString methods Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: allow no-arg constructor for NoneMessageDigest Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: add key length to RSA_WITH_PKCS1 Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: new Dockerfile based on parsec quickstart Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * formattting Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: RSAPublicKey that works with http client Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: do not use internal apis on parsec signature Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: surprisingly, need container for message digest testing Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: ensure container is cleaned up after each test Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: formatting Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: move logback test config Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: add build details script for Dockerfile Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: update parsecconteiner to wait for socat and container start Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: update config for new dockerfile Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: add vscode config Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: new actions/cache Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: downgrade logback for java8 Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: move socket path out of parsec directory Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: exclude old versions of slf4j Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix:allow any hostname for testing purposes Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: remove testing for OS X and use socat in all test cases Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * fix: add socat to github action docker Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> * chore: update github actions Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com> --------- Signed-off-by: Sam Spycher <samspycher@users.noreply.github.com>
1 parent 1e44b25 commit 6c04478

File tree

49 files changed

+1774
-1398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1774
-1398
lines changed

.github/workflows/mvn.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,38 @@ jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010
with:
1111
submodules: true
1212
- name: Set up Docker Buildx
13-
uses: docker/setup-buildx-action@v1
13+
uses: docker/setup-buildx-action@v3
14+
- name: Install socat tool
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install socat
1418
- name: Cache Docker layers
15-
uses: actions/cache@v2
19+
uses: actions/cache@v4
1620
with:
1721
path: ./parsec-docker-test-image/parsec_docker_cache
1822
key: ${{ runner.os }}-parsec_docker_cache-${{ github.sha }}
1923
restore-keys: |
2024
${{ runner.os }}-parsec_docker_cache-
2125
- name: Set up JDK 16
22-
uses: actions/setup-java@v2
26+
uses: actions/setup-java@v4
2327
with:
24-
java-version: '16'
25-
distribution: 'zulu'
28+
java-version: "16"
29+
distribution: "zulu"
2630
architecture: x64
2731
cache: maven
2832
- name: Build with Maven
2933
# still needs work to get tests running on java 16
3034
run: ./mvnw --batch-mode clean verify -DskipTests=true
3135
- name: Set up JDK 8
32-
uses: actions/setup-java@v2
36+
uses: actions/setup-java@v4
3337
with:
34-
java-version: '8'
35-
distribution: 'zulu'
38+
java-version: "8"
39+
distribution: "zulu"
3640
architecture: x64
3741
cache: maven
3842
- name: Build with Maven
3943
run: ./mvnw --batch-mode clean verify
40-

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "automatic",
3+
"maven.view": "hierarchical"
4+
}

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This repository contains a Java Client and a [JCA provider](https://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec.html) for Parsec. The client exposes the [PSA Crypto API](https://github.com/ARMmbed/mbed-crypto/blob/psa-crypto-api/docs/PSA_Cryptography_API_Specification.pdf) to Java Applications and the JCA Provider allows existing applications that employ JCA to switch to Parsec.
44

5-
*Note*: this client is at an early stage of development and not yet ready for production use. We welcome contributions!
5+
_Note_: this client is at an early stage of development and not yet ready for production use. We welcome contributions!
66

77
## In this repository
88

@@ -12,16 +12,31 @@ The repository contains the following packages:
1212
- parsec-jca-java: JCA Provider
1313
- parsec-interface-java: Private wrapper for protobuf classes and socket communication
1414
- parsec-protobuf-java: Java Protobuf classes (generated)
15-
- parsec-testcontainers: Collection of Docker test containers for development & testing
15+
- parsec-testcontainers: Collection of Docker test containers for development & testing
1616

1717
# How to use this library
18+
1819
TODO
1920

2021
# How to develop the Parsec Java Client
21-
TODO
22+
23+
Check out this repo's submodules:
24+
25+
```sh
26+
git submodule update --init --recursive
27+
```
28+
29+
You can use `act` to run the github action locally. On OSX, you need to set the container architecture, and for testcontainers to work, you may need to set the env var `TESTCONTAINERS_HOST_OVERRIDE`.
30+
31+
Example CLI input:
32+
33+
```sh
34+
act --container-architecture linux/amd64 --env TESTCONTAINERS_HOST_OVERRIDE=`ipconfig getifaddr en0`
35+
```
2236

2337
# Example Implementations
24-
There are a number of example implementations of both the basic java client and JCA provider along with a demo (separate repository)
38+
39+
There are a number of example implementations of both the basic java client and JCA provider along with a demo (separate repository)
2540
Both the tests and workshop demo cover the basic functionality of the current implementation:
2641

2742
- Parsec JCA Tests [**Link**](/parsec-jca-test)
@@ -34,10 +49,8 @@ The software is provided under Apache-2.0. Contributions to this project are acc
3449

3550
## Contributing
3651

37-
We welcome contributing, both in the use of this client library and programming,extending of this library code base.
52+
We welcome contributing, both in the use of this client library and programming,extending of this library code base.
3853
Please check the [**Contribution Guidelines**](https://parallaxsecond.github.io/parsec-book/contributing/index.html)
3954
to know more about the contribution process.
4055

41-
*Copyright 2021 Contributors to the Parsec project.*
42-
43-
56+
_Copyright 2021 Contributors to the Parsec project._

build_demo.sh

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,58 +16,57 @@ function dirty_build_on_new_comits() {
1616
awslabs/aws-crt-java \
1717
aws/aws-iot-device-sdk-java-v2 \
1818
revaultch/aws-greengrass-nucleus; do
19-
curl -S https://api.github.com/repos/${repo}/commits/key-op-prototype
20-
done | ${md5_cmd} | cut -d" " -f1 > greengrass_demo/dirty_repo.txt
19+
curl -S https://api.github.com/repos/${repo}/commits/key-op-prototype
20+
done | ${md5_cmd} | cut -d" " -f1 >greengrass_demo/dirty_repo.txt
2121
touch -t 190001010000 greengrass_demo/dirty_repo.txt
2222
export DIRTY_TS=$(cat greengrass_demo/dirty_repo.txt)
2323
}
2424

2525
function build_greengrass_patched() {
26-
pushd examples/greengrass/parsec-greengrass-run-config/docker/
27-
docker build . \
28-
--build-arg BUILD_TS=${DIRTY_TS} \
29-
--tag parallaxsecond/greengrass_patched:latest \
30-
--progress plain
31-
popd
26+
pushd examples/greengrass/parsec-greengrass-run-config/docker/
27+
docker build . \
28+
--build-arg BUILD_TS=${DIRTY_TS} \
29+
--tag parallaxsecond/greengrass_patched:latest \
30+
--progress plain
31+
popd
3232
}
3333
function copy_deps_from_greengrass_patched_to_local() {
3434
docker run -v ~/.m2/repository:/host_m2_repository parallaxsecond/greengrass_patched:latest \
35-
/bin/bash -c "cp -r ~/.m2/repository/* /host_m2_repository"
35+
/bin/bash -c "cp -r ~/.m2/repository/* /host_m2_repository"
3636
}
3737

3838
function build_parsec_containers() {
39-
pushd ./parsec-testcontainers/
40-
./build.sh
41-
popd
39+
pushd ./parsec-testcontainers/
40+
./build.sh
41+
popd
4242
}
4343

4444
function build_greengrass_with_provider() {
45-
docker build . -f greengrass_demo/Dockerfile --tag parallaxsecond/greengrass_demo:latest --progress plain
45+
docker build . -f greengrass_demo/Dockerfile --tag parallaxsecond/greengrass_demo:latest --progress plain
4646
}
4747

4848
function parsec_run() {
49-
docker rm -f parsec_docker_run 2> /dev/null
50-
docker run -d --name parsec_docker_run \
51-
-ti \
52-
-v GG_PARSEC_STORE:/var/lib/parsec/mappings \
53-
-v GG_PARSEC_SOCK:/run/parsec \
54-
parallaxsecond/parsec:0.8.1
49+
docker rm -f parsec_docker_run 2>/dev/null
50+
docker run -d --name parsec_docker_run \
51+
-ti \
52+
-v GG_PARSEC_STORE:/parsec/quickstart/mappings\ -v GG_PARSEC_SOCK:/run/parsec \
53+
parallaxsecond/parsec:latest
5554
}
5655
function gg_run() {
57-
docker rm -f "${1}" 2> /dev/null
56+
docker rm -f "${1}" 2>/dev/null
5857

5958
# shellcheck disable=SC2086
6059
docker run ${3} \
61-
--name "${1}" \
62-
-e GG_THING_NAME="${GG_THING_NAME}" \
63-
-e GG_ADDITIONAL_CMD_ARGS="--trusted-plugin /provider.jar" \
64-
-e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" \
65-
-e AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}" \
66-
-e AWS_REGION="${AWS_REGION}" \
67-
-e AWS_SESSION_TOKEN="${AWS_SESSION_TOKEN}" \
68-
-v GG_PARSEC_SOCK:/run/parsec \
69-
-v GG_HOME:/home/ggc_user \
70-
parallaxsecond/greengrass_demo:latest "${2}"
60+
--name "${1}" \
61+
-e GG_THING_NAME="${GG_THING_NAME}" \
62+
-e GG_ADDITIONAL_CMD_ARGS="--trusted-plugin /provider.jar" \
63+
-e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" \
64+
-e AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}" \
65+
-e AWS_REGION="${AWS_REGION}" \
66+
-e AWS_SESSION_TOKEN="${AWS_SESSION_TOKEN}" \
67+
-v GG_PARSEC_SOCK:/run/parsec \
68+
-v GG_HOME:/home/ggc_user \
69+
parallaxsecond/greengrass_demo:latest "${2}"
7170
}
7271
function run_demo() {
7372
parsec_run

parsec-client-java/pom.xml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
54
<modelVersion>4.0.0</modelVersion>
65

76
<parent>
@@ -15,7 +14,6 @@
1514
<maven.compiler.source>1.8</maven.compiler.source>
1615
<maven.compiler.target>1.8</maven.compiler.target>
1716
</properties>
18-
1917
<dependencies>
2018
<dependency>
2119
<groupId>${project.groupId}</groupId>
@@ -25,17 +23,22 @@
2523
<dependency>
2624
<groupId>org.slf4j</groupId>
2725
<artifactId>slf4j-api</artifactId>
28-
<version>1.7.32</version>
26+
<version>${slf4j.version}</version>
2927
</dependency>
3028
<dependency>
3129
<groupId>net.java.dev.jna</groupId>
3230
<artifactId>jna</artifactId>
33-
<version>5.9.0</version>
31+
<version>5.17.0</version>
3432
</dependency>
3533
<dependency>
3634
<groupId>io.spiffe</groupId>
3735
<artifactId>java-spiffe-provider</artifactId>
38-
<version>0.7.0</version>
36+
<version>0.8.11</version>
37+
</dependency>
38+
<dependency>
39+
<groupId>ch.qos.logback</groupId>
40+
<artifactId>logback-classic</artifactId>
41+
<version>${logback.version}</version>
3942
</dependency>
4043
<dependency>
4144
<!-- make sure that docker images are build first -->
@@ -45,16 +48,29 @@
4548
<scope>test</scope>
4649
</dependency>
4750
<dependency>
48-
<groupId>ch.qos.logback</groupId>
49-
<artifactId>logback-classic</artifactId>
50-
<version>1.2.5</version>
51+
<groupId>org.junit.jupiter</groupId>
52+
<artifactId>junit-jupiter-api</artifactId>
53+
<version>${junit.jupiter.version}</version>
5154
<scope>test</scope>
5255
</dependency>
5356
<dependency>
5457
<groupId>org.junit.jupiter</groupId>
55-
<artifactId>junit-jupiter-api</artifactId>
56-
<version>5.8.0</version>
58+
<artifactId>junit-jupiter-engine</artifactId>
59+
<version>${junit.jupiter.version}</version>
5760
<scope>test</scope>
5861
</dependency>
5962
</dependencies>
63+
<build>
64+
<plugins>
65+
<plugin>
66+
<groupId>org.apache.maven.plugins</groupId>
67+
<artifactId>maven-surefire-plugin</artifactId>
68+
<configuration>
69+
<forkCount>1</forkCount>
70+
<reuseForks>false</reuseForks>
71+
<parallel>none</parallel>
72+
</configuration>
73+
</plugin>
74+
</plugins>
75+
</build>
6076
</project>

0 commit comments

Comments
 (0)