Class: CWT::ClaimsSet
- Inherits:
-
Object
- Object
- CWT::ClaimsSet
- Defined in:
- lib/cwt/claims_set.rb
Constant Summary collapse
- LABEL_ISS =
1
- LABEL_SUB =
2
- LABEL_AUD =
3
- LABEL_EXP =
4
- LABEL_NBF =
5
- LABEL_IAT =
6
- LABEL_CTI =
7
Instance Attribute Summary collapse
-
#aud ⇒ Object
readonly
Returns the value of attribute aud.
-
#cti ⇒ Object
readonly
Returns the value of attribute cti.
-
#exp ⇒ Object
readonly
Returns the value of attribute exp.
-
#iat ⇒ Object
readonly
Returns the value of attribute iat.
-
#iss ⇒ Object
readonly
Returns the value of attribute iss.
-
#nbf ⇒ Object
readonly
Returns the value of attribute nbf.
-
#sub ⇒ Object
readonly
Returns the value of attribute sub.
Class Method Summary collapse
Instance Method Summary collapse
- #expiration_time ⇒ Object
- #expired? ⇒ Boolean
-
#initialize(iss:, sub:, aud:, exp:, nbf:, iat:, cti:) ⇒ ClaimsSet
constructor
A new instance of ClaimsSet.
Constructor Details
#initialize(iss:, sub:, aud:, exp:, nbf:, iat:, cti:) ⇒ ClaimsSet
Returns a new instance of ClaimsSet.
33 34 35 36 37 38 39 40 41 |
# File 'lib/cwt/claims_set.rb', line 33 def initialize(iss:, sub:, aud:, exp:, nbf:, iat:, cti:) @iss = iss @sub = sub @aud = aud @exp = exp @nbf = nbf @iat = iat @cti = cti end |
Instance Attribute Details
#aud ⇒ Object (readonly)
Returns the value of attribute aud.
31 32 33 |
# File 'lib/cwt/claims_set.rb', line 31 def aud @aud end |
#cti ⇒ Object (readonly)
Returns the value of attribute cti.
31 32 33 |
# File 'lib/cwt/claims_set.rb', line 31 def cti @cti end |
#exp ⇒ Object (readonly)
Returns the value of attribute exp.
31 32 33 |
# File 'lib/cwt/claims_set.rb', line 31 def exp @exp end |
#iat ⇒ Object (readonly)
Returns the value of attribute iat.
31 32 33 |
# File 'lib/cwt/claims_set.rb', line 31 def iat @iat end |
#iss ⇒ Object (readonly)
Returns the value of attribute iss.
31 32 33 |
# File 'lib/cwt/claims_set.rb', line 31 def iss @iss end |
#nbf ⇒ Object (readonly)
Returns the value of attribute nbf.
31 32 33 |
# File 'lib/cwt/claims_set.rb', line 31 def nbf @nbf end |
#sub ⇒ Object (readonly)
Returns the value of attribute sub.
31 32 33 |
# File 'lib/cwt/claims_set.rb', line 31 def sub @sub end |
Class Method Details
.from_cbor(cbor) ⇒ Object
15 16 17 |
# File 'lib/cwt/claims_set.rb', line 15 def self.from_cbor(cbor) from_map(CBOR.decode(cbor)) end |
Instance Method Details
#expiration_time ⇒ Object
47 48 49 |
# File 'lib/cwt/claims_set.rb', line 47 def expiration_time Time.at(exp) end |
#expired? ⇒ Boolean
43 44 45 |
# File 'lib/cwt/claims_set.rb', line 43 def expired? Time.now >= expiration_time end |