Skip to content
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

PLAT-1679 roundtrip test with backend #43

Merged
merged 16 commits into from
Apr 29, 2022
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
55 changes: 55 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ jobs:
with:
bats-version: 1.2.1
- run: bats bin/opentdf.bats
- uses: actions/upload-artifact@v2
with:
name: opentdf-cli
path: ./cli/opentdf-cli-*.tgz

sample-web-app:
needs:
Expand Down Expand Up @@ -152,6 +156,57 @@ jobs:
repo: context.repo.repo,
body,
});

backend-roundtrip:
needs:
- cli
runs-on: ubuntu-latest
defaults:
run:
working-directory: .github/workflows/roundtrip
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: '.github/workflows/roundtrip/package-lock.json'
- uses: actions/download-artifact@v2
with:
name: opentdf-client-lib
- uses: actions/download-artifact@v2
with:
name: opentdf-cli
- name: Git clone backend
run: |
git clone https://github.com/opentdf/documentation.git
- uses: yokawasa/[email protected]
with:
setup-tools: |
kubectl
helm
tilt
# This should be in sync with the minikube-deployed kube version below
kubectl: "1.23.1"
helm: "3.8.0"
tilt: "0.26.2"
- run: |
kubectl version --client
kustomize version
tilt version
- name: start minikube
id: minikube
uses: medyagh/setup-minikube@master
with:
minikube-version: 1.25.1
# This should be in sync with the setup-tools version above
kubernetes-version: 1.23.1
- name: Run tilt ci
env:
#path relative to the quickstart Tiltfile
TEST_SCRIPT: ../../wait-and-test.sh
run: |-
tilt ci --file documentation/quickstart/Tiltfile

deliver-ghp:
runs-on: ubuntu-latest
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/roundtrip/encrypt-decrypt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
set -e

cd ../..
pwd

cp ../../../opentdf-cli-*.tgz ../../../cli
npm uninstall @opentdf/cli && npm ci && npm i ../../../cli/opentdf-cli-*.tgz

echo "Hello World!" > ./sample.txt

npx @opentdf/cli --log-level DEBUG \
--kasEndpoint http://localhost:65432/api/kas \
--oidcEndpoint http://localhost:65432 \
--auth tdf:tdf-client:123-456 \
--output sample.txt.tdf encrypt sample.txt \
--attributes https://example.com/attr/Classification/value/S,https://example.com/attr/COI/value/PRX

npx @opentdf/cli --log-level DEBUG \
--kasEndpoint http://localhost:65432/api/kas \
--oidcEndpoint http://localhost:65432 \
--auth tdf:tdf-client:123-456 \
--output sample_out.txt decrypt sample.txt.tdf

diff sample.txt sample_out.txt

echo "Roundtrip successful!"
Loading