feat(proto): expose WhoCanAccess and WhatCanTargetAccess via HTTP#383
Merged
feat(proto): expose WhoCanAccess and WhatCanTargetAccess via HTTP#383
Conversation
Add two new RPCs to the authzcache proto definition with routes matching the main Descope API (/v1/mgmt/authz/re/who and /v1/mgmt/authz/re/targetall), so SDKs can route these calls through the cache by swapping the base URL. Includes controller handlers, tests (100% diff coverage), and regenerated proto code.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR exposes the existing authz-cache lookup functionality for WhoCanAccess and WhatCanTargetAccess via the AuthzCache proto and HTTP routes that mirror the main Descope API, enabling SDKs to route through the cache by swapping the base URL.
Changes:
- Added
WhoCanAccessandWhatCanTargetAccessRPCs toauthzcache.protowith HTTP annotations for/v1/mgmt/authz/re/whoand/v1/mgmt/authz/re/targetall. - Implemented controller handlers for both RPCs and added unit tests covering success/error paths.
- Regenerated protobuf outputs (gRPC stubs, gateway, validation metadata, OpenAPI, mocks).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/authzcache/proto/v1/authzcache.proto | Adds the two new RPCs and HTTP/OpenAPI annotations. |
| internal/controllers/controller.go | Implements the two new RPC handlers and relation mapping helper. |
| internal/controllers/controller_test.go | Adds 4 tests (success + error) for the new handlers. |
| pkg/authzcache/proto/v1/doc/authzcache.openapi.yaml | Publishes the new HTTP endpoints and schemas in OpenAPI output. |
| pkg/authzcache/proto/v1/authzcache_grpc.pb.go | Regenerated gRPC client/server interfaces and handlers for new RPCs. |
| pkg/authzcache/proto/v1/authzcache.pb.gw.go | Regenerated grpc-gateway bindings and route registration for new endpoints. |
| pkg/authzcache/proto/v1/authzcache.pb.go | Regenerated protobuf descriptors/types to include new RPCs. |
| pkg/authzcache/proto/v1/authzcache.pb.validate.go | Regenerated validation metadata to include new methods. |
| pkg/authzcache/test/mocks/authzcacheclient.go | Regenerated mock client to implement the expanded gRPC client interface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WhoCanAccessandWhatCanTargetAccessRPCs to the authzcache proto and controller/v1/mgmt/authz/re/whoand/v1/mgmt/authz/re/targetall) so SDKs can route through the cache by swapping the base URLRelated
Changes
authzcache.proto: 2 new RPCs reusingauthzv1.WhoCanAccessRequest/Responseandauthzv1.WhatCanTargetAccessRequest/Responsecontroller.go: 2 handler methods +relationFromAuthzRelationhelpercontroller_test.go: 4 tests (happy path + error for each)Test plan
detest -opassesFGACacheURL