killbill-client 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +31 -0
- data/lib/killbill_client/api/net_http_adapter.rb +3 -0
- data/lib/killbill_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03e77573407a78aef2165e380bc7e1d0f672b53d
|
4
|
+
data.tar.gz: 27e12ebd3c57f128cdd181c16e77e19d4be9daa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|
11
|
+
date: 2021-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem-release
|