Class: PKCE::Challenger
- Inherits:
-
Object
- Object
- PKCE::Challenger
- Defined in:
- lib/pkce/challenger.rb
Overview
Handles Proof Key for Code Exchange (PKCE) challenge.
Instance Method Summary collapse
- #call(code) ⇒ Object
-
#initialize(hasher: Digest::SHA256, encoder: Base64) ⇒ Challenger
constructor
A new instance of Challenger.
Constructor Details
#initialize(hasher: Digest::SHA256, encoder: Base64) ⇒ Challenger
Returns a new instance of Challenger.
9 10 11 12 |
# File 'lib/pkce/challenger.rb', line 9 def initialize hasher: Digest::SHA256, encoder: Base64 @hasher = hasher @encoder = encoder end |
Instance Method Details
#call(code) ⇒ Object
14 |
# File 'lib/pkce/challenger.rb', line 14 def call(code) = encoder.urlsafe_encode64 hasher.digest(code), padding: false |