killbill-client 3.3.0 → 3.3.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: 3be1314e1b773cf9f381995047bd08907957bd18
4
- data.tar.gz: 2b16aa7aa39dd1239b548b393aff5c4f8de30f32
3
+ metadata.gz: 03e77573407a78aef2165e380bc7e1d0f672b53d
4
+ data.tar.gz: 27e12ebd3c57f128cdd181c16e77e19d4be9daa5
5
5
  SHA512:
6
- metadata.gz: b1bc847df0c8987f35e0fe54ee3fb2707f3084945f00866b681189940eefd2b0d0d58afa9405d2a42cccf1170e023fc9666094c4a58db52fc256be86134e19e5
7
- data.tar.gz: 73c08847cb57745d1a762bd174a5e747f2aa082e7b65f445f504236b2934b1ac7fdd83323c831a773ffd19fc7ac4816bd4bff458d0f04e832c7d1aee6cda6ec0
6
+ metadata.gz: 88715661ffaa19c983d3c0ba9a091cbd4c8cd9a242675de0e44a43c8d9cbf6aad172620a1902d545c6d6ec0964cf161bcb5793b7f69f7a2cb50cc8315db2994b
7
+ data.tar.gz: 5d199dffd09feffc3a02c83b9e886c29ba84c6d8317603146eff9e931d708cb69aed72c763b9ac5c38de46ac6632ad697c9c4ce94ceee83128fe2cfbdddf3ad1
data/README.md CHANGED
@@ -28,6 +28,37 @@ Alternatively, add the dependency in your Gemfile:
28
28
  gem 'killbill-client', '~> 1.0'
29
29
  ```
30
30
 
31
+ Authentication
32
+ --------------
33
+
34
+ A username and password can be set directly in the `options` hash (accepted by each API method):
35
+ ```ruby
36
+ options = {
37
+ :username => 'admin',
38
+ :password => 'password'
39
+ }
40
+ ```
41
+ These credentials are validated by Kill Bill either directly (users managed by Kill Bill) or via a third-party (LDAP, Okta, Auth0, etc.).
42
+
43
+ Alternatively, a bearer token can be passed as such:
44
+ ```ruby
45
+ options = {
46
+ :bearer => 'token'
47
+ }
48
+ ```
49
+ The security token would be validated by Kill bill via a third-party (e.g. Auth0).
50
+
51
+ By default, Kill Bill won't maintain sessions, except when calling the API `/1.0/kb/security/permissions` (`JSESSIONID`, present in the `Set-Cookie` response header).
52
+ This session id can be passed instead:
53
+ ```ruby
54
+ options = {
55
+ :session_id => 'JSESSIONID'
56
+ }
57
+ ```
58
+ Using this session mechanism is recommend for user interfaces or to minimize the runtime dependency with a third-party provider.
59
+
60
+ Note: if a timed out session is re-used (`last_access_time` older than 60 minutes by default), a `HTTP/1.1 401 Unauthorized` is returned with `Set-Cookie: JSESSIONID=deleteMe`, and the session is deleted from the database (and cache) on the server side.
61
+
31
62
  Examples
32
63
  --------
33
64
 
@@ -118,8 +118,11 @@ module KillBillClient
118
118
  # Configure RBAC, if enabled
119
119
  username = options[:username] || KillBillClient.username
120
120
  password = options[:password] || KillBillClient.password
121
+ bearer = options[:bearer]
121
122
  if username and password
122
123
  request.basic_auth(*[username, password].flatten[0, 2])
124
+ elsif bearer
125
+ request['authorization'] = 'Bearer ' + bearer
123
126
  end
124
127
  session_id = options[:session_id]
125
128
  if session_id
@@ -1,3 +1,3 @@
1
1
  module KillBillClient
2
- VERSION = '3.3.0'
2
+ VERSION = '3.3.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Killbill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-02 00:00:00.000000000 Z
11
+ date: 2021-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem-release