Class: Sandal::Sig::None
- Inherits:
-
Object
- Object
- Sandal::Sig::None
- Includes:
- Singleton
- Defined in:
- lib/sandal/sig.rb
Overview
The ‘none’ JWA signature method.
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The JWA name of the algorithm.
Instance Method Summary collapse
-
#initialize ⇒ None
constructor
Creates a new instance.
-
#sign(payload) ⇒ String
Returns an empty signature.
-
#valid?(signature, payload) ⇒ Boolean
Validates that a signature is nil or empty.
Constructor Details
#initialize ⇒ None
Creates a new instance.
15 16 17 |
# File 'lib/sandal/sig.rb', line 15 def initialize @name = 'none' end |
Instance Attribute Details
#name ⇒ String (readonly)
Returns The JWA name of the algorithm.
12 13 14 |
# File 'lib/sandal/sig.rb', line 12 def name @name end |
Instance Method Details
#sign(payload) ⇒ String
Returns an empty signature.
23 24 25 |
# File 'lib/sandal/sig.rb', line 23 def sign(payload) '' end |
#valid?(signature, payload) ⇒ Boolean
Validates that a signature is nil or empty.
32 33 34 |
# File 'lib/sandal/sig.rb', line 32 def valid?(signature, payload) signature.nil? || signature.empty? end |