module Toktok

Constants

InvalidIdentity
InvalidSignature
VERSION

Public Class Methods

algorithm=(value) click to toggle source

Set the algorithm used to encode and decode JWT tokens (default: HS256)

Acceptable values are:

  • none

  • HS256, HS384, HS512

  • RS256, RS384, RS512

  • ES256, ES384, ES512

@param [String] value the algorithm name @return [String] the algorithm

# File lib/toktok.rb, line 16
def self.algorithm=(value)
  @algorithm = value
end
config() click to toggle source

Gets a Toktok::Configuration instance using the module values.

@return [Toktok::Configuration] the configuration

# File lib/toktok.rb, line 38
def self.config
  ::Toktok::Configuration.new(
    algorithm: @algorithm,
    lifetime: @lifetime,
    secret_key: @secret_key
  )
end
lifetime=(value) click to toggle source

Set the lifetime in seconds before a token expires (default: nil)

@param [Integer, nil] value the number of seconds before a token expires @return [Integer, nil] the lifetime

# File lib/toktok.rb, line 24
def self.lifetime=(value)
  @lifetime = value
end
secret_key=(value) click to toggle source

Set the secret key that will be used to encode and decode JWT tokens @param [String] value the secret key @return [String] the secret key

# File lib/toktok.rb, line 31
def self.secret_key=(value)
  @secret_key = value
end