Exception: RackJwtVerifier::InsufficientScopeError

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

Overview

Handed to the :on_error hook when a token lacks a scope listed in require_scopes. Carries what was required and what was missing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(required:, missing:) ⇒ InsufficientScopeError



34
35
36
37
38
# File 'lib/rack_jwt_verifier/errors.rb', line 34

def initialize(required:, missing:)
  @required = required
  @missing = missing
  super("Token lacks required scope(s): #{missing.join(' ')}")
end

Instance Attribute Details

#missingObject (readonly)

Returns the value of attribute missing.



32
33
34
# File 'lib/rack_jwt_verifier/errors.rb', line 32

def missing
  @missing
end

#requiredObject (readonly)

Returns the value of attribute required.



32
33
34
# File 'lib/rack_jwt_verifier/errors.rb', line 32

def required
  @required
end