clonk 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/clonk.rb +0 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 625c5440be7ee9819f305cf8a5ba0acdfe78904b9427e3ec8b855150a1538830
|
4
|
+
data.tar.gz: 063d62e67116ebb5662bf12466a97a0096375b88c94b42eda488298c43dbd99e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 191c6d065c35b1ad9b4c7c8dba6b7099f61011950748bf920305f5b94e80c72314398393bafa73baf2a6c55d1c4490826b04914ae2e6c83b62c04091356b511a
|
7
|
+
data.tar.gz: 22ad4a41f77a146e1b4ad0fb26bdd3e3368d3f91c25da961fd6762502395029932e72f438e4d24ddc17e1f16f77a32dd1ed68cf2abf83e0d19cddda35a3b772a
|
data/lib/clonk.rb
CHANGED
@@ -4,23 +4,9 @@ require 'faraday'
|
|
4
4
|
require 'faraday_middleware'
|
5
5
|
require 'json'
|
6
6
|
|
7
|
-
BASE_URL = CGI.escape(ENV.fetch('SSO_BASE_URL'))
|
8
|
-
|
9
7
|
# Keycloak/Red Hat SSO API wrapper
|
10
8
|
module Clonk
|
11
9
|
class << self
|
12
|
-
##
|
13
|
-
# Defines a Faraday::Connection object linked to the SSO instance.
|
14
|
-
|
15
|
-
def connection(token: nil, raise_error: true, json: true)
|
16
|
-
Faraday.new(url: BASE_URL) do |faraday|
|
17
|
-
faraday.request(json ? :json : :url_encoded)
|
18
|
-
faraday.use Faraday::Response::RaiseError if raise_error
|
19
|
-
faraday.adapter Faraday.default_adapter
|
20
|
-
faraday.headers['Authorization'] = "Bearer #{token}" if token
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
10
|
def logout_url(base_url:, realm_id:, redirect_uri:)
|
25
11
|
"#{base_url}/auth/realms/#{realm_id}/protocol/openid-connect/logout?redirect_uri=#{CGI.escape(redirect_uri)}"
|
26
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clonk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Fish
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|