nomis-api-client 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -0
  3. data/bin/generate_bearer_token +5 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17e5a8b25e6bfe75a4301b5f7824cbc211fd83e6
4
- data.tar.gz: 80503af449a148c65b7b2c7da2f10cfa38d4a61b
3
+ metadata.gz: 0565b63217b1a92ea23783172392d8772411ddb3
4
+ data.tar.gz: 5b0b83b7a490c3b8cca1710293a8fb8fc7e2238c
5
5
  SHA512:
6
- metadata.gz: 3ac008741956f3b6d65180152683b2db74c66a2eacd30606be6668f2f353c2536711136d02594cac95d213f72d3d6d3149a3a2d61b6ddad145f1854d41a6d4a6
7
- data.tar.gz: d45d4fd65889266c38d73d3522e5cc20dae26d01372ad50dae5882ed225b020e7be9142f7a7b5c6786d82af61e0713c093f6536d16c286baf1c332aa1592dffa
6
+ metadata.gz: a53ce9deb16a935ce3291ec3c892d161791a32c5c559dc16f432ae8c54c20a77057ff93debe94d8de6b2c8fd2cf8ce4b25d3fc780a2d94868c2e07953b257414
7
+ data.tar.gz: 9e84e9f0689b97ab9179787d8acb411863a5dac82c35300ad713569447629c2a2f5b13d7bf6b66e1335097e0ad7a4423568397eea4f7b413afd22641daf89466
data/README.md CHANGED
@@ -5,6 +5,18 @@ A minimal client for the [NOMIS API](http://ministryofjustice.github.io/nomis-ap
5
5
 
6
6
  ## Installation
7
7
 
8
+ ### Without bundler
9
+
10
+ Pre-requisites:
11
+ - ruby
12
+ - rubygems
13
+
14
+ ```bash
15
+ gem install nomis-api-client
16
+ ```
17
+
18
+ ### With bundler
19
+
8
20
  1. In your Gemfile, add:
9
21
  ```ruby
10
22
  gem 'nomis-api-client'
@@ -63,6 +75,13 @@ You can generate a bearer token without making a request as follows:
63
75
  ```ruby
64
76
  # Manually generating a bearer token
65
77
  NOMIS::API::AuthToken.new(client_key: 'your client key', client_token: 'your client token').bearer_token
78
+ ```
79
+
80
+ There is also a command-line executable:
81
+
82
+ ```bash
83
+ generate_bearer_token /path/to/your.token /path/to/your.key
84
+ ```
66
85
 
67
86
  ### Environment (preprod/prod)
68
87
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
3
  # Usage:
4
- # generate_bearer_token client_key_file client_token_file
4
+ # generate_bearer_token client_token_file client_key_file
5
5
  #
6
6
 
7
7
  require 'nomis_api_client_ruby'
@@ -9,7 +9,7 @@ require 'nomis_api_client_ruby'
9
9
  def usage
10
10
  output = <<-END
11
11
  Usage:
12
- generate_bearer_token client_key_file client_token_file
12
+ generate_bearer_token client_token_file client_key_file
13
13
 
14
14
  Useful environment variables:
15
15
 
@@ -21,14 +21,14 @@ def usage
21
21
  'iat skew too large', you can provide this to bring your system
22
22
  time within +/-10s of the API gateway.
23
23
  e.g.
24
- NOMIS_API_IAT_FUDGE_FACTOR=-5 generate_bearer_token ~/my.key ~/my.token
24
+ NOMIS_API_IAT_FUDGE_FACTOR=-5 generate_bearer_token /path/to/my.token /path/to/my.key
25
25
 
26
26
  END
27
27
  end
28
28
 
29
- raise usage unless $ARGV.size == 2
29
+ raise usage unless ARGV.size == 2
30
30
 
31
- token = NOMIS::API::AuthToken.new(client_key_file: $1, client_token_file: $2).bearer_token
31
+ token = NOMIS::API::AuthToken.new(client_token_file: $1, client_key_file: $2).bearer_token
32
32
  puts token
33
33
 
34
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nomis-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Al Davidson