Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7521507
add new parsec version and remove unsupported periods from target names
samspycher Jan 31, 2025
7f78704
fix: update and add missing JUnit Jupiter dependencies
samspycher Feb 4, 2025
2f38e8d
chore: update lombok
samspycher Feb 21, 2025
ffd9bb7
feat: update dependency versions in parent POM
samspycher Mar 2, 2025
93996a3
docs: improve README formatting and add development instructions
samspycher Mar 2, 2025
254f27c
refactor: use property variables for dependency versions
samspycher Mar 2, 2025
e5a26e7
fix: only move parsec_docker_cache_new if it exists, improve logging
samspycher Mar 26, 2025
709238d
chore: update maven surefire plugin
samspycher Mar 26, 2025
4ec32aa
chore: get rid of old parsec build & run with latest since previous r…
samspycher Mar 26, 2025
bf41ecb
refactor: use project properties for internal dependencies
samspycher Mar 28, 2025
ed30057
fix: update build_demo for new Dockerfile, not yet fixed
samspycher Apr 4, 2025
ca237ff
chore: update and consolidate dependencies
samspycher Apr 4, 2025
883d7b1
chore: update formatting
samspycher Apr 4, 2025
08372ef
chore: shorten default timeout
samspycher Apr 4, 2025
2beeb2e
fix: update socket path for new docker file
samspycher Apr 4, 2025
8a1f56f
fix: update and augment BasicClientTest with ECC and RSA signing and …
samspycher Apr 4, 2025
1454841
chore: add logging configurations
samspycher Apr 4, 2025
28e78f1
fix: adapt parsec configs to new Dockerfile
samspycher Apr 4, 2025
920e1e4
chore: update formatting and add toString methods
samspycher Apr 4, 2025
f1c0b01
fix: allow no-arg constructor for NoneMessageDigest
samspycher Apr 4, 2025
0d6bf8f
fix: add key length to RSA_WITH_PKCS1
samspycher Apr 4, 2025
5f8fe26
fix: new Dockerfile based on parsec quickstart
samspycher Apr 4, 2025
49fc1a0
formattting
samspycher Apr 4, 2025
68d6849
fix: RSAPublicKey that works with http client
samspycher Apr 4, 2025
f1f0e2c
fix: do not use internal apis on parsec signature
samspycher Apr 4, 2025
5e625f6
fix: surprisingly, need container for message digest testing
samspycher Apr 4, 2025
cc3ebb5
fix: ensure container is cleaned up after each test
samspycher Apr 4, 2025
b111298
chore: formatting
samspycher Apr 4, 2025
ae3a2d1
chore: move logback test config
samspycher Apr 4, 2025
dab4ec5
fix: add build details script for Dockerfile
samspycher Apr 4, 2025
c173ef0
fix: update parsecconteiner to wait for socat and container start
samspycher Apr 4, 2025
47fe643
fix: update config for new dockerfile
samspycher Apr 4, 2025
778c214
chore: add vscode config
samspycher Apr 4, 2025
6fe7d21
fix: new actions/cache
samspycher Apr 4, 2025
c0dfbc7
fix: downgrade logback for java8
samspycher Apr 4, 2025
644b72f
fix: move socket path out of parsec directory
samspycher Apr 22, 2025
a935390
fix: exclude old versions of slf4j
samspycher Apr 22, 2025
a87d42b
fix:allow any hostname for testing purposes
samspycher Apr 22, 2025
84d47e0
fix: remove testing for OS X and use socat in all test cases
samspycher Apr 22, 2025
e1c6872
fix: add socat to github action docker
samspycher Apr 22, 2025
6ab0923
chore: update github actions
samspycher Apr 25, 2025
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
23 changes: 13 additions & 10 deletions .github/workflows/mvn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,38 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Install socat tool
run: |
sudo apt-get update
sudo apt-get install socat
- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ./parsec-docker-test-image/parsec_docker_cache
key: ${{ runner.os }}-parsec_docker_cache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-parsec_docker_cache-
- name: Set up JDK 16
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '16'
distribution: 'zulu'
java-version: "16"
distribution: "zulu"
architecture: x64
cache: maven
- name: Build with Maven
# still needs work to get tests running on java 16
run: ./mvnw --batch-mode clean verify -DskipTests=true
- name: Set up JDK 8
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
java-version: "8"
distribution: "zulu"
architecture: x64
cache: maven
- name: Build with Maven
run: ./mvnw --batch-mode clean verify

4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"maven.view": "hierarchical"
}
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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.

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

## In this repository

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

# How to use this library

TODO

# How to develop the Parsec Java Client
TODO

Check out this repo's submodules:

```sh
git submodule update --init --recursive
```

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

Example CLI input:

