Skip to content

Expose the auth surface an out-of-tree authorization plugin needs - #2747

Open
shivamka1 wants to merge 2 commits into
db_v4from
expose-auth-plugin-surface
Open

Expose the auth surface an out-of-tree authorization plugin needs#2747
shivamka1 wants to merge 2 commits into
db_v4from
expose-auth-plugin-surface

Conversation

@shivamka1

Copy link
Copy Markdown
Collaborator

What changes were proposed in this pull request?

Four visibility changes, no behaviour: pub mod auth, pub trait ContextValidation,
pub fn gql_error_with_code, and the two CODE_* extension-code constants.

An authorization policy registered through RegisterPlugin lives outside this crate but guards
its resolvers, so it needs the same tools they use: ContextValidation for typed resolvers
(require_jwt_write_access_dynamic covers only dynamic ones), and the error helper with its code
constants so the plugin's denials carry the machine-readable codes the client already branches
on, rather than restating the strings and drifting.

Why are the changes needed?

These were public on the branch #2731 was developed on and lost visibility on the way to db_v4.
The auth plugin in the private repository already depends on them; without this it cannot compile
against db_v4.

Does this PR introduce any user-facing change? If yes is this documented?

No.

How was this patch tested?

cargo check --all-features clean here; the private workspace that consumes the surface builds
against this commit.

🤖 Generated with Claude Code

An authorization policy registered through RegisterPlugin lives outside this
crate but guards its resolvers, so it needs the same tools they use: the
ContextValidation trait for typed resolvers (require_jwt_write_access_dynamic
covers only dynamic ones), and gql_error_with_code with the two extension-code
constants so its denials carry the same machine-readable codes the client
already branches on rather than restating the strings.

These were public on the branch the plugin rework was developed on and lost
their visibility on the way to db_v4; the auth plugin in the private repository
already depends on them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant