Class: RackJwtVerifier::KeySource::Secret

Inherits:
Object
  • Object
show all
Defined in:
lib/rack_jwt_verifier/key_source.rb

Overview

An HMAC secret shared with the issuer (jwt_auth_client's mode). Nothing to fetch or rotate: a secret has no kid, so rotation means redeploying both sides. The RFC 7518 minimum length is enforced by the Verifier, which knows the algorithm list.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(secret) ⇒ Secret

Returns a new instance of Secret.

Parameters:

  • secret (String, Hash)

    the secret itself, or { env: "VAR_NAME" } to read it from the environment at boot.



63
64
65
# File 'lib/rack_jwt_verifier/key_source.rb', line 63

def initialize(secret)
  @verification_key = resolve(secret)
end

Instance Attribute Details

#verification_keyObject (readonly)

Returns the value of attribute verification_key.



59
60
61
# File 'lib/rack_jwt_verifier/key_source.rb', line 59

def verification_key
  @verification_key
end

Instance Method Details

#jwks?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/rack_jwt_verifier/key_source.rb', line 67

def jwks?
  false
end

#refresh!Object



71
72
73
# File 'lib/rack_jwt_verifier/key_source.rb', line 71

def refresh!
  false
end