```sh
act --container-architecture linux/amd64 --env TESTCONTAINERS_HOST_OVERRIDE=`ipconfig getifaddr en0`
```

# Example Implementations
There are a number of example implementations of both the basic java client and JCA provider along with a demo (separate repository)

There are a number of example implementations of both the basic java client and JCA provider along with a demo (separate repository)
Both the tests and workshop demo cover the basic functionality of the current implementation:

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

## Contributing

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

*Copyright 2021 Contributors to the Parsec project.*


_Copyright 2021 Contributors to the Parsec project._
59 changes: 29 additions & 30 deletions build_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,57 @@ function dirty_build_on_new_comits() {
awslabs/aws-crt-java \
aws/aws-iot-device-sdk-java-v2 \
revaultch/aws-greengrass-nucleus; do
curl -S https://api.github.com/repos/${repo}/commits/key-op-prototype
done | ${md5_cmd} | cut -d" " -f1 > greengrass_demo/dirty_repo.txt
curl -S https://api.github.com/repos/${repo}/commits/key-op-prototype
done | ${md5_cmd} | cut -d" " -f1 >greengrass_demo/dirty_repo.txt
touch -t 190001010000 greengrass_demo/dirty_repo.txt
export DIRTY_TS=$(cat greengrass_demo/dirty_repo.txt)
}

function build_greengrass_patched() {
pushd examples/greengrass/parsec-greengrass-run-config/docker/
docker build . \
--build-arg BUILD_TS=${DIRTY_TS} \
--tag parallaxsecond/greengrass_patched:latest \
--progress plain
popd
pushd examples/greengrass/parsec-greengrass-run-config/docker/
docker build . \
--build-arg BUILD_TS=${DIRTY_TS} \
--tag parallaxsecond/greengrass_patched:latest \
--progress plain
popd
}
function copy_deps_from_greengrass_patched_to_local() {
docker run -v ~/.m2/repository:/host_m2_repository parallaxsecond/greengrass_patched:latest \
/bin/bash -c "cp -r ~/.m2/repository/* /host_m2_repository"
/bin/bash -c "cp -r ~/.m2/repository/* /host_m2_repository"
}

function build_parsec_containers() {
pushd ./parsec-testcontainers/
./build.sh
popd
pushd ./parsec-testcontainers/
./build.sh
popd
}

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

function parsec_run() {
docker rm -f parsec_docker_run 2> /dev/null
docker run -d --name parsec_docker_run \
-ti \
-v GG_PARSEC_STORE:/var/lib/parsec/mappings \
-v GG_PARSEC_SOCK:/run/parsec \
parallaxsecond/parsec:0.8.1
docker rm -f parsec_docker_run 2>/dev/null
docker run -d --name parsec_docker_run \
-ti \
-v GG_PARSEC_STORE:/parsec/quickstart/mappings\ -v GG_PARSEC_SOCK:/run/parsec \
parallaxsecond/parsec:latest
}
function gg_run() {
docker rm -f "${1}" 2> /dev/null
docker rm -f "${1}" 2>/dev/null

# shellcheck disable=SC2086
docker run ${3} \
--name "${1}" \
-e GG_THING_NAME="${GG_THING_NAME}" \
-e GG_ADDITIONAL_CMD_ARGS="--trusted-plugin /provider.jar" \
-e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" \
-e AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}" \
-e AWS_REGION="${AWS_REGION}" \
-e AWS_SESSION_TOKEN="${AWS_SESSION_TOKEN}" \
-v GG_PARSEC_SOCK:/run/parsec \
-v GG_HOME:/home/ggc_user \
parallaxsecond/greengrass_demo:latest "${2}"
--name "${1}" \
-e GG_THING_NAME="${GG_THING_NAME}" \
-e GG_ADDITIONAL_CMD_ARGS="--trusted-plugin /provider.jar" \
-e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" \
-e AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}" \
-e AWS_REGION="${AWS_REGION}" \
-e AWS_SESSION_TOKEN="${AWS_SESSION_TOKEN}" \
-v GG_PARSEC_SOCK:/run/parsec \
-v GG_HOME:/home/ggc_user \
parallaxsecond/greengrass_demo:latest "${2}"
}
function run_demo() {
parsec_run
Expand Down
38 changes: 27 additions & 11 deletions parsec-client-java/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
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">
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">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -15,7 +14,6 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
Expand All @@ -25,17 +23,22 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.32</version>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.9.0</version>
<version>5.17.0</version>
</dependency>
<dependency>
<groupId>io.spiffe</groupId>
<artifactId>java-spiffe-provider</artifactId>
<version>0.7.0</version>
<version>0.8.11</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<!-- make sure that docker images are build first -->
Expand All @@ -45,16 +48,29 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.5</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.8.0</version>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<parallel>none</parallel>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading