Class: JWTSignedRequest::Sign
- Inherits:
-
Object
- Object
- JWTSignedRequest::Sign
- Defined in:
- lib/jwt_signed_request/sign.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(method:, path:, body: EMPTY_BODY, headers:, secret_key: nil, algorithm: nil, key_id: nil, issuer: nil, additional_headers_to_sign: nil) ⇒ Sign
constructor
A new instance of Sign.
Constructor Details
#initialize(method:, path:, body: EMPTY_BODY, headers:, secret_key: nil, algorithm: nil, key_id: nil, issuer: nil, additional_headers_to_sign: nil) ⇒ Sign
Returns a new instance of Sign.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/jwt_signed_request/sign.rb', line 9 def initialize( method:, path:, body: EMPTY_BODY, headers:, secret_key: nil, algorithm: nil, key_id: nil, issuer: nil, additional_headers_to_sign: nil ) @method = method @path = path @body = body @headers = headers @secret_key = secret_key @algorithm = algorithm @key_id = key_id @issuer = issuer @additional_headers_to_sign = additional_headers_to_sign end |
Class Method Details
.call(*args) ⇒ Object
5 6 7 |
# File 'lib/jwt_signed_request/sign.rb', line 5 def self.call(*args) new(*args).call end |
Instance Method Details
#call ⇒ Object
31 32 33 |
# File 'lib/jwt_signed_request/sign.rb', line 31 def call JWT.encode(claims, secret_key, algorithm, additional_jwt_headers) end |