Sha256: ed8f121b033bbd1c9ed3991c5ea6dae132f1a0c6f9c5ed68391d8129bcc794e8
Contents?: true
Size: 775 Bytes
Versions: 2
Compression:
Stored size: 775 Bytes
Contents
# frozen_string_literal: true # This is a mock verifier that allows the auth0_rs256_jwt_verifier gem # to still be used for verifying JWTs, but with a localhost JWKS specified. # This code was adapted from the gem's test suite: # https://github.com/DroidsOnRoids/auth0_rs256_jwt_verifier/blob/master/test/auth0_rs256_jwt_verifier_test.rb class MockAuth0Verifier def initialize(issuer:, audience:, jwks:) @internal_verifier = Auth0RS256JWTVerifier.new( issuer: issuer, audience: audience, jwks_url: "https://do.not.care", http: http_stub(jwks) ) end delegate :verify, to: :@internal_verifier private def http_stub(jwks) http_stub = Object.new http_stub.define_singleton_method(:get) { |*_| jwks } http_stub end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
nulogy_sso-0.3.0 | spec/support/mock_auth0_verifier.rb |
nulogy_sso-0.2.0 | spec/support/mock_auth0_verifier.rb |