Skip to content

Add Builder pattern to AuthContext#275

Open
partha-uber wants to merge 2 commits into
mainfrom
sirker-authcontext-builder
Open

Add Builder pattern to AuthContext#275
partha-uber wants to merge 2 commits into
mainfrom
sirker-authcontext-builder

Conversation

@partha-uber

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Builder class to AuthContext that provides a fluent API for constructing instances, addressing the review feedback from PR Forward optional nonce on /authorize request #271 about the growing list of nullable constructor parameters being confusing and error-prone.
  • The existing data-class constructor is fully preserved for backward compatibility.
  • Includes tests verifying builder produces equivalent results to the constructor and that defaults match.

Closes follow-up from #271 (comment)

Test plan

  • All existing AuthProviderTest tests pass
  • New test: AuthContext Builder produces equivalent result to constructor
  • New test: AuthContext Builder defaults match constructor defaults
  • Verify ./gradlew :authentication:test passes in CI

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

partha-uber and others added 2 commits June 20, 2026 19:56
Addresses review feedback from PR #271 — the growing list of nullable
constructor parameters makes call sites confusing and error-prone.
The new AuthContext.Builder provides a fluent API while preserving
full backward compatibility with the existing data-class constructor.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@partha-uber partha-uber requested a review from lalwani June 23, 2026 22:38
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