From 954ebfa99114038cc943cae8ea1871a17b4a0418 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 02:06:50 -0400 Subject: [PATCH 01/15] try background tilt --- .github/workflows/build.yaml | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7496ea10..2ae255a0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -152,6 +152,62 @@ jobs: repo: context.repo.repo, body, }); + + backend-roundtrip: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16' + cache: 'npm' + cache-dependency-path: './lib/package-lock.json' + - uses: actions/download-artifact@v2 + with: + name: opentdf-client-lib + - name: Git clone backend + run: | + git clone https://github.com/opentdf/documentation.git + - uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - run: pip install opentdf + - uses: yokawasa/action-setup-kube-tools@v0.7.1 + 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 & test roundtrip + run: |- + kubectl version + pwd + cd documentation/quickstart + pwd + tilt up & + tilt wait --for=condition=Ready "uiresource/abacus" --for=condition=Ready "uiresource/kas" --timeout 600s + python3 tests/oidc-auth.py + cd ../.. + cd ${{ github.workspace }} + pid=$(tilt get session Tiltfile -o jsonpath --template '{.status.pid}') + kill $pid + tilt down deliver-ghp: runs-on: ubuntu-latest From 98411cfe477139abf280d5e3f06059224148d34e Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 02:10:35 -0400 Subject: [PATCH 02/15] try without download artifact --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2ae255a0..681db005 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -162,9 +162,9 @@ jobs: node-version: '16' cache: 'npm' cache-dependency-path: './lib/package-lock.json' - - uses: actions/download-artifact@v2 - with: - name: opentdf-client-lib + # - uses: actions/download-artifact@v2 + # with: + # name: opentdf-client-lib - name: Git clone backend run: | git clone https://github.com/opentdf/documentation.git From 73eaa69f71fefbf624ec7ac64619f13235e0fcf2 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 02:18:52 -0400 Subject: [PATCH 03/15] try different steps --- .github/workflows/build.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 681db005..fcf17673 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -194,17 +194,22 @@ jobs: minikube-version: 1.25.1 # This should be in sync with the setup-tools version above kubernetes-version: 1.23.1 - - name: Run tilt & test roundtrip + - name: Run tilt up run: |- kubectl version pwd cd documentation/quickstart pwd - tilt up & + tilt up tilt wait --for=condition=Ready "uiresource/abacus" --for=condition=Ready "uiresource/kas" --timeout 600s + - name: Run RT test + run: |- + pwd python3 tests/oidc-auth.py cd ../.. cd ${{ github.workspace }} + - name: Run tilt down + run: |- pid=$(tilt get session Tiltfile -o jsonpath --template '{.status.pid}') kill $pid tilt down From 2d9c3db4c21ae9c52a693e5493dc1ef7d5337745 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 02:32:44 -0400 Subject: [PATCH 04/15] tilt up in background, silence output --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fcf17673..7d228c96 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -200,7 +200,7 @@ jobs: pwd cd documentation/quickstart pwd - tilt up + (tilt up &) 2> /dev/null tilt wait --for=condition=Ready "uiresource/abacus" --for=condition=Ready "uiresource/kas" --timeout 600s - name: Run RT test run: |- From 90bc374ab0db4c19fec5196a735b7e566906e34b Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 10:10:44 -0400 Subject: [PATCH 05/15] try tilt background --- .github/workflows/build.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7d228c96..6cc3a5fc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -198,9 +198,7 @@ jobs: run: |- kubectl version pwd - cd documentation/quickstart - pwd - (tilt up &) 2> /dev/null + ( cd documentation/quickstart && tilt up --stream=false & ) tilt wait --for=condition=Ready "uiresource/abacus" --for=condition=Ready "uiresource/kas" --timeout 600s - name: Run RT test run: |- From 669e0bdeca5a12f86f418839f8b52c7b4f5c554c Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 17:00:01 -0400 Subject: [PATCH 06/15] with cli roundtrip script --- .github/workflows/build.yaml | 50 +- .../workflows/roundtrip/encrypt-decrypt.sh | 26 ++ .github/workflows/roundtrip/package-lock.json | 436 ++++++++++++++++++ .github/workflows/roundtrip/package.json | 9 + lib/package-lock.json | 9 +- 5 files changed, 502 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/roundtrip/encrypt-decrypt.sh create mode 100644 .github/workflows/roundtrip/package-lock.json create mode 100644 .github/workflows/roundtrip/package.json diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6cc3a5fc..d6e429b5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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: @@ -154,25 +158,33 @@ jobs: }); 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: './lib/package-lock.json' - # - uses: actions/download-artifact@v2 - # with: - # name: opentdf-client-lib + cache-dependency-path: '.github/workflows/roundtrip/package-lock.json' + - uses: actions/download-artifact@v2 + with: + name: opentdf-client + - uses: actions/download-artifact@v2 + with: + name: opentdf-cli - name: Git clone backend run: | git clone https://github.com/opentdf/documentation.git - - uses: actions/setup-python@v3 - with: - python-version: '3.9' - cache: 'pip' - - run: pip install opentdf + # - uses: actions/setup-python@v3 + # with: + # python-version: '3.9' + # cache: 'pip' + # - run: pip install opentdf - uses: yokawasa/action-setup-kube-tools@v0.7.1 with: setup-tools: | @@ -194,23 +206,11 @@ jobs: minikube-version: 1.25.1 # This should be in sync with the setup-tools version above kubernetes-version: 1.23.1 - - name: Run tilt up - run: |- - kubectl version - pwd - ( cd documentation/quickstart && tilt up --stream=false & ) - tilt wait --for=condition=Ready "uiresource/abacus" --for=condition=Ready "uiresource/kas" --timeout 600s - - name: Run RT test - run: |- - pwd - python3 tests/oidc-auth.py - cd ../.. - cd ${{ github.workspace }} - - name: Run tilt down + - name: Run tilt ci + env: + TEST_SCRIPT: ./encrypt-decrypt.sh run: |- - pid=$(tilt get session Tiltfile -o jsonpath --template '{.status.pid}') - kill $pid - tilt down + tilt ci --file documentation/quickstart/Tiltfile deliver-ghp: runs-on: ubuntu-latest diff --git a/.github/workflows/roundtrip/encrypt-decrypt.sh b/.github/workflows/roundtrip/encrypt-decrypt.sh new file mode 100644 index 00000000..0e04b340 --- /dev/null +++ b/.github/workflows/roundtrip/encrypt-decrypt.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +pwd + +mv ../../../opentdf-cli-*.tgz ../../../cli +npm uninstall @opentdf/cli && npm ci && npm i ../../../cli/opentdf-cli-*.tgz + +touch ./sample.txt +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 "Rountrip successful!" \ No newline at end of file diff --git a/.github/workflows/roundtrip/package-lock.json b/.github/workflows/roundtrip/package-lock.json new file mode 100644 index 00000000..28f0f3a8 --- /dev/null +++ b/.github/workflows/roundtrip/package-lock.json @@ -0,0 +1,436 @@ +{ + "name": "client-web-roundtrip", + "version": "0.0.1", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "client-web-roundtrip", + "version": "0.0.1", + "dependencies": { + "@opentdf/cli": "file:../../../cli/opentdf-cli-0.1.0.tgz" + } + }, + "node_modules/@opentdf/cli": { + "version": "0.1.0", + "resolved": "file:../../../cli/opentdf-cli-0.1.0.tgz", + "integrity": "sha512-EJhbojaQYEq/bTT4brOUTOMzT9N2i0oBRQ5WlnwUM5vcYMegVIQdPHSAtj1k7leTQk+i8DcDRNINZ2NQ0o2MeQ==", + "license": "MIT", + "dependencies": { + "@opentdf/client": "file:../opentdf-client-0.1.0.tgz", + "cross-fetch": "^3.1.5", + "yargs": "^17.3.1" + }, + "bin": { + "opentdf": "bin/opentdf.mjs" + } + }, + "node_modules/@opentdf/client": { + "version": "0.1.0", + "resolved": "file:../../../opentdf-client-0.1.0.tgz", + "integrity": "sha512-LJFSStO9jPMkLx7lAfs+C9W/Mg3HN5hS/RktxuELIFQifRZfI/5Z8NBkUdcTKJmc83ndJwNuBfR46+EKHCaHMw==", + "license": "MIT", + "dependencies": { + "jose": "~4.6.0", + "uuid": "~8.3.2" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "dependencies": { + "node-fetch": "2.6.7" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/jose": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.6.2.tgz", + "integrity": "sha512-7Jd3kGkgDfhpj+SFqfam70HyVC0gtdfbGc/tHb5dqsWYlQqodgkotqWYEXn1PhQXgdJqsyOAIKT0N4O2riUFiA==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", + "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "engines": { + "node": ">=12" + } + } + }, + "dependencies": { + "@opentdf/cli": { + "version": "file:../../../cli/opentdf-cli-0.1.0.tgz", + "integrity": "sha512-EJhbojaQYEq/bTT4brOUTOMzT9N2i0oBRQ5WlnwUM5vcYMegVIQdPHSAtj1k7leTQk+i8DcDRNINZ2NQ0o2MeQ==", + "requires": { + "@opentdf/client": "file:../opentdf-client-0.1.0.tgz", + "cross-fetch": "^3.1.5", + "yargs": "^17.3.1" + } + }, + "@opentdf/client": { + "version": "file:../opentdf-client-0.1.0.tgz", + "integrity": "sha512-LJFSStO9jPMkLx7lAfs+C9W/Mg3HN5hS/RktxuELIFQifRZfI/5Z8NBkUdcTKJmc83ndJwNuBfR46+EKHCaHMw==", + "requires": { + "jose": "~4.6.0", + "uuid": "~8.3.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "requires": { + "node-fetch": "2.6.7" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "jose": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.6.2.tgz", + "integrity": "sha512-7Jd3kGkgDfhpj+SFqfam70HyVC0gtdfbGc/tHb5dqsWYlQqodgkotqWYEXn1PhQXgdJqsyOAIKT0N4O2riUFiA==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs": { + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.4.1.tgz", + "integrity": "sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + } + }, + "yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" + } + } +} diff --git a/.github/workflows/roundtrip/package.json b/.github/workflows/roundtrip/package.json new file mode 100644 index 00000000..52c067f5 --- /dev/null +++ b/.github/workflows/roundtrip/package.json @@ -0,0 +1,9 @@ +{ + "name": "client-web-roundtrip", + "version": "0.0.1", + "description": "Simple example to encrypt and decrypt files with quickstart backend.", + "scripts": {}, + "dependencies": { + "@opentdf/cli": "file:../../../cli/opentdf-cli-0.1.0.tgz" + } +} diff --git a/lib/package-lock.json b/lib/package-lock.json index afb77d8b..4bee9519 100644 --- a/lib/package-lock.json +++ b/lib/package-lock.json @@ -1095,9 +1095,10 @@ } }, "node_modules/async": { - "version": "2.6.3", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, - "license": "MIT", "dependencies": { "lodash": "^4.17.14" } @@ -5953,7 +5954,9 @@ "dev": true }, "async": { - "version": "2.6.3", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "requires": { "lodash": "^4.17.14" From 6302145645acff0448edf0552c74ea8b8c0b2533 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 17:04:27 -0400 Subject: [PATCH 07/15] wrong download artifact --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d6e429b5..9550b3a5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -173,7 +173,7 @@ jobs: cache-dependency-path: '.github/workflows/roundtrip/package-lock.json' - uses: actions/download-artifact@v2 with: - name: opentdf-client + name: opentdf-client-lib - uses: actions/download-artifact@v2 with: name: opentdf-cli From c2dbda3ed45a99bcc0e44bda18e0950b3499d63e Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 17:13:09 -0400 Subject: [PATCH 08/15] script path relative to tiltfile --- .github/workflows/build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9550b3a5..912ed502 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -208,7 +208,8 @@ jobs: kubernetes-version: 1.23.1 - name: Run tilt ci env: - TEST_SCRIPT: ./encrypt-decrypt.sh + #path relative to the quickstart Tiltfile + TEST_SCRIPT: ../../encrypt-decrypt.sh run: |- tilt ci --file documentation/quickstart/Tiltfile From 6bfd02a2f7da8a28a9c75fac8c816f39f82da778 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 17:23:03 -0400 Subject: [PATCH 09/15] chmod of encrypt-decrypt --- .github/workflows/roundtrip/encrypt-decrypt.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/workflows/roundtrip/encrypt-decrypt.sh diff --git a/.github/workflows/roundtrip/encrypt-decrypt.sh b/.github/workflows/roundtrip/encrypt-decrypt.sh old mode 100644 new mode 100755 From 4a04a49d561e0aece0bb84c6fcdf85cfbbbe1411 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 17:33:02 -0400 Subject: [PATCH 10/15] exit on error bash --- .github/workflows/roundtrip/encrypt-decrypt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/roundtrip/encrypt-decrypt.sh b/.github/workflows/roundtrip/encrypt-decrypt.sh index 0e04b340..f3dfa3d2 100755 --- a/.github/workflows/roundtrip/encrypt-decrypt.sh +++ b/.github/workflows/roundtrip/encrypt-decrypt.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e +cd ../.. pwd mv ../../../opentdf-cli-*.tgz ../../../cli From 5ef1d2317b3ef01ae9e83d8dda5779efd1be054d Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Tue, 26 Apr 2022 17:42:03 -0400 Subject: [PATCH 11/15] cleanup --- .github/workflows/build.yaml | 5 ----- .github/workflows/roundtrip/encrypt-decrypt.sh | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 912ed502..8ca5b027 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -180,11 +180,6 @@ jobs: - name: Git clone backend run: | git clone https://github.com/opentdf/documentation.git - # - uses: actions/setup-python@v3 - # with: - # python-version: '3.9' - # cache: 'pip' - # - run: pip install opentdf - uses: yokawasa/action-setup-kube-tools@v0.7.1 with: setup-tools: | diff --git a/.github/workflows/roundtrip/encrypt-decrypt.sh b/.github/workflows/roundtrip/encrypt-decrypt.sh index f3dfa3d2..15edc223 100755 --- a/.github/workflows/roundtrip/encrypt-decrypt.sh +++ b/.github/workflows/roundtrip/encrypt-decrypt.sh @@ -14,7 +14,7 @@ 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 +--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 \ From 64643b1f39a86d83d7716445246de1d5816004a9 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Wed, 27 Apr 2022 15:23:55 -0400 Subject: [PATCH 12/15] suggested changes --- .github/workflows/roundtrip/encrypt-decrypt.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/roundtrip/encrypt-decrypt.sh b/.github/workflows/roundtrip/encrypt-decrypt.sh index 15edc223..186e998b 100755 --- a/.github/workflows/roundtrip/encrypt-decrypt.sh +++ b/.github/workflows/roundtrip/encrypt-decrypt.sh @@ -7,8 +7,7 @@ pwd mv ../../../opentdf-cli-*.tgz ../../../cli npm uninstall @opentdf/cli && npm ci && npm i ../../../cli/opentdf-cli-*.tgz -touch ./sample.txt -echo "Hello World!" >> ./sample.txt +echo "Hello World!" > ./sample.txt npx @opentdf/cli --log-level DEBUG \ --kasEndpoint http://localhost:65432/api/kas \ @@ -25,4 +24,4 @@ npx @opentdf/cli --log-level DEBUG \ diff sample.txt sample_out.txt -echo "Rountrip successful!" \ No newline at end of file +echo "Roundtrip successful!" \ No newline at end of file From a4ce50ec9a0dc83799376f6c169fb34741d435c6 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Wed, 27 Apr 2022 15:36:57 -0400 Subject: [PATCH 13/15] add wait and test --- .github/workflows/build.yaml | 2 +- .../workflows/roundtrip/encrypt-decrypt.sh | 1 - .github/workflows/roundtrip/wait-and-test.sh | 24 +++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100755 .github/workflows/roundtrip/wait-and-test.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8ca5b027..37a44049 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -204,7 +204,7 @@ jobs: - name: Run tilt ci env: #path relative to the quickstart Tiltfile - TEST_SCRIPT: ../../encrypt-decrypt.sh + TEST_SCRIPT: ../../wait-and-test.sh run: |- tilt ci --file documentation/quickstart/Tiltfile diff --git a/.github/workflows/roundtrip/encrypt-decrypt.sh b/.github/workflows/roundtrip/encrypt-decrypt.sh index 186e998b..f384a575 100755 --- a/.github/workflows/roundtrip/encrypt-decrypt.sh +++ b/.github/workflows/roundtrip/encrypt-decrypt.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -e -cd ../.. pwd mv ../../../opentdf-cli-*.tgz ../../../cli diff --git a/.github/workflows/roundtrip/wait-and-test.sh b/.github/workflows/roundtrip/wait-and-test.sh new file mode 100755 index 00000000..ba91828b --- /dev/null +++ b/.github/workflows/roundtrip/wait-and-test.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +APP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" +APP="${APP_DIR}/encrypt-decrypt.sh" + +_wait-for() { + echo "[INFO] In retry loop for quickstarted opentdf backend..." + limit=5 + for i in $(seq 1 $limit); do + if sh "${APP}"; then + return 0 + fi + if [[ $i == $limit ]]; then + break + fi + sleep_for=$((10 + i * i * 2)) + echo "[INFO] retrying in ${sleep_for} seconds... ( ${i} / $limit ) ..." + sleep ${sleep_for} + done + echo "[ERROR] Couldn't connect to opentdf backend" + exit 1 +} + +_wait-for \ No newline at end of file From a667f159991337e40b125a8d5f7556cb4e023d45 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Wed, 27 Apr 2022 15:45:40 -0400 Subject: [PATCH 14/15] update relative path --- .github/workflows/roundtrip/encrypt-decrypt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/roundtrip/encrypt-decrypt.sh b/.github/workflows/roundtrip/encrypt-decrypt.sh index f384a575..e23d06b7 100755 --- a/.github/workflows/roundtrip/encrypt-decrypt.sh +++ b/.github/workflows/roundtrip/encrypt-decrypt.sh @@ -2,6 +2,7 @@ set -e pwd +cd ../.. mv ../../../opentdf-cli-*.tgz ../../../cli npm uninstall @opentdf/cli && npm ci && npm i ../../../cli/opentdf-cli-*.tgz From 8f8ba6dd2be000dd60a23554fbd05dcf69c83ee3 Mon Sep 17 00:00:00 2001 From: Elizabeth Healy Date: Fri, 29 Apr 2022 10:59:07 -0400 Subject: [PATCH 15/15] doesnt work on reruns --- .github/workflows/roundtrip/encrypt-decrypt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/roundtrip/encrypt-decrypt.sh b/.github/workflows/roundtrip/encrypt-decrypt.sh index e23d06b7..5813d5d0 100755 --- a/.github/workflows/roundtrip/encrypt-decrypt.sh +++ b/.github/workflows/roundtrip/encrypt-decrypt.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash set -e -pwd cd ../.. +pwd -mv ../../../opentdf-cli-*.tgz ../../../cli +cp ../../../opentdf-cli-*.tgz ../../../cli npm uninstall @opentdf/cli && npm ci && npm i ../../../cli/opentdf-cli-*.tgz echo "Hello World!" > ./sample.txt