feat(sdk): add provider-neutral authorization seam - #1561
Closed
EnzoTironi wants to merge 2 commits into
Closed
Conversation
Optional @executor-js/sdk AuthorizationProvider consulted after hard block and before credential/plugin invoke. Absent provider preserves prior behavior; deny/provider failure fail closed; require_approval reuses elicitation; nested ctx.execute re-enters the same path.
Author
|
Closing this PR because this authorization seam is intended to live in our maintained fork rather than be proposed to upstream. The fork main is synced exactly to upstream main before applying the patch. |
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
Adds an optional provider-neutral
AuthorizationProviderseam to Executor tool execution so hosts can enforce a horizontal PDP without coupling Executor core to Cerbos, OPA, or another policy engine.The provider receives Executor-bound tenant/subject identity plus resolved tool metadata and arguments. It is consulted after Executor's existing hard block checks and before credential resolution or plugin invocation.
Behavior:
allow: execution continues normally;deny: fails closed before credentials or plugin invocation;require_approval: reuses Executor's existing elicitation flow;ctx.execute(...): re-enters the same authorization seam;HostConfigtocreateExecutor.No concrete PDP dependency is added. Product/host code owns the provider implementation.
Validation
Validated against current upstream
mainwith the branch 0 commits behind before publication:packages/core/sdk/src/authorization.test.ts: 10/10 passingpackages/core/api/src/server/scoped-executor.authorization.test.ts: 1/1 passing@executor-js/sdktypecheck: passing@executor-js/apitypecheck: passingbun run lint: 0 warnings, 0 errorsThe seam is also exercised by an external integration acceptance using a provider implementation outside Executor core, confirming the intended host-owned composition model.