Class: ActiveRecord::Jwt::DecoderConfiguration
- Inherits:
-
Object
- Object
- ActiveRecord::Jwt::DecoderConfiguration
- Defined in:
- lib/activerecord-jwt/decoder_configuration.rb
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#aud ⇒ Object
Returns the value of attribute aud.
-
#class ⇒ Object
Returns the value of attribute class.
-
#exp ⇒ Object
Returns the value of attribute exp.
-
#iat ⇒ Object
Returns the value of attribute iat.
-
#iss ⇒ Object
Returns the value of attribute iss.
-
#key ⇒ Object
Returns the value of attribute key.
-
#sub ⇒ Object
Returns the value of attribute sub.
Instance Method Summary collapse
-
#initialize ⇒ DecoderConfiguration
constructor
A new instance of DecoderConfiguration.
- #options ⇒ Object
Constructor Details
#initialize ⇒ DecoderConfiguration
Returns a new instance of DecoderConfiguration.
5 6 7 8 9 10 11 12 13 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 5 def initialize self.sub = :id self.algorithm = 'HS256' self.class = true self.exp = true self.iss = 'issuer' self.aud = 'audience' self.iat = true end |
Instance Attribute Details
#algorithm ⇒ Object
Returns the value of attribute algorithm.
3 4 5 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 3 def algorithm @algorithm end |
#aud ⇒ Object
Returns the value of attribute aud.
3 4 5 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 3 def aud @aud end |
#class ⇒ Object
Returns the value of attribute class.
3 4 5 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 3 def class @class end |
#exp ⇒ Object
Returns the value of attribute exp.
3 4 5 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 3 def exp @exp end |
#iat ⇒ Object
Returns the value of attribute iat.
3 4 5 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 3 def iat @iat end |
#iss ⇒ Object
Returns the value of attribute iss.
3 4 5 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 3 def iss @iss end |
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 3 def key @key end |
#sub ⇒ Object
Returns the value of attribute sub.
3 4 5 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 3 def sub @sub end |
Instance Method Details
#options ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/activerecord-jwt/decoder_configuration.rb', line 15 def { algorithm: self.algorithm, verify_expiration: self.exp.present?, verify_iss: self.iss.present?, verify_aud: self.aud.present?, verify_iat: self.iat.present?, 'iss' => self.iss, 'aud' => self.aud } end |