feat(agent-bff): serve the permissions display endpoint - #1804
Open
Conversation
4 new issues
|
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (9) 🛟 Help
|
Tonours
force-pushed
the
feature/prd-683-serve-the-get-agentv1permissions-display-endpoint
branch
from
August 5, 2026 13:27
1f45291 to
b51c5ab
Compare
Tonours
marked this pull request as ready for review
August 6, 2026 09:52
Tonours
force-pushed
the
feature/prd-683-serve-the-get-agentv1permissions-display-endpoint
branch
from
August 6, 2026 13:37
9a8bdd3 to
c3a3307
Compare
Tonours
force-pushed
the
feature/prd-683-serve-the-get-agentv1permissions-display-endpoint
branch
from
August 6, 2026 13:46
c3a3307 to
c71d132
Compare
Tonours
force-pushed
the
feature/prd-683-serve-the-get-agentv1permissions-display-endpoint
branch
2 times, most recently
from
August 6, 2026 14:37
14e3abf to
7b70818
Compare
Tonours
force-pushed
the
feature/prd-683-serve-the-get-agentv1permissions-display-endpoint
branch
from
August 6, 2026 15:25
7b70818 to
5e08633
Compare
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.

fixes PRD-683
Stacked on #1802 — base is
feature/prd-682-..., notmain. Review and merge #1802 first.What
GET /agent/v1/permissions?collections=a,breturns, per collection, the CRUD booleans and the per-action visibility and approval hints for the calling user.Display hints only. It never grants access — the agent stays the authority, and
finality: "display_hint"says so on every action entry. Zendesk currently gets this fromprobeAccessibleActions, a fail-open fan-out that probes actions one by one; this replaces it with one call.Decisions
?collections=is optional. Absent means every exposed collection. Requiring it would force the caller to fetch the schema first just to build the list.No new HTTP client.
ForestHttpApi.getEnvironmentPermissions()and.getUsers()were already public,forest-secret-keyincluded.The cache clears on schema refresh, via
ReadModelStore.registerGenerationScopedCache(). Without it, hints could name an action the schema just dropped, for up to 15 minutes.Fail-closed
401 unauthorized/permissions/users403 forest_identity_not_allowed200from cache503 permissions_unavailable+Retry-AfterAn expired entry is never served. A missing CRUD descriptor or action-event flag is
false.Scope
Untouched: data endpoints, action endpoints, the agent, the OAuth flow,
forestadmin-client. No SaaS or DB write, cache in-memory per process.roleIdand raw role arrays never reach the response.Two additive changes outside
src/permissions/:BffHttpErrorgets an optional trailingretryAfter.error-middleware.tsalready read it, nothing could set it.ReadModel.getAllowedCollections()returns a fresh copy per call.Cache is capped at 1000 entries, oldest evicted first: the key includes the collection set, so a caller can mint many keys by varying
?collections=.How to test
yarn workspace @forestadmin/agent-bff test yarn workspace @forestadmin/agent-bff lint777 tests, 100% coverage on the new files. Manually verified against a live SaaS in normal mode: 401 unauthenticated, 403 unknown caller, fallback to all collections, unknown collection omitted, cache hit, 503 +
Retry-Afterwith the SaaS down and no cached entry, 200 from cache with the SaaS down and a fresh one.Dev mode (roles disabled) is covered by unit tests only — the QA environment runs in normal mode.
Definition of Done
General
Security