Module: JWT

Defined in:
lib/truelayer-signing/jwt.rb

Overview

TODO: this is a custom patch of payload-related methods, from the ‘jwt’ gem. It prevents the payload from being systematically converted to and from JSON. To be changed in the ‘jwt’ gem directly, or hard-coded in this library.

Defined Under Namespace

Classes: TrueLayerDecode, TrueLayerEncode

Class Method Summary collapse

Class Method Details

.truelayer_decode(jwt, key, verify = true, options, &keyfinder) ⇒ Object

rubocop:disable Style/OptionalArguments, Style/OptionalBooleanParameter



39
40
41
42
43
44
45
46
47
# File 'lib/truelayer-signing/jwt.rb', line 39

def truelayer_decode(jwt, key, verify = true, options, &keyfinder)
  TrueLayerDecode.new(
    jwt,
    key,
    verify,
    configuration.decode.to_h.merge(options),
    &keyfinder
  ).decode_segments
end

.truelayer_encode(payload, key, algorithm, headers) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/truelayer-signing/jwt.rb', line 29

def truelayer_encode(payload, key, algorithm, headers)
  TrueLayerEncode.new(
    payload: payload,
    key: key,
    algorithm: algorithm,
    headers: headers
  ).segments
end