Skip to content

feat(proto): expose WhoCanAccess and WhatCanTargetAccess via HTTP#383

Merged
orius123 merged 1 commit intomainfrom
feat/lookup-cache-proto
Feb 18, 2026
Merged

feat(proto): expose WhoCanAccess and WhatCanTargetAccess via HTTP#383
orius123 merged 1 commit intomainfrom
feat/lookup-cache-proto

Conversation

@orius123
Copy link
Member

@orius123 orius123 commented Feb 18, 2026

Summary

  • Add WhoCanAccess and WhatCanTargetAccess RPCs to the authzcache proto and controller
  • Routes match the main Descope API (/v1/mgmt/authz/re/who and /v1/mgmt/authz/re/targetall) so SDKs can route through the cache by swapping the base URL
  • Service layer logic was added in feat: add lookup cache for WhoCanAccess/WhatCanTargetAccess #367; this PR exposes it via HTTP

Related

Changes

  • authzcache.proto: 2 new RPCs reusing authzv1.WhoCanAccessRequest/Response and authzv1.WhatCanTargetAccessRequest/Response
  • controller.go: 2 handler methods + relationFromAuthzRelation helper
  • controller_test.go: 4 tests (happy path + error for each)
  • Regenerated proto code (pb.go, grpc, gateway, validate, openapi, mocks)

Test plan

  • detest -o passes
  • CI passes (build, lint, test, security)
  • Deploy and verify with SDK configured with FGACacheURL

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.
Copilot AI review requested due to automatic review settings February 18, 2026 11:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WhoCanAccess and WhatCanTargetAccess RPCs to authzcache.proto with HTTP annotations for /v1/mgmt/authz/re/who and /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.

@orius123 orius123 requested a review from yosiharan February 18, 2026 11:31
@orius123 orius123 enabled auto-merge (squash) February 18, 2026 12:20
Copy link
Contributor

@yosiharan yosiharan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🙆‍♂️

@orius123 orius123 merged commit 2e0057d into main Feb 18, 2026
20 checks passed
@orius123 orius123 deleted the feat/lookup-cache-proto branch February 18, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants