Class: RailsIam::Config::Jwt
- Inherits:
-
Object
- Object
- RailsIam::Config::Jwt
- Defined in:
- lib/rails_iam/config/jwt.rb
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#audience ⇒ Object
Returns the value of attribute audience.
-
#issuer ⇒ Object
Returns the value of attribute issuer.
-
#jwt_expires_in ⇒ Object
Returns the value of attribute jwt_expires_in.
-
#secret ⇒ Object
Returns the value of attribute secret.
Instance Method Summary collapse
-
#initialize ⇒ Jwt
constructor
A new instance of Jwt.
Constructor Details
#initialize ⇒ Jwt
Returns a new instance of Jwt.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rails_iam/config/jwt.rb', line 12 def initialize # Secret verification string used to sign security tokens. @secret = ENV["JWT_SECRET"].presence || Rails.application&.secret_key_base # Digital signature algorithm category mapping. @algorithm = "HS256" @jwt_expires_in = 15.minutes # Optional security claim validations (RFC 7519 standard targets). # Leave nil to disable strict validation checks. @issuer = nil @audience = nil end |
Instance Attribute Details
#algorithm ⇒ Object
Returns the value of attribute algorithm.
6 7 8 |
# File 'lib/rails_iam/config/jwt.rb', line 6 def algorithm @algorithm end |
#audience ⇒ Object
Returns the value of attribute audience.
6 7 8 |
# File 'lib/rails_iam/config/jwt.rb', line 6 def audience @audience end |
#issuer ⇒ Object
Returns the value of attribute issuer.
6 7 8 |
# File 'lib/rails_iam/config/jwt.rb', line 6 def issuer @issuer end |
#jwt_expires_in ⇒ Object
Returns the value of attribute jwt_expires_in.
6 7 8 |
# File 'lib/rails_iam/config/jwt.rb', line 6 def jwt_expires_in @jwt_expires_in end |
#secret ⇒ Object
Returns the value of attribute secret.
6 7 8 |
# File 'lib/rails_iam/config/jwt.rb', line 6 def secret @secret end |