Class: PKCE::Verifier
- Inherits:
-
Object
- Object
- PKCE::Verifier
- Defined in:
- lib/pkce/verifier.rb
Overview
Handles Proof Key for Code Exchange (PKCE) verification.
Constant Summary collapse
- RANGE =
32..96
- MAX =
RANGE.max
Instance Method Summary collapse
- #call(length: MAX) ⇒ Object
-
#initialize(range: RANGE, randomizer: SecureRandom) ⇒ Verifier
constructor
A new instance of Verifier.
Constructor Details
Instance Method Details
#call(length: MAX) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/pkce/verifier.rb', line 19 def call length: MAX if range.cover? length Success randomizer.urlsafe_base64(length) else Failure "Invalid PKCE verifier length: #{length}. Must be between #{range.inspect}." end end |