Module: Himari::TokenString::ClassMethods
- Defined in:
- lib/himari/token_string.rb
Instance Method Summary collapse
- #default_lifetime ⇒ Object
- #magic_header ⇒ Object
- #make(lifetime: nil, **kwargs) ⇒ Object
- #parse(str) ⇒ Object
Instance Method Details
#default_lifetime ⇒ Object
19 20 21 |
# File 'lib/himari/token_string.rb', line 19 def default_lifetime raise NotImplementedError end |
#magic_header ⇒ Object
15 16 17 |
# File 'lib/himari/token_string.rb', line 15 def magic_header raise NotImplementedError end |
#make(lifetime: nil, **kwargs) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/himari/token_string.rb', line 23 def make(lifetime: nil, **kwargs) new( handle: SecureRandom.urlsafe_base64(32), secret: SecureRandom.urlsafe_base64(48), expiry: Time.now.to_i + (lifetime || default_lifetime), **kwargs ) end |