Sha256: 58a8e481bcaddf2394ccc59b9eb5a960d2bb6e1cc94863554d9d3950605565ff

Contents?: true

Size: 415 Bytes

Versions: 4

Compression:

Stored size: 415 Bytes

Contents

module Keratin::AuthN::Test
  module Helpers
    JWS_ALGORITHM = 'RS256'

    # a factory for JWT id_tokens
    private def id_token_for(subject)
      JSON::JWT.new(
        iss: Keratin::AuthN.config.issuer,
        aud: Keratin::AuthN.config.audience,
        sub: subject,
        iat: 10.seconds.ago,
        exp: 1.hour.from_now
      ).sign(Keratin::AuthN.keychain.key, JWS_ALGORITHM).to_s
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
keratin-authn-1.0.4 lib/keratin/authn/test/helpers.rb
keratin-authn-1.0.3 lib/keratin/authn/test/helpers.rb
keratin-authn-1.0.2 lib/keratin/authn/test/helpers.rb
keratin-authn-1.0.1 lib/keratin/authn/test/helpers.rb