Sha256: 9d16bcceb2e9b6ef0af3d97c4d58060acc698b57dc9e9f1055fa4803e1ba9c42

Contents?: true

Size: 766 Bytes

Versions: 4

Compression:

Stored size: 766 Bytes

Contents

require 'rack/lobster'

module RapidRack
  RSpec.describe Authenticator, type: :feature do
    def build_app(prefix)
      opts = { url: url, receiver: receiver, secret: secret,
               issuer: issuer, audience: audience, error_handler: handler }
      Rack::Builder.new do
        use Rack::Lint
        map(prefix) { run Authenticator.new(opts) }
        run Rack::Lobster.new
      end
    end

    let(:prefix) { '/auth' }
    let(:issuer) { 'https://rapid.example.com' }
    let(:audience) { 'https://service.example.com' }
    let(:url) { 'https://rapid.example.com/jwt/authnrequest/research/abcd1234' }
    let(:secret) { '1234abcd' }
    let(:app) { build_app(prefix) }

    subject { last_response }

    it_behaves_like 'an authenticator'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rapid-rack-0.3.0 spec/lib/rapid_rack/authenticator_spec.rb
rapid-rack-0.2.0 spec/lib/rapid_rack/authenticator_spec.rb
rapid-rack-0.1.0 spec/lib/rapid_rack/authenticator_spec.rb
rapid-rack-0.0.1 spec/lib/rapid_rack/authenticator_spec.rb