Expose the auth surface an out-of-tree authorization plugin needs - #2747
Open
shivamka1 wants to merge 2 commits into
Open
Expose the auth surface an out-of-tree authorization plugin needs#2747shivamka1 wants to merge 2 commits into
shivamka1 wants to merge 2 commits into
Conversation
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.
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.
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 twoCODE_*extension-code constants.An authorization policy registered through
RegisterPluginlives outside this crate but guardsits resolvers, so it needs the same tools they use:
ContextValidationfor typed resolvers(
require_jwt_write_access_dynamiccovers only dynamic ones), and the error helper with its codeconstants 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-featuresclean here; the private workspace that consumes the surface buildsagainst this commit.
🤖 Generated with Claude Code