Skip to content

Polish: configurable passthrough of custom /authorize params#5

Open
pontiphex wants to merge 2 commits into
chore/sync-upstream-v3.2.0from
feat/configurable-passthrough-params
Open

Polish: configurable passthrough of custom /authorize params#5
pontiphex wants to merge 2 commits into
chore/sync-upstream-v3.2.0from
feat/configurable-passthrough-params

Conversation

@pontiphex
Copy link
Copy Markdown
Collaborator

Summary

Replaces the fork's rough hardcoded ext- passthrough with a clean, configurable, upstream-ready implementation. This is the version we intend to submit to auth0/omniauth-auth0 to 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- patch

  • Configurable: new passthrough_prefixes option, defaulting to %w[ext-] (Auth0's documented convention). Set to [] to disable, or add your own prefixes. The old code hardcoded ext- with no opt-out.
  • Idiomatic: renamed is_authorized_param?passthrough_param? (drops the non-idiomatic is_ prefix flagged by Naming/PredicatePrefix), fixed the unused block var / brace spacing.
  • Behavior-preserving for standard params: extracted the well-known Auth0 params into the frozen PASSTHROUGH_AUTHORIZE_PARAMS constant; the standard-param forwarding is unchanged.
  • Defensive: Array(options.passthrough_prefixes) so a nil override can't raise.
  • Docs: README section + CHANGELOG entry.
provider :auth0, id, secret, domain,
  passthrough_prefixes: %w[ext-]   # default; [] disables

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 rspec133 examples, 0 failures (99.37% coverage)
  • New specs: custom prefix forwarded; default ext- dropped once overridden; [] disables; standard params always forwarded — all run under both auth contexts via the shared example group
  • RuboCop clean on the new code (only pre-existing upstream offenses remain)

Upstreaming

Once #4 and this land on the fork, the net diff of this feature vs auth0/omniauth-auth0 master is ~30 lines (lib) + docs + specs — cut a branch off upstream master, cherry-pick this commit, and open the PR referencing auth0#214. Ping the reporter (@skylertom) for a +1.

🤖 Generated with Claude Code

pontiphex and others added 2 commits May 28, 2026 14:03
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>
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