Sha256: 14ecade1d19e14442f31254759755b8ab2bd17830798a1d336d1f6ca6f0ecf5f
Contents?: true
Size: 774 Bytes
Versions: 16
Compression:
Stored size: 774 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
16 entries across 16 versions & 1 rubygems