-
Notifications
You must be signed in to change notification settings - Fork 24
feat(policy): namespace root certificates #2771
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
Conversation
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
…or certificate management. Add associated tests.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
service/policy/db/migrations/20251002000000_add_namespace_certificates.sql
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple small comments.
Are you wanting to be able to retrieve your created certs? In addition, you will probably want an easy command to list your namespace <-> cert pairs. Key management uses a function called ListKeyMappings, which will return all mappings for namespace/definition/value <-> kas asymmetric keys.
…distinction, enhance namespace-certificate management with ID/FQN support. Update related migrations, RPCs, and documentation.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
…e related methods to improve root certificate management, error handling, and assignment logic.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
…space # Conflicts: # docs/grpc/index.html # docs/openapi/policy/actions/actions.openapi.yaml # docs/openapi/policy/attributes/attributes.openapi.yaml # docs/openapi/policy/namespaces/namespaces.openapi.yaml # docs/openapi/policy/objects.openapi.yaml # docs/openapi/policy/obligations/obligations.openapi.yaml # docs/openapi/policy/registeredresources/registered_resources.openapi.yaml # docs/openapi/policy/resourcemapping/resource_mapping.openapi.yaml # docs/openapi/policy/subjectmapping/subject_mapping.openapi.yaml # docs/openapi/policy/unsafe/unsafe.openapi.yaml # protocol/go/policy/namespaces/namespaces.pb.go # protocol/go/policy/namespaces/namespaces_grpc.pb.go # protocol/go/policy/namespaces/namespacesconnect/namespaces.connect.go # protocol/go/policy/objects.pb.go # service/policy/namespaces/namespaces.go # service/policy/namespaces/namespaces.proto # service/policy/objects.proto
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
…rFqnMismatch` and `ErrInvalidCertificate` for improved specificity; replace generic error messages with structured errors using `errors.Join`.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
…tured `fmt.Errorf` and adjust test expectations accordingly.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the idea of a namespace cert, and don't see any significant issues to this design. Marking as requires changes because of a couple small bugs noticed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After consultation we've decided to move forward and figure out any additional enhancements in the future.
…cate validations with tests
3f0b299
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Standard Benchmark Metrics Skipped or FailedBulk Benchmark Results
TDF3 Benchmark Results:
NANOTDF Benchmark Results:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me. Technically the transaction behavior will depend on the databases configured transaction isolation defaults, but I suspect this is not a huge concern.
🤖 I have created a release *beep* *boop* --- ## [0.11.0](service/v0.10.0...service/v0.11.0) (2025-10-22) ### Features * **authz:** add obligation fulfillment logic to obligation PDP ([#2740](#2740)) ([2f8d30d](2f8d30d)) * **authz:** audit logs should properly handle obligations ([#2824](#2824)) ([874ec7b](874ec7b)) * **authz:** defer to request auth as decision/entitlements entity ([#2789](#2789)) ([feb34d8](feb34d8)) * **authz:** obligations protos within auth service ([#2745](#2745)) ([41ee5a8](41ee5a8)) * **authz:** protovalidate tests for new authz obligations fields ([#2747](#2747)) ([73e6319](73e6319)) * **authz:** service logic to use request auth as entity identifier in PDP decisions/entitlements ([#2790](#2790)) ([6784e88](6784e88)) * **authz:** wire up obligations enforcement in auth service ([#2756](#2756)) ([11b3ea9](11b3ea9)) * **core:** propagate token clientID on configured claim via interceptor into shared context metadata ([#2760](#2760)) ([0f77246](0f77246)) * **kas:** Add required obligations to kao metadata.: ([#2806](#2806)) ([16fb26c](16fb26c)) * **policy:** add FQNs to obligation defs + vals ([#2749](#2749)) ([fa2585c](fa2585c)) * **policy:** Add obligation support to KAS ([#2786](#2786)) ([bb1bca0](bb1bca0)) * **policy:** List obligation triggers rpc ([#2823](#2823)) ([206abe3](206abe3)) * **policy:** namespace root certificates ([#2771](#2771)) ([beaff21](beaff21)) * **policy:** Proto - root certificates by namespace ([#2800](#2800)) ([0edb359](0edb359)) * **policy:** Protos List obligation triggers ([#2803](#2803)) ([b32df81](b32df81)) * **policy:** Return built obligations fqns with triggers. ([#2830](#2830)) ([e843018](e843018)) * **policy:** Return obligations from GetAttributeValue calls ([#2742](#2742)) ([aa9b393](aa9b393)) ### Bug Fixes * **core:** CORS ([#2787](#2787)) ([a030ac6](a030ac6)) * **core:** deprecate policy WithValue selector not utilized by RPC ([#2794](#2794)) ([c573595](c573595)) * **core:** deprecated stale protos and add better upgrade comments ([#2793](#2793)) ([f2678cc](f2678cc)) * **core:** Don't require known manager names ([#2792](#2792)) ([8a56a96](8a56a96)) * **core:** Fix mode negation and core mode ([#2779](#2779)) ([de9807d](de9807d)) * **core:** resolve environment loading issues ([#2827](#2827)) ([9af3184](9af3184)) * **deps:** bump github.com/opentdf/platform/lib/ocrypto from 0.6.0 to 0.7.0 in /service ([#2812](#2812)) ([a6d180d](a6d180d)) * **deps:** bump github.com/opentdf/platform/protocol/go from 0.12.0 to 0.13.0 in /service ([#2814](#2814)) ([5e9c695](5e9c695)) * **deps:** bump github.com/opentdf/platform/sdk from 0.7.0 to 0.9.0 in /service ([#2798](#2798)) ([d6bc9a8](d6bc9a8)) * **deps:** bump github.com/opentdf/platform/sdk from 0.9.0 to 0.10.0 in /service ([#2831](#2831)) ([412dfd1](412dfd1)) * ECC key loading (deprecated) ([#2757](#2757)) ([49990eb](49990eb)) * **policy:** Change to nil ([#2746](#2746)) ([a449434](a449434)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: opentdf-automation[bot] <149537512+opentdf-automation[bot]@users.noreply.github.com>
This pull request introduces new support for namespace root certificates within the policy service, updates the API to expose these certificates, and makes related improvements to authentication and routing. The most significant changes include extending the
Namespaceobject to include root certificates, updating the API and HTTP routing to allow public access to namespace information, and adding a proof-of-concept implementation for injecting a root CA certificate.http://localhost:8080/policy.namespaces.NamespaceService/GetNamespace{ "namespace": { "id": "8f1d8839-2851-4bf4-8bf4-5243dbfe517d", "name": "example.com", "fqn": "https://example.com", "active": true, "metadata": { "createdAt": "2025-10-10T17:01:12.477117Z", "updatedAt": "2025-10-10T17:01:12.477117Z" }, "rootCerts": [ { "id": "46f1aa69-a458-45fa-9ff3-bc6e2f349773", "pem": "-----BEGIN CERTIFICATE-----\nMIIC/TCCAeWgAwIBAgIUSMNrGBq+5ax1wDaMSX8Nnl1m/REwDQYJKoZIhvcNAQEL\nBQAwDjEMMAoGA1UEAwwDa2FzMB4XDTI0MDUyOTE4MzcxOFoXDTI1MDUyOTE4Mzcx\nOFowDjEMMAoGA1UEAwwDa2FzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEAzbLGCYovxrCy6DccFAdj1DjnDKwmTqjYQoHfOKXbYOF1Yf5mvAyFO9MhtLet\nPRhmCd7mJA3M8Sy4/kqqAZprYHmvagAIwD0zQyQ+DcogrzmirQ8cUYIDkGre1exc\niVKsNYSlM/NcjNO5AqOaw7gQvmUkp2YciSMa7mixPsl3OTArtOtEGMn34RK1NGC+\n+MdUH6TOF2VmhqJ6+F8iSF154ldRoiR01LIzIxvqpHr0RYhU93BrMDcb4Yx92j2M\nlCpwJ8hVf2RPIqhjsnivzXu+BBQh7zynB3H6LnZUGlyWEHgEfM9yhTFWNeKDClKC\nFE2s1DD8ksvMa8ayndIy0+cNXQIDAQABo1MwUTAdBgNVHQ4EFgQUrrmJ35Nvvkpp\nGnQi686Y/DKmsv0wHwYDVR0jBBgwFoAUrrmJ35NvvkppGnQi686Y/DKmsv0wDwYD\nVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAAXfFJqJYVD+7GqZAWg3v\nw1Sr9jKvwMTtcAhmEJ8KKu9u4C/eGz+P4vU+KwismRfFwQaZVr0AuxRhCtCt3dqh\nKPHZ6sVUw8NG/Fg8v7cQmSpNEuy31vxTMrAWE0/zgScZmIQgS5TnqavsEaxiQGU1\nKTEGOuYQRQZ44KBQJJwUHpwb6znHOwVTKex4OsenkxMLOgsPYa3Qf53kHdZIq8x6\nkxm+METK7jT7RMDNqFWPo4R7XfpvCBR/HS3xjmXe0VVonSc2I4QKdrFPpmx2oOsS\n8Mr8dklyCivjNJ4dM1oKU/YK0hm0bF4OuhoROKpDDBDimDPnFFh/tphl1rzAuuxM\n/A==\n-----END CERTIFICATE-----\n" } ] } }Namespace Root Certificate Support:
root_certsrepeated field of typeCertificateto theNamespacemessage inpolicy/objects.proto, and defined a newCertificatemessage to hold certificate data in PEM format.