Skip to content

Commit fd1b386

Browse files
feat(sdk): Allow custom KAO array templates (#307)
- Adds the ability to share and split DEKs - Reconstructs keys using share ids This will allow opening of files with multi-kas splits. Step 1 of #314 While I'm here I also: 1. Lets platform-xtest job run in parallel with other e2e tests 2. Updates config for platform-roundtrip job, since the `provision fixture keycloak` needs a new config file 3. Adds a new phony make target to simplify development, you can now `make cli` to get the cli without having to guess the version number 4. Adds a `prettier ignore` directive so `make format` no longer formats the generated protocol buffer code 5. Updates the fetching of KAS public keys to happen during encrypt, not during client creation. This makes more sense now that we don't know at client start time which kases will actually be involved in the encrypt step --- Co-authored-by: Patrick Bacon-Blaber <[email protected]>
1 parent 6d01eff commit fd1b386

File tree

20 files changed

+350
-146
lines changed

20 files changed

+350
-146
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ jobs:
253253
./wait-and-test.sh platform
254254
255255
platform-xtest:
256-
needs: platform-roundtrip
256+
needs:
257+
- cli
258+
- lib
257259
uses: opentdf/tests/.github/workflows/xtest.yml@main
258260
with:
259261
js-ref: ${{ github.ref }}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
baseUrl: &baseUrl http://localhost:8888
2+
serverBaseUrl: &serverBaseUrl http://localhost:8080
3+
customAudMapper: &customAudMapper
4+
name: audience-mapper
5+
protocol: openid-connect
6+
protocolMapper: oidc-audience-mapper
7+
config:
8+
included.custom.audience: *serverBaseUrl
9+
access.token.claim: "true"
10+
id.token.claim: "true"
11+
realms:
12+
- realm_repepresentation:
13+
realm: opentdf
14+
enabled: true
15+
custom_realm_roles:
16+
- name: opentdf-org-admin
17+
- name: opentdf-admin
18+
- name: opentdf-standard
19+
custom_client_roles:
20+
tdf-entity-resolution:
21+
- name: entity-resolution-test-role
22+
custom_groups:
23+
- name: mygroup
24+
attributes:
25+
mygroupattribute:
26+
- mygroupvalue
27+
clients:
28+
- client:
29+
clientID: opentdf
30+
enabled: true
31+
name: opentdf
32+
serviceAccountsEnabled: true
33+
clientAuthenticatorType: client-secret
34+
secret: secret
35+
protocolMappers:
36+
- *customAudMapper
37+
sa_realm_roles:
38+
- opentdf-org-admin
39+
- client:
40+
clientID: opentdf-sdk
41+
enabled: true
42+
name: opentdf-sdk
43+
serviceAccountsEnabled: true
44+
clientAuthenticatorType: client-secret
45+
secret: secret
46+
protocolMappers:
47+
- *customAudMapper
48+
sa_realm_roles:
49+
- opentdf-standard
50+
- client:
51+
clientID: tdf-entity-resolution
52+
enabled: true
53+
name: tdf-entity-resolution
54+
serviceAccountsEnabled: true
55+
clientAuthenticatorType: client-secret
56+
secret: secret
57+
protocolMappers:
58+
- *customAudMapper
59+
sa_client_roles:
60+
realm-management:
61+
- view-clients
62+
- query-clients
63+
- view-users
64+
- query-users
65+
- client:
66+
clientID: tdf-authorization-svc
67+
enabled: true
68+
name: tdf-authorization-svc
69+
serviceAccountsEnabled: true
70+
clientAuthenticatorType: client-secret
71+
secret: secret
72+
protocolMappers:
73+
- *customAudMapper
74+
- client:
75+
clientID: opentdf-public
76+
enabled: true
77+
name: opentdf-public
78+
serviceAccountsEnabled: false
79+
publicClient: true
80+
redirectUris:
81+
- 'http://localhost:9000/*' # otdfctl CLI tool
82+
protocolMappers:
83+
- *customAudMapper
84+
users:
85+
- username: sample-user
86+
enabled: true
87+
firstName: sample
88+
lastName: user
89+
90+
credentials:
91+
- value: testuser123
92+
type: password
93+
attributes:
94+
superhero_name:
95+
- thor
96+
superhero_group:
97+
- avengers
98+
groups:
99+
- mygroup
100+
realmRoles:
101+
- opentdf-org-admin
102+
clientRoles:
103+
realm-management:
104+
- view-clients
105+
- query-clients
106+
- view-users
107+
- query-users
108+
tdf-entity-resolution:
109+
- entity-resolution-test-role
110+
token_exchanges:
111+
- start_client: opentdf
112+
target_client: opentdf-sdk
113+
114+

.github/workflows/roundtrip/opentdf.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,18 @@ logger:
1010
# password: changeme
1111
services:
1212
kas:
13-
enabled: true
1413
keyring:
1514
- kid: e1
1615
alg: ec:secp256r1
16+
- kid: e1
17+
alg: ec:secp256r1
18+
legacy: true
1719
- kid: r1
1820
alg: rsa:2048
1921
- kid: r1
2022
alg: rsa:2048
2123
legacy: true
22-
policy:
23-
enabled: true
24-
authorization:
25-
enabled: true
26-
ersurl: http://localhost:65432/entityresolution/resolve
27-
clientid: tdf-authorization-svc
28-
clientsecret: secret
29-
tokenendpoint: http://localhost:65432/auth/realms/opentdf/protocol/openid-connect/token
3024
entityresolution:
31-
enabled: true
3225
url: http://localhost:65432/auth
3326
clientid: 'tdf-entity-resolution'
3427
clientsecret: 'secret'
@@ -41,6 +34,7 @@ services:
4134
server:
4235
auth:
4336
enabled: true
37+
public_client_id: 'opentdf-public'
4438
audience: 'http://localhost:65432'
4539
issuer: http://localhost:65432/auth/realms/opentdf
4640
policy:

.github/workflows/roundtrip/wait-and-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ _init_platform() {
106106
if [ -f go.work ]; then
107107
svc=github.com/opentdf/platform/service
108108
fi
109-
if ! go run "${svc}" provision keycloak; then
109+
if ! go run "${svc}" provision keycloak -f "${APP_DIR}/keycloak_data.yaml"; then
110110
echo "[ERROR] unable to provision keycloak"
111111
return 1
112112
fi

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ version=2.0.0
33
extras=cli remote-store web-app
44
pkgs=lib $(extras)
55

6-
.PHONY: all audit license-check lint test ci i start format clean
6+
.PHONY: all audit ci clean cli format i license-check lint start test
77

88
start: all
99
(cd web-app && npm run dev)
1010

11+
cli: cli/opentdf-cli-$(version).tgz
12+
1113
clean:
1214
rm -f *.tgz
1315
rm -f */*.tgz

cli/package-lock.json

Lines changed: 9 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/src/platform

0 commit comments

Comments
 (0)