reclaim-oidc 0.0.4 → 0.0.5
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/lib/reclaim_oidc.rb +22 -20
- 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: 9b2d1d8c1538ffd6758d085e72453d9ada5ab7e9c80dc9f4c7e9e5a2c900a7e2
|
4
|
+
data.tar.gz: 18c18d0d387e63f75d0fbe721002e6ee0efdfefe280dda31a52c9fbd89805dfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d414d535b43f089cc628cd19041130a6a115c6ab8b98e31993662ce468409e4fc3a140df1fea6f205dd79404ae81a42a0c2ece342f3d7d84139c2c27d03ad525
|
7
|
+
data.tar.gz: 16ac3e533f34471d8083608821ca591613c5874a87067339599ca02b8257afc08c6665c0409898c388d71be700a8795af0a3c45207a2d738a8cd7917661fc590
|
data/lib/reclaim_oidc.rb
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
+
$VERSION_MAJOR = 0
|
5
|
+
$VERSION_MINOR = 0
|
6
|
+
$VERSION_MICRO = 5
|
7
|
+
|
4
8
|
class ReclaimOidc
|
5
9
|
def initialize(verbose=false, url='http://localhost:7776')
|
6
10
|
@verbose = verbose
|
7
11
|
@url = url
|
8
12
|
@client_secret = get_client_secret()
|
9
13
|
end
|
10
|
-
def self.
|
11
|
-
|
14
|
+
def self.version
|
15
|
+
return "#{$VERSION_MAJOR}.#{$VERSION_MINOR}.#{$VERSION_MICRO}"
|
12
16
|
end
|
13
17
|
def parse_identities_from_http(body)
|
14
18
|
arr = JSON.parse(body)
|
@@ -48,25 +52,18 @@ class ReclaimOidc
|
|
48
52
|
resp = http.post(uri.path, payload.to_json)
|
49
53
|
end
|
50
54
|
uri = URI(@url + "/namestore/#{name}")
|
51
|
-
|
55
|
+
records = {'record_name' => "@",
|
56
|
+
'data' => []}
|
57
|
+
records["data"] << {'record_type' => "RECLAIM_OIDC_CLIENT",
|
52
58
|
'value' => description,
|
53
|
-
'
|
54
|
-
'expiration_time' => "1d",
|
59
|
+
'expiration_time' => "1h",
|
55
60
|
'flag' => 8}
|
56
|
-
|
57
|
-
#req = Net::HTTP::Post.new(uri, record)
|
58
|
-
Net::HTTP.start(uri.host, uri.port) do |http|
|
59
|
-
resp = http.post(uri.path,record.to_json)
|
60
|
-
end
|
61
|
-
record = {'record_type' => "RECLAIM_OIDC_REDIRECT",
|
61
|
+
records["data"] << {'record_type' => "RECLAIM_OIDC_REDIRECT",
|
62
62
|
'value' => redirect_uri,
|
63
|
-
'
|
64
|
-
'expiration_time' => "1d",
|
63
|
+
'expiration_time' => "1h",
|
65
64
|
'flag' => 8}
|
66
|
-
#req = Net::HTTP::Post.new(uri, record)
|
67
|
-
#resp = Net::HTTP.post(uri,record.to_json)
|
68
65
|
Net::HTTP.start(uri.host, uri.port) do |http|
|
69
|
-
resp = http.post(uri.path,
|
66
|
+
resp = http.post(uri.path,records.to_json)
|
70
67
|
end
|
71
68
|
end
|
72
69
|
def delete_client(name)
|
@@ -105,11 +102,16 @@ class ReclaimOidc
|
|
105
102
|
end
|
106
103
|
def parse_client_info(obj)
|
107
104
|
obj.each do |record|
|
108
|
-
if
|
109
|
-
|
105
|
+
if "@" != record["record_name"]
|
106
|
+
next
|
110
107
|
end
|
111
|
-
|
112
|
-
|
108
|
+
record["data"].each do |data|
|
109
|
+
if (data['record_type'] == 'RECLAIM_OIDC_CLIENT')
|
110
|
+
@description = data['value']
|
111
|
+
end
|
112
|
+
if (data['record_type'] == 'RECLAIM_OIDC_REDIRECT')
|
113
|
+
@redirect_uri = data['value']
|
114
|
+
end
|
113
115
|
end
|
114
116
|
end
|
115
117
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reclaim-oidc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Schanzenbach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Used to manage re:claimID OpenID Connect clients and OpenID Connect Provider
|
14
14
|
configuration(s)
|