hydra-keycloak-client 0.1.6 → 0.1.7

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
  SHA256:
3
- metadata.gz: 18c487395b0610c378e53e63bd831b32c74f599f4fcd7fad8827698bd645dcfc
4
- data.tar.gz: 0b31711516d5f351b1c82bca9164462f124595eb40d7dc790316e6d43c7c08b0
3
+ metadata.gz: 291ce7dea090b7d863e9fd3d29c92bf035c64f940ef1b3c8d0fce955a54bf8fb
4
+ data.tar.gz: 94f719f340181a2cd5c12bd2d5eb070d53c6c1d55dbd1161f49249d6fd66b895
5
5
  SHA512:
6
- metadata.gz: 0ed1cb5e7793a4ab45473551345d1ee6eca95d8ad349e3fd9023cd5f7282edf4cdcc87598bb9bc86de2797cc3ff0198d6f458817f0ded485745ef4d4dc3229da
7
- data.tar.gz: 925857eea90aa7a6008f66febe1dadfa02820f72c0ca5ae2ec7cd24c20890c417a5268f2ad033084782d141706d47449f27d6c0797ef6b77e6899922f2ccc1d3
6
+ metadata.gz: 3198cc3b6df1e02af1686bdbdaa8f12dae01e47da07d20635ba843c5df4ac2de833c56c9c1629c0603856360345439bc2aeb34596f383a2853e1386d29ca672a
7
+ data.tar.gz: b7f96f9134234bd3c337f8727409a9d1a984ab8d375a484b29b7c32e9721e4e6d82509cc0162490e5451599c98a895d84a17d9ab390a83559ec520b3276e74f3
@@ -0,0 +1,16 @@
1
+ name: CI
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: self-hosted
8
+
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+
12
+ - name: Build image
13
+ run: docker build -f Dockerfile.test -t hkc_test_image .
14
+
15
+ - name: Run tests
16
+ run: docker run hkc_test_image rspec
data/Dockerfile.test ADDED
@@ -0,0 +1,7 @@
1
+ FROM ruby:2.7.4
2
+
3
+ COPY . /app
4
+ WORKDIR /app
5
+
6
+ RUN bundle install
7
+ CMD bundle exec rspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hydra-keycloak-client (0.1.5)
4
+ hydra-keycloak-client (0.1.7)
5
5
  dalli
6
6
  dry-auto_inject
7
7
  dry-container
@@ -16,11 +16,11 @@ GEM
16
16
  specs:
17
17
  coderay (1.1.3)
18
18
  concurrent-ruby (1.1.9)
19
- dalli (3.1.1)
19
+ dalli (3.2.1)
20
20
  diff-lcs (1.4.4)
21
- dry-auto_inject (0.8.0)
21
+ dry-auto_inject (0.9.0)
22
22
  dry-container (>= 0.3.4)
23
- dry-configurable (0.13.0)
23
+ dry-configurable (0.14.0)
24
24
  concurrent-ruby (~> 1.0)
25
25
  dry-core (~> 0.6)
26
26
  dry-container (0.9.0)
@@ -29,14 +29,14 @@ GEM
29
29
  dry-core (0.7.1)
30
30
  concurrent-ruby (~> 1.0)
31
31
  dry-inflector (0.2.1)
32
- dry-initializer (3.0.4)
32
+ dry-initializer (3.1.1)
33
33
  dry-logic (1.2.0)
34
34
  concurrent-ruby (~> 1.0)
35
35
  dry-core (~> 0.5, >= 0.5)
36
36
  dry-monads (1.4.0)
37
37
  concurrent-ruby (~> 1.0)
38
38
  dry-core (~> 0.7)
39
- dry-schema (1.8.0)
39
+ dry-schema (1.9.1)
40
40
  concurrent-ruby (~> 1.0)
41
41
  dry-configurable (~> 0.13, >= 0.13.0)
42
42
  dry-core (~> 0.5, >= 0.5)
@@ -5,7 +5,6 @@ require 'dry/container'
5
5
  require 'dry/schema'
6
6
 
7
7
  require 'hydra/keycloak/container'
8
- require 'hydra/keycloak/user_data'
9
8
  require 'hydra/keycloak/code_verifier'
10
9
 
11
10
  module Hydra
@@ -131,22 +130,6 @@ module Hydra
131
130
  fetch_token(session_state, 'access_token').success?
132
131
  end
133
132
 
134
- def user_data(session_state)
135
- unless authenticated?(session_state)
136
- return Failure(status: 400, code: :not_authenticated)
137
- end
138
-
139
- fetch_token(session_state, 'access_token').fmap do |access_token|
140
- UserData.new(
141
- username: access_token[:login],
142
- base_subject_id: access_token[:base_subject_id],
143
- subj_group_id: access_token[:subj_group_id],
144
- firm_id: access_token[:firm_id],
145
- base_subject_first_name: access_token[:base_subject_first_name],
146
- jti: access_token[:jti])
147
- end
148
- end
149
-
150
133
  def access_token(session_state)
151
134
  unless authenticated?(session_state)
152
135
  return Failure(status: 400, code: :not_authenticated)
@@ -26,7 +26,7 @@ module Hydra
26
26
  end
27
27
 
28
28
  def [](key)
29
- @data.fetch(key)
29
+ @data[key]
30
30
  end
31
31
  end
32
32
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Hydra
4
4
  module Keycloak
5
- VERSION = '0.1.6'
5
+ VERSION = '0.1.7'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-keycloak-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fedor Kosolapov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-16 00:00:00.000000000 Z
11
+ date: 2022-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -131,6 +131,8 @@ executables:
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
+ - ".github/workflows/main.yml"
135
+ - Dockerfile.test
134
136
  - Gemfile
135
137
  - Gemfile.lock
136
138
  - README.md
@@ -148,7 +150,6 @@ files:
148
150
  - lib/hydra/keycloak/store/redis_client.rb
149
151
  - lib/hydra/keycloak/token.rb
150
152
  - lib/hydra/keycloak/urls.rb
151
- - lib/hydra/keycloak/user_data.rb
152
153
  - lib/hydra/keycloak/version.rb
153
154
  homepage: https://github.com/latera/hydra-keycloak-client
154
155
  licenses: []
@@ -172,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
173
  - !ruby/object:Gem::Version
173
174
  version: '0'
174
175
  requirements: []
175
- rubygems_version: 3.1.6
176
+ rubygems_version: 3.2.3
176
177
  signing_key:
177
178
  specification_version: 4
178
179
  summary: Keycloak client for SSO
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'dry/struct'
4
-
5
- module Hydra
6
- module Keycloak
7
- module Types
8
- include Dry.Types()
9
- end
10
-
11
- class UserData < Dry::Struct
12
- attribute :username, Types::String
13
- attribute :base_subject_id, Types::Coercible::Integer
14
- attribute :subj_group_id, Types::Coercible::Integer
15
- attribute :firm_id, Types::Coercible::Integer
16
- attribute :base_subject_first_name, Types::String
17
- attribute :jti, Types::String
18
- end
19
- end
20
- end