hydra-keycloak-client 0.1.14 → 0.1.16

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: 0df63eb8a97b5a549f867fa0de5fe449c9791ca811195c1aba5610fb54a278e6
4
- data.tar.gz: 05d90289f5a8dce6618664a44ba1e7f0b1cd4d901b09895d52b43ef7fac8666c
3
+ metadata.gz: e21882cde2f44b50a21259216097d6f101429189476d7c8e672a45376445639e
4
+ data.tar.gz: 109d00d611d0755b8a8ef9d1ddc564d0b05203bbf52fe09b2bf50d41c58cf62d
5
5
  SHA512:
6
- metadata.gz: e00caef745d78165d825b25a69b7afcb578dda19e9bccd543a56c3640ad5be1f9d70e402d977d38594821c4d2a9a988f32dec05cdc5748dcdf58b834b090afbe
7
- data.tar.gz: 919a92716cbf26f5e8f94b973fe5023d350c298bd541caa50e81d4ec824b59c789fd0fa52480d65e9c98e8405d92317b19090467102815725abbc62c42ba99cd
6
+ metadata.gz: 66ece7983e4ed5731233f41ad9d15e4bf6fcb1c55f8e2aa708b3317031ff89f201e9cdf3ec7bc94fc7e5855f9b95b78ed7c53ddfcac085108053893719072b27
7
+ data.tar.gz: a1edbad85e6397ae3ea3f1f6e66c3f0cecc16648e4b344d900ac16c71a2904ac450041615cc022319421380b39837a93abd4e5765ec3c6dcc1e196e70483785e
@@ -0,0 +1,26 @@
1
+ name: Create release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '*'
7
+
8
+ jobs:
9
+ deploy:
10
+ runs-on: self-hosted
11
+
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+
15
+ - name: Set env
16
+ run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
17
+
18
+ - name: Build releaser image
19
+ run: docker build -f Dockerfile.release -t hkc:release .
20
+
21
+ - name: Release gem
22
+ run: |
23
+ docker run --rm --name hkc_release \
24
+ -e RUBYGEMS_TOKEN=${{ secrets.RUBYGEMS_TOKEN }} \
25
+ -e RELEASE_VERSION=${{ env.RELEASE_VERSION }} \
26
+ hkc:release
@@ -0,0 +1,11 @@
1
+ FROM ruby:3.2.0
2
+
3
+ COPY . /app
4
+
5
+ WORKDIR /app
6
+
7
+ RUN chmod +x ./release.sh
8
+
9
+ RUN bundle install
10
+
11
+ ENTRYPOINT ["./release.sh"]
data/Dockerfile.test CHANGED
@@ -1,4 +1,4 @@
1
- FROM ruby:2.7.4
1
+ FROM ruby:3.2.0
2
2
 
3
3
  COPY . /app
4
4
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hydra-keycloak-client (0.1.14)
4
+ hydra-keycloak-client (0.1.16)
5
5
  dry-auto_inject
6
6
  dry-container
7
7
  dry-monads
@@ -14,31 +14,34 @@ GEM
14
14
  specs:
15
15
  ast (2.4.2)
16
16
  coderay (1.1.3)
17
- concurrent-ruby (1.1.10)
17
+ concurrent-ruby (1.2.0)
18
18
  connection_pool (2.3.0)
19
- dalli (3.2.3)
20
- diff-lcs (1.4.4)
19
+ dalli (3.2.0)
20
+ diff-lcs (1.5.0)
21
21
  docile (1.4.0)
22
- dry-auto_inject (0.9.0)
22
+ dry-auto_inject (0.7.0)
23
23
  dry-container (>= 0.3.4)
24
- dry-configurable (0.15.0)
24
+ dry-configurable (0.12.1)
25
25
  concurrent-ruby (~> 1.0)
26
- dry-core (~> 0.6)
27
- dry-container (0.10.1)
26
+ dry-core (~> 0.5, >= 0.5.0)
27
+ dry-container (0.7.2)
28
28
  concurrent-ruby (~> 1.0)
29
- dry-core (0.8.1)
29
+ dry-configurable (~> 0.1, >= 0.1.3)
30
+ dry-core (0.6.0)
30
31
  concurrent-ruby (~> 1.0)
31
- dry-inflector (0.3.0)
32
- dry-initializer (3.1.1)
32
+ dry-equalizer (0.3.0)
33
+ dry-inflector (0.2.0)
34
+ dry-initializer (3.0.4)
33
35
  dry-logic (1.2.0)
34
36
  concurrent-ruby (~> 1.0)
35
37
  dry-core (~> 0.5, >= 0.5)
36
- dry-monads (1.4.0)
38
+ dry-monads (1.3.5)
37
39
  concurrent-ruby (~> 1.0)
38
- dry-core (~> 0.7)
39
- dry-schema (1.9.3)
40
+ dry-core (~> 0.4, >= 0.4.4)
41
+ dry-equalizer
42
+ dry-schema (1.6.2)
40
43
  concurrent-ruby (~> 1.0)
41
- dry-configurable (~> 0.13, >= 0.13.0)
44
+ dry-configurable (~> 0.8, >= 0.8.3)
42
45
  dry-core (~> 0.5, >= 0.5)
43
46
  dry-initializer (~> 3.0)
44
47
  dry-logic (~> 1.0)
@@ -54,17 +57,17 @@ GEM
54
57
  dry-inflector (~> 0.1, >= 0.1.2)
55
58
  dry-logic (~> 1.0, >= 1.0.2)
56
59
  ice_nine (0.11.2)
57
- jwt (2.4.1)
60
+ jwt (2.7.0)
58
61
  method_source (1.0.0)
59
62
  parallel (1.21.0)
60
63
  parser (3.1.1.0)
61
64
  ast (~> 2.4.1)
62
- pry (0.14.1)
65
+ pry (0.14.2)
63
66
  coderay (~> 1.1)
64
67
  method_source (~> 1.0)
65
68
  rainbow (3.1.1)
66
69
  rake (12.3.3)
67
- redis (5.0.5)
70
+ redis (5.0.6)
68
71
  redis-client (>= 0.9.0)
69
72
  redis-client (0.11.2)
70
73
  connection_pool
@@ -74,16 +77,16 @@ GEM
74
77
  rspec-core (~> 3.10.0)
75
78
  rspec-expectations (~> 3.10.0)
76
79
  rspec-mocks (~> 3.10.0)
77
- rspec-core (3.10.1)
80
+ rspec-core (3.10.2)
78
81
  rspec-support (~> 3.10.0)
79
- rspec-expectations (3.10.1)
82
+ rspec-expectations (3.10.2)
80
83
  diff-lcs (>= 1.2.0, < 2.0)
81
84
  rspec-support (~> 3.10.0)
82
- rspec-mocks (3.10.2)
85
+ rspec-mocks (3.10.3)
83
86
  diff-lcs (>= 1.2.0, < 2.0)
84
87
  rspec-support (~> 3.10.0)
85
88
  rspec-support (3.10.3)
86
- rubocop (1.26.0)
89
+ rubocop (1.27.0)
87
90
  parallel (~> 1.10)
88
91
  parser (>= 3.1.0.0)
89
92
  rainbow (>= 2.2.2, < 4.0)
@@ -95,7 +98,7 @@ GEM
95
98
  rubocop-ast (1.16.0)
96
99
  parser (>= 3.1.1.0)
97
100
  ruby-progressbar (1.11.0)
98
- simplecov (0.21.2)
101
+ simplecov (0.22.0)
99
102
  docile (~> 1.1)
100
103
  simplecov-html (~> 0.11)
101
104
  simplecov_json_formatter (~> 0.1)
@@ -104,7 +107,7 @@ GEM
104
107
  simplecov (~> 0.19)
105
108
  simplecov-html (0.12.3)
106
109
  simplecov_json_formatter (0.1.4)
107
- unicode-display_width (2.1.0)
110
+ unicode-display_width (2.4.2)
108
111
 
109
112
  PLATFORMS
110
113
  ruby
@@ -121,4 +124,4 @@ DEPENDENCIES
121
124
  simplecov-cobertura
122
125
 
123
126
  BUNDLED WITH
124
- 2.3.5
127
+ 2.3.26
@@ -73,9 +73,9 @@ module Hydra
73
73
  def register_store_client(config)
74
74
  case config.fetch(:store_client)
75
75
  when 'redis'
76
- register_redis_store(config.fetch(:store_client_options))
76
+ register_redis_store(**config.fetch(:store_client_options))
77
77
  when 'memcached'
78
- register_memcached_store(config.fetch(:store_client_options))
78
+ register_memcached_store(**config.fetch(:store_client_options))
79
79
  end
80
80
  end
81
81
 
@@ -5,21 +5,22 @@ require 'jwt'
5
5
  module Hydra
6
6
  module Keycloak
7
7
  class Token
8
+ REGISTERED_CLAIMS = %i[iss sub aud exp nbf iat jti].freeze
9
+ PUBLIC_CLAIMS = %i[auth_time scope].freeze
10
+ PRIVATE_CLAIMS = %i[session_state resource_access].freeze
11
+
8
12
  attr_reader :source,
9
- :exp,
10
- :iat,
11
- :auth_time,
12
- :iss,
13
- :session_state,
14
- :scope,
15
- :jti
13
+ :data,
14
+ *REGISTERED_CLAIMS,
15
+ *PUBLIC_CLAIMS,
16
+ *PRIVATE_CLAIMS
16
17
 
17
18
  def initialize(source)
18
19
  @source = source
19
20
  @data = ::JWT.decode(source, nil, false).first.transform_keys(&:to_sym)
20
21
  end
21
22
 
22
- %i[exp iat auth_time iss session_state scope jti].each do |field|
23
+ [*REGISTERED_CLAIMS, *PUBLIC_CLAIMS, *PRIVATE_CLAIMS].each do |field|
23
24
  define_method(field) do
24
25
  @data.fetch(field)
25
26
  end
@@ -25,7 +25,7 @@ module Hydra
25
25
  Net::ProtocolError].freeze
26
26
 
27
27
  def post(path, body)
28
- response = http.post_form(URI(path), **body)
28
+ response = http.post_form(URI(path), body)
29
29
 
30
30
  if response.code == '200'
31
31
  json = JSON.parse(response.body)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Hydra
4
4
  module Keycloak
5
- VERSION = '0.1.14'
5
+ VERSION = '0.1.16'
6
6
  end
7
7
  end
data/release.sh ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ mkdir -p $HOME/.gem
4
+ touch $HOME/.gem/credentials
5
+ chmod 0600 $HOME/.gem/credentials
6
+ printf -- "---\n:rubygems_api_key: $RUBYGEMS_TOKEN\n" > $HOME/.gem/credentials
7
+
8
+ gem build hydra-keycloak-client.gemspec
9
+ gem push hydra-keycloak-client-$RELEASE_VERSION.gem
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.14
4
+ version: 0.1.16
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-12-08 00:00:00.000000000 Z
11
+ date: 2023-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -104,9 +104,11 @@ extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
106
  - ".github/workflows/main.yml"
107
+ - ".github/workflows/release.yml"
107
108
  - ".gitignore"
108
109
  - ".rspec"
109
110
  - ".rubocop.yml"
111
+ - Dockerfile.release
110
112
  - Dockerfile.test
111
113
  - Gemfile
112
114
  - Gemfile.lock
@@ -128,6 +130,7 @@ files:
128
130
  - lib/hydra/keycloak/tokens/repo.rb
129
131
  - lib/hydra/keycloak/urls.rb
130
132
  - lib/hydra/keycloak/version.rb
133
+ - release.sh
131
134
  - run_tests.sh
132
135
  homepage: https://github.com/hydra-billing/hydra-keycloak-client
133
136
  licenses: []
@@ -151,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
154
  - !ruby/object:Gem::Version
152
155
  version: '0'
153
156
  requirements: []
154
- rubygems_version: 3.1.6
157
+ rubygems_version: 3.4.1
155
158
  signing_key:
156
159
  specification_version: 4
157
160
  summary: Keycloak client for SSO