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 +4 -4
- data/README.md +2 -1
- data/lib/soar_authentication_token/providers/remote_token_validator.rb +1 -1
- data/lib/soar_authentication_token/version.rb +1 -1
- data/retry.sh +23 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a8624b1f055f6acb2b0389a91287c6da5e28226
|
4
|
+
data.tar.gz: a5a075c86334c09962bd1fa319ca735cc788722c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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']['
|
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?
|
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.
|
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-
|
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
|