soar_authentication_token 4.0.0 → 4.0.1

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: 4020cefab79d1ffcef0ea47c4787412cf4c520e4
4
- data.tar.gz: dff3cc2d0e722cfbfbd9ae761694417350bfe9ba
3
+ metadata.gz: 7a8624b1f055f6acb2b0389a91287c6da5e28226
4
+ data.tar.gz: a5a075c86334c09962bd1fa319ca735cc788722c
5
5
  SHA512:
6
- metadata.gz: a9f8caae8f97bc3b7954b9c70848f605b6b7c6ba32b90800e42955811ccdfb34cc2d9bc7632aca2ec1c5b0872146a4a2ca761340fd228afe44a238f37b2998fd
7
- data.tar.gz: 2a9aaf075ccae76090499d7bca7a7d88b663f75aecbd40393c783071a48591c2bcf842c64b86e9b04c436e6c5c36947442eadd34b0314ced9660030a5f5dc55b
6
+ metadata.gz: 42becbe6549bf863769195ccb7e131d4f199573f41a436b5c504fc5f4b900a6a618e4544e59b2960f760583ab16309fae323738a5cb4e174a15a72ce9a249536
7
+ data.tar.gz: ae95a54d5d15d4c71bb7fd6455d1c1c58014b80296383520685f3dcbd3531d097c5e2cd0bc386443893588f323182affee4bcc170cc44561bb01f5928eb270fd
data/README.md CHANGED
@@ -43,7 +43,8 @@ In this mode the StaticTokenValidator is configured with a list of preconfigured
43
43
  Run the rspec test tests using docker compose:
44
44
 
45
45
  ```bash
46
- docker-compose build
46
+ docker-compose build --force-rm --no-cache
47
+ docker-compose down
47
48
  docker-compose run --rm soar-authentication-token
48
49
  docker-compose down
49
50
  ```
@@ -34,7 +34,7 @@ module SoarAuthenticationToken
34
34
  if ('success' == body['status']) and body['data']
35
35
  token_validity = body['data']['token_validity']
36
36
  token_meta = body['data']['token_meta']
37
- message = body['data']['message']
37
+ message = body['data']['notifications'].first
38
38
  raise 'Token validation service did not provide token_validity' if token_validity.nil?
39
39
  raise 'Token validation service did not provide token_meta' if token_validity and token_meta.nil?
40
40
  raise 'Token validation service did not provide message' if message.nil?
@@ -1,3 +1,3 @@
1
1
  module SoarAuthenticationToken
2
- VERSION = '4.0.0'
2
+ VERSION = '4.0.1'
3
3
  end
data/retry.sh ADDED
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+
3
+ # Retries a command on failure.
4
+ # $1 - the max number of attempts
5
+ # $2... - the command to run
6
+ retry() {
7
+ local -r -i max_attempts="$1"; shift
8
+ local -r cmd="$@"
9
+ local -i attempt_num=1
10
+ local -i cmd_exit_code=0
11
+ until $cmd
12
+ do
13
+ cmd_exit_code=$?
14
+ if (( attempt_num == max_attempts ))
15
+ then
16
+ echo "Attempt $attempt_num failed with code $cmd_exit_code and there are no more attempts left!"
17
+ exit $cmd_exit_code
18
+ else
19
+ echo "Attempt $attempt_num failed with code $cmd_exit_code! Trying again in $attempt_num seconds..."
20
+ sleep $(( attempt_num++ ))
21
+ fi
22
+ done
23
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar_authentication_token
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barney de Villiers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-06 00:00:00.000000000 Z
11
+ date: 2017-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: soar_xt
@@ -232,6 +232,7 @@ files:
232
232
  - lib/soar_authentication_token/token_generator.rb
233
233
  - lib/soar_authentication_token/token_validator.rb
234
234
  - lib/soar_authentication_token/version.rb
235
+ - retry.sh
235
236
  - sanity/.gitignore
236
237
  - sanity/.ruby-gemset
237
238
  - sanity/.ruby-version