apipie-bindings 0.5.0 → 0.6.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a72210de6a88e0e439158f565d71b121f2f375d730924256318ebd0ae53c7f7
|
4
|
+
data.tar.gz: 8aeb8cc14f9901452ab26a408a4db348fa7babeb874eab5b097e3811d1341245
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31c03299a7adbc40fb3f3678160a0b132993ff065c111de6d38f8d2e22013b0ca1700ca72127098f14691c19848cc35ef9057c2024021090d8a7c6e19c7033ea
|
7
|
+
data.tar.gz: 9b729a79631b955e8d99fb2d1e1c3546add63fa582d436cd059884c8b1f7a46b08f6cb3bf333e16ad4d05ee839b1f6efb51e068b324a1f1eb10dc48448c3cf3b
|
data/doc/release_notes.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
Release notes
|
2
2
|
=============
|
3
|
+
### 0.6.0 (2023-02-10)
|
4
|
+
* Add basic auth external ([PR #82](https://github.com/Apipie/apipie-bindings/pull/82))
|
5
|
+
|
3
6
|
### 0.5.0 (2022-05-10)
|
4
7
|
* Add support for kerberos negotiate auth ([PR #81](https://github.com/Apipie/apipie-bindings/pull/81))
|
5
8
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'apipie_bindings/authenticators/basic_auth'
|
2
|
+
|
3
|
+
module ApipieBindings
|
4
|
+
module Authenticators
|
5
|
+
class BasicAuthExternal < BasicAuth
|
6
|
+
def initialize(user, password, authentication_url, auth_request_options = {})
|
7
|
+
super(user, password)
|
8
|
+
@authentication_url = authentication_url
|
9
|
+
@auth_request_options = auth_request_options
|
10
|
+
end
|
11
|
+
|
12
|
+
def authenticate(original_request, _args)
|
13
|
+
request = RestClient::Resource.new(
|
14
|
+
@authentication_url,
|
15
|
+
@auth_request_options.merge({ user: @user, password: @password })
|
16
|
+
)
|
17
|
+
request.get do |response, _, raw_response|
|
18
|
+
if response.code == 401
|
19
|
+
raise RestClient::Unauthorized.new(response), 'External authentication did not pass.'
|
20
|
+
end
|
21
|
+
|
22
|
+
cookie = raw_response['set-cookie'].split('; ')[0]
|
23
|
+
@auth_cookie = cookie
|
24
|
+
original_request['Cookie'] = cookie
|
25
|
+
end
|
26
|
+
|
27
|
+
original_request
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'apipie_bindings/authenticators/basic_auth'
|
2
|
+
require 'apipie_bindings/authenticators/basic_auth_external'
|
2
3
|
require 'apipie_bindings/authenticators/credentials_legacy'
|
3
4
|
require 'apipie_bindings/authenticators/oauth'
|
4
5
|
require 'apipie_bindings/authenticators/negotiate'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apipie-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Bačovský
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- lib/apipie_bindings/authenticators.rb
|
198
198
|
- lib/apipie_bindings/authenticators/base.rb
|
199
199
|
- lib/apipie_bindings/authenticators/basic_auth.rb
|
200
|
+
- lib/apipie_bindings/authenticators/basic_auth_external.rb
|
200
201
|
- lib/apipie_bindings/authenticators/credentials_legacy.rb
|
201
202
|
- lib/apipie_bindings/authenticators/negotiate.rb
|
202
203
|
- lib/apipie_bindings/authenticators/oauth.rb
|
@@ -271,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
272
|
- !ruby/object:Gem::Version
|
272
273
|
version: '0'
|
273
274
|
requirements: []
|
274
|
-
rubygems_version: 3.1.
|
275
|
+
rubygems_version: 3.1.6
|
275
276
|
signing_key:
|
276
277
|
specification_version: 4
|
277
278
|
summary: The Ruby bindings for Apipie documented APIs
|