Polish: configurable passthrough of custom /authorize params#5
Open
pontiphex wants to merge 2 commits into
Open
Polish: configurable passthrough of custom /authorize params#5pontiphex wants to merge 2 commits into
pontiphex wants to merge 2 commits into
Conversation
Forward request parameters to the /authorize endpoint when their name starts with a configured prefix, via a new `passthrough_prefixes` option that defaults to `["ext-"]` (Auth0's documented convention for surfacing custom params to Universal Login and Actions) and can be set to `[]` to disable. This replaces the fork's hardcoded `ext-` check (is_authorized_param?) with an idiomatic, configurable implementation suitable for upstreaming: - Extracts the well-known Auth0 params into the frozen PASSTHROUGH_AUTHORIZE_PARAMS constant (behavior unchanged). - Renames the predicate to passthrough_param? (drops the non-idiomatic `is_` prefix) and tightens the select block. - Adds the `passthrough_prefixes` option, README docs citing Auth0's custom-query-parameter docs, and a CHANGELOG entry. - Adds specs for custom prefixes, prefix override, and the disabled case. Closes auth0#214. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Drop the verbose multi-line comments with inline doc URLs in favor of single-line descriptions consistent with the rest of the strategy (e.g. "Setup client URLs...", "Check if the options include a client_id"). Usage details and the Auth0 docs link remain in the README. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Replaces the fork's rough hardcoded
ext-passthrough with a clean, configurable, upstream-ready implementation. This is the version we intend to submit toauth0/omniauth-auth0to close auth0/omniauth-auth0#214.Stacked on PR #4 (
chore/sync-upstream-v3.2.0) — review/merge #4 first. The diff here is only the polish delta on top of the v3.2.0 sync.What changed vs the fork's current
ext-patchpassthrough_prefixesoption, defaulting to%w[ext-](Auth0's documented convention). Set to[]to disable, or add your own prefixes. The old code hardcodedext-with no opt-out.is_authorized_param?→passthrough_param?(drops the non-idiomaticis_prefix flagged byNaming/PredicatePrefix), fixed the unused block var / brace spacing.PASSTHROUGH_AUTHORIZE_PARAMSconstant; the standard-param forwarding is unchanged.Array(options.passthrough_prefixes)so aniloverride can't raise.Default behavior is unchanged
With no config,
ext-prefixed params are still forwarded exactly as the fork does today — so swapping the fork's patch for this is transparent to the Jobber monolith.Test plan
bundle exec rspec— 133 examples, 0 failures (99.37% coverage)ext-dropped once overridden;[]disables; standard params always forwarded — all run under both auth contexts via the shared example groupUpstreaming
Once #4 and this land on the fork, the net diff of this feature vs
auth0/omniauth-auth0masteris ~30 lines (lib) + docs + specs — cut a branch off upstreammaster, cherry-pick this commit, and open the PR referencing auth0#214. Ping the reporter (@skylertom) for a +1.🤖 Generated with Claude Code