Module: ClaimToken
- Defined in:
- lib/claim_token.rb,
lib/claim_token/signer.rb,
lib/claim_token/version.rb,
lib/claim_token/decryptor.rb,
lib/claim_token/encryptor.rb,
lib/claim_token/configuration.rb
Defined Under Namespace
Modules: Decryptor, Encryptor, Signer
Classes: Configuration
Constant Summary
collapse
- VERSION =
"0.0.1"
- DEFAULT_CIPHER_TYPE =
"aes-256-cbc"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
16
17
18
|
# File 'lib/claim_token/configuration.rb', line 16
def configuration
@configuration
end
|
Class Method Details
19
20
21
22
|
# File 'lib/claim_token/configuration.rb', line 19
def self.configure
self.configuration ||= Configuration.new
yield configuration
end
|
.decrypt(encrypted_token) ⇒ Object
.encrypt(message) ⇒ Object
9
10
11
|
# File 'lib/claim_token.rb', line 9
def self. encoded_token
decrypt(JSON.parse( Base64.urlsafe_decode64(encoded_token)))
end
|
.pack(message) ⇒ Object
13
14
15
|
# File 'lib/claim_token.rb', line 13
def self.pack message
Base64.urlsafe_encode64(JSON.dump(encrypt(message)))
end
|