keycloak 2.5.0 → 2.5.1

This diff has not been reviewed by any users.
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: c71e040ba83715ddd3e25671c1356402108fb1826954b0d8a0f939a071666fed
4
- data.tar.gz: 5de8fa49fcd5adf2e9ffb14f45900bac80dad1c1d31a33f4c3bc6bcbdf76899b
3
+ metadata.gz: 52da55a01a2b3a18934d2fd52092786d8b2efaf0f3d6f72d09757dff97f3241f
4
+ data.tar.gz: 6e8008d60572da3bdd56de6cd647a0e3a9ff59218b43b7e7248ce4d54201c106
5
5
  SHA512:
6
- metadata.gz: 83e956681efe0986abb87becc34f23101ae4eca113ec54b8aa872829f486ea2b829d5c1fb95553a3e3ebe2578e5fdf873e1ef2134d9f8dadc3522cbdc1f4bf40
7
- data.tar.gz: d7b63fc19ca1d01ceacbe94cfbb7d58271ffd94a53863370b7066053d80991c3c972bc76b6d62657b35fcb8bf9b89641bd209837434894198185494e22bb0316
6
+ metadata.gz: c9b7f0911880f3f28b0135f54175e837086e8f816b7406a96b97e4fa94b9a0237d1501ff2754cb93b2d68a8fa8d274e6db534b4ab315509d347267b74f2cc657
7
+ data.tar.gz: cfb6bb9d8d7872594a408f6c1c13425747af5a0378abac367c3e291b9695ae6f76d2f98d1af44d3e445867c4d05ccdf2f0ad66669da2735f05301d31a863f288
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keycloak (2.5.0)
4
+ keycloak (2.5.1)
5
5
  json
6
6
  jwt
7
7
  rest-client
data/README.md CHANGED
@@ -28,7 +28,7 @@ Or install it yourself:
28
28
 
29
29
  To add the configuration file:
30
30
 
31
- $ rails generate initializer
31
+ $ rails generate keycloak:config
32
32
 
33
33
 
34
34
  ## Use
@@ -101,7 +101,6 @@ end
101
101
  ```
102
102
  This way, every time gem needs to use the token information to consume a Keycloak service, it will invoke this lambda method.
103
103
 
104
-
105
104
  ```ruby
106
105
  Keycloak.proc_external_attributes
107
106
  ```
@@ -122,6 +121,12 @@ end
122
121
 
123
122
  <b>Note:</b> The `Keycloak.proc_cookie_token` and `Keycloak.proc_external_attributes` attributes can be defined in the `initialize` of the controller `ApplicationController`.
124
123
 
124
+ ```ruby
125
+ Keycloak.validate_token_when_call_has_role
126
+ ```
127
+
128
+ The introspect of the token will be executed every time the `Keycloak::Client.has_role?` method is invoked, if this setting is set to `true`.
129
+
125
130
 
126
131
  ### Keycloak::Client
127
132
 
@@ -22,10 +22,10 @@ Então execute:
22
22
  Ou instale você mesmo:
23
23
 
24
24
  $ gem install keycloak
25
-
25
+
26
26
  Para adicionar o arquivo de configuração:
27
27
 
28
- $ rails generate initializer
28
+ $ rails generate keycloak:config
29
29
 
30
30
  ## Utilização
31
31
 
@@ -116,6 +116,13 @@ end
116
116
  <b>Observação:</b> Os atributos `Keycloak.proc_cookie_token` e `Keycloak.proc_external_attributes` podem ser definidos no `initialize` do controller `ApplicationController`.
117
117
 
118
118
 
119
+ ```ruby
120
+ Keycloak.validate_token_when_call_has_role
121
+ ```
122
+
123
+ Será executado o introspect do token todas as vezes que o método `Keycloak::Client.has_role?` for invocado, caso esta configuração esteja setada como `true`.
124
+
125
+
119
126
  ### Keycloak::Client
120
127
 
121
128
  O módulo `Keycloak::Client` possui os métodos que representam os serviços de <b>endpoints</b>. Esses serviços são fundamentais para a criação e atualização de tokens, efetuação de login e logout, e, também para a obtenção de informações sintéticas de um usuário logado. O que habilita a gem a fazer uso de todos esses serviços é o arquivo de instalação do client citado anteriormente.
@@ -7,4 +7,6 @@ Keycloak.keycloak_controller = 'session'
7
7
  # relm name (only if the installation file is not present)
8
8
  Keycloak.realm = ''
9
9
  # relm url (only if the installation file is not present)
10
- Keycloak.auth_server_url = ''
10
+ Keycloak.auth_server_url = ''
11
+ # The introspect of the token will be executed every time the Keycloak::Client.has_role? method is invoked, if this setting is set to true.
12
+ Keycloak.validate_token_when_call_has_role = false
@@ -0,0 +1,10 @@
1
+ module Keycloak
2
+ module Generators
3
+ class ConfigGenerator < Rails::Generators::Base
4
+ source_root(File.expand_path(File.dirname(__FILE__)))
5
+ def copy_initializer
6
+ copy_file '../../keycloak.rb', 'config/initializers/keycloak.rb'
7
+ end
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Keycloak
2
- VERSION = "2.5.0"
2
+ VERSION = "2.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keycloak
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Portugues
@@ -115,8 +115,8 @@ files:
115
115
  - bin/console
116
116
  - bin/setup
117
117
  - keycloak.gemspec
118
- - lib/generators/initializer_generator.rb
119
118
  - lib/generators/keycloak.rb
119
+ - lib/generators/keycloak/config/config_generator.rb
120
120
  - lib/keycloak.rb
121
121
  - lib/keycloak/exceptions.rb
122
122
  - lib/keycloak/version.rb
@@ -1,8 +0,0 @@
1
- class InitializerGenerator < Rails::Generators::Base
2
- source_root(File.expand_path(File.dirname(__FILE__)))
3
-
4
- def copy_initializer
5
- copy_file 'keycloak.rb', 'config/initializers/keycloak.rb'
6
- end
7
-
8
- end