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

feat(policy): DSP-51 - deprecate PublicKey local field #1590

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,12 @@ jobs:
push: false

platform-xtest:
uses: opentdf/tests/.github/workflows/xtest.yml@main
uses: opentdf/tests/.github/workflows/xtest.yml@feature/deprecate-public-key-local
with:
# use commit instead of ref so we can "go get" specific sdk version
platform-ref: ${{ github.event.pull_request.head.sha || github.sha }}
otdfctl-ref: feature/deprecate-public-key-local
tests-ref: feature/deprecate-public-key-local

# test latest otdfctl CLI 'main' against platform PR branch
otdfctl-test:
Expand Down
28 changes: 0 additions & 28 deletions docs/grpc/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions docs/openapi/policy/attributes/attributes.swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions docs/openapi/policy/namespaces/namespaces.swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions docs/openapi/policy/unsafe/unsafe.swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions examples/cmd/kas.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ func upsertKasRegistration(ctx context.Context, s *sdk.SDK, uri string, pk *poli
oldpk := ki.GetPublicKey()
recreate := false
switch {
case pk != nil && pk.GetLocal() == "" && oldpk.GetLocal() == "":
case pk != nil && len(pk.GetCached().Keys) == 0 && len(oldpk.GetCached().Keys) == 0:
recreate = pk.GetRemote() != oldpk.GetRemote()
case pk != nil:
// previously remote, now local, or local and changed
recreate = pk.GetLocal() != oldpk.GetLocal()
recreate = pk.GetCached() != oldpk.GetCached()
}
if !recreate {
return ki.GetId(), nil
Expand Down Expand Up @@ -180,8 +180,15 @@ func updateKas(cmd *cobra.Command) error {
}
case key != "":
pk = new(policy.PublicKey)
pk.PublicKey = &policy.PublicKey_Local{
Local: key,
pk.PublicKey = &policy.PublicKey_Cached{
Cached: &policy.KasPublicKeySet{
Keys: []*policy.KasPublicKey{
{
Pem: key,
Alg: algString2Proto(algorithm),
},
},
},
}
}

Expand Down
1 change: 1 addition & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A=
github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y=
Expand Down
130 changes: 55 additions & 75 deletions protocol/go/policy/objects.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading