Sha256: 1437df3b5e6252ba48002e5efe2a42580eea7e1489bd0a12181d89ae6a0d7ff6

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper'

describe SoarAuthenticationToken::TokenGenerator do
  before :all do
    keypair_generator = SoarAuthenticationToken::KeypairGenerator.new
    @private_key, @public_key = keypair_generator.generate
  end

  before :each do
    generator_configuration = {
      :mode => 'local',
      :private_key => @private_key
    }
    validator_configuration = {
      :mode => 'local',
      :public_key => @public_key
    }
    @iut = SoarAuthenticationToken::TokenGenerator.new(generator_configuration)
    @validator = SoarAuthenticationToken::TokenValidator.new(validator_configuration)
  end

  after :each do
  end

  it 'has a version number' do
    expect(SoarAuthenticationToken::VERSION).not_to be nil
  end

  context "when generating a new token locally" do
    it 'should provide token using configured private key' do

      #binding.pry
      token = @iut.generate(authenticated_identifier: 'a@b.co.za')
      print @validator.validate(token)
      print @validator.validate("asdfasdf")
    end
  end

  context "when generating a new token locally" do
    it 'should provide token using the configured private key' do
      #TODO
      #expect(true).to eq false
    end
  end

  context "when generating a new token remotely" do
    it 'should provide token using the configured remote service' do
      #TODO
      #expect(true).to eq false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
soar_authentication_token-0.0.1 spec/token_generator_spec.rb