soar_authentication_token 3.0.4 → 3.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7996fa1857b1b57684079260f326c2f706a0f78
|
4
|
+
data.tar.gz: 44ccf374373fbc7d6596fd1638e2e4016d0f7cee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64764a63384c843c5bf5c056f2a1f479b72c234f42d2d2ba3daa55690b60627eff2446580910ab007952dd432ec31256b6794af979041977f83f5f733f69315f
|
7
|
+
data.tar.gz: a385a5cf6a96bb4b927b924844417e5551e75a8085fda8fb8fd18670cedbbdf5dcbb550d01a46284fc8e7bb2fa48158745625b5794be9d525681e2435222d6c6
|
@@ -5,6 +5,7 @@ require 'time'
|
|
5
5
|
require 'net/http'
|
6
6
|
require 'uri'
|
7
7
|
require 'json'
|
8
|
+
require 'authenticated_client'
|
8
9
|
|
9
10
|
module SoarAuthenticationToken
|
10
11
|
class TokenGenerator
|
@@ -42,7 +43,7 @@ module SoarAuthenticationToken
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def authenticated_client(authenticated_identifier,flow_identifier)
|
45
|
-
client =
|
46
|
+
client = AuthenticatedClient::Client.new
|
46
47
|
client.url = @configuration['generator-url']
|
47
48
|
client.token = @configuration['generator-client-auth-token']
|
48
49
|
client.verb = :post
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soar_authentication_token
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barney de Villiers
|
@@ -206,7 +206,6 @@ files:
|
|
206
206
|
- sanity/sanity.rb
|
207
207
|
- sanity/sanity_benchmark.rb
|
208
208
|
- soar_authentication_token.gemspec
|
209
|
-
- spec/auth_client_spec.rb
|
210
209
|
- spec/keypair_generator_spec.rb
|
211
210
|
- spec/rack_middleware_spec.rb
|
212
211
|
- spec/spec_helper.rb
|
@@ -237,7 +236,6 @@ signing_key:
|
|
237
236
|
specification_version: 4
|
238
237
|
summary: Client library for Hetzner's authentication token service
|
239
238
|
test_files:
|
240
|
-
- spec/auth_client_spec.rb
|
241
239
|
- spec/keypair_generator_spec.rb
|
242
240
|
- spec/rack_middleware_spec.rb
|
243
241
|
- spec/spec_helper.rb
|
data/spec/auth_client_spec.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe SoarAuthenticationToken::AuthenticatedClient do
|
4
|
-
before :each do
|
5
|
-
end
|
6
|
-
|
7
|
-
it 'has a version number' do
|
8
|
-
expect(SoarAuthenticationToken::VERSION).not_to be nil
|
9
|
-
end
|
10
|
-
|
11
|
-
context "when performing an authenticated request" do
|
12
|
-
context "with a valid token" do
|
13
|
-
it 'respond with a successful request' do
|
14
|
-
@iut = SoarAuthenticationToken::AuthenticatedClient.new
|
15
|
-
@iut.url = 'http://authentication-token-generator-service:9393/generate'
|
16
|
-
@iut.token = 'test_ecosystem_token_for_auth_token_aaapi_authenticator_service'
|
17
|
-
@iut.verb = :post
|
18
|
-
@iut.parameters = {}
|
19
|
-
@iut.body = {}
|
20
|
-
@iut.auditing = nil
|
21
|
-
|
22
|
-
response = @iut.request
|
23
|
-
expect(response.code).to eq '200'
|
24
|
-
end
|
25
|
-
end
|
26
|
-
context "with an invalid token" do
|
27
|
-
it 'respond unauthorized' do
|
28
|
-
@iut = SoarAuthenticationToken::AuthenticatedClient.new
|
29
|
-
@iut.url = 'http://authentication-token-generator-service:9393/generate'
|
30
|
-
@iut.token = 'invalid'
|
31
|
-
@iut.verb = :post
|
32
|
-
@iut.parameters = {}
|
33
|
-
@iut.body = {}
|
34
|
-
@iut.auditing = nil
|
35
|
-
|
36
|
-
response = @iut.request
|
37
|
-
expect(response.code).to eq '401'
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|