gamora 0.10.0 → 0.12.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62fcee90396875db0256e297c90dda80546c3268cfecdd4f0e53b7f3c4e68ba8
4
- data.tar.gz: '093571bfd8706530b474c1bf9d046db56cd5a0a53820546afc88f274f528a6a6'
3
+ metadata.gz: b42990c52c0cce68d2464f8479c8de617b42c11475971194b15874ee570fefc5
4
+ data.tar.gz: d03c696925417027a34bf19b9cf9f9c40a00e625a2f7bf14d59d01a31158747e
5
5
  SHA512:
6
- metadata.gz: '0888b96495e6e55f0cc49512a9ec0c8d73d67e839a2dae0207bdb81728032e46436b8a3ce0cdf1daa1352d5ae849a4a723a28fe29d9c6c615b5efbf6dd33cc8c'
7
- data.tar.gz: 3c00a26cce8ad257170853ffc0c6c9fd3a355372f401881b470cb9cdb86d0a94e43b401e5ac94024979faa3636969fc33ec7429f033287d006a6ff5bfa8360aa
6
+ metadata.gz: f03be26d3851c500561b50903bbc03475608822c69f21024fc4f969231b149049a2c3711ab4c234071a2f956efe01a5a9779a7bd105173cadad0e52dc998e119
7
+ data.tar.gz: 6177e2b7e04290502fb6395d29be8389e5ee6e743aeecf6e23efc401cce42e743aa6f88a140deb0e92190f0444b2272776269044e7ed3b52a693279b16fd400a
data/README.md CHANGED
@@ -115,21 +115,6 @@ Optionally, if you want to do something different when authentication
115
115
  fails, you just need to override the `user_authentication_failed!`
116
116
  method in you controller and customize it as you wish.
117
117
 
118
- ## Cross-Client Identity
119
-
120
- By default, gamora will accept only access tokens that were generating
121
- with the `client_id` in the configuration. If access tokens coming from
122
- other clients have to be accepted, make sure to add their client ids to
123
- the `whitelisted_clients` config option.
124
-
125
- ```ruby
126
- Gamora.setup do |config|
127
- ...
128
-
129
- config.whitelisted_clients = ["OTHER_CLIENT_ID"]
130
- end
131
- ```
132
-
133
118
  ## Caching
134
119
 
135
120
  In order to avoid performing requests to the IDP on each request in the
@@ -2,6 +2,18 @@
2
2
 
3
3
  module Gamora
4
4
  module AuthorizationUrl
5
+ ALLOWED_PARAMS = %i[
6
+ scope
7
+ state
8
+ theme
9
+ prompt
10
+ max_age
11
+ strategy
12
+ branding
13
+ ui_locales
14
+ allow_create
15
+ ].freeze
16
+
5
17
  def authorization_url(params, extra_params = {})
6
18
  data =
7
19
  default_params
@@ -21,21 +33,13 @@ module Gamora
21
33
  prompt: Configuration.default_prompt,
22
34
  strategy: Configuration.default_strategy,
23
35
  branding: Configuration.default_branding,
24
- ui_locales: Configuration.ui_locales.call
36
+ ui_locales: Configuration.ui_locales.call,
37
+ allow_create: Configuration.allow_create
25
38
  }
26
39
  end
27
40
 
28
41
  def authorization_params(params)
29
- params.permit(
30
- :scope,
31
- :state,
32
- :theme,
33
- :prompt,
34
- :max_age,
35
- :strategy,
36
- :branding,
37
- :ui_locales
38
- )
42
+ params.permit(*ALLOWED_PARAMS)
39
43
  end
40
44
  end
41
45
  end
@@ -42,15 +42,7 @@ module Gamora
42
42
  end
43
43
 
44
44
  def valid_token_data?(token_data)
45
- token_data[:active] && whitelisted_client?(token_data[:client_id])
46
- end
47
-
48
- def whitelisted_client?(client_id)
49
- whitelisted_clients.include?(client_id)
50
- end
51
-
52
- def whitelisted_clients
53
- Configuration.whitelisted_clients | [Configuration.client_id]
45
+ token_data[:active]
54
46
  end
55
47
 
56
48
  def assign_current_user_from_claims(claims)
@@ -17,9 +17,9 @@ module Gamora
17
17
  mattr_accessor :default_branding, default: "amco"
18
18
  mattr_accessor :default_theme, default: "default"
19
19
  mattr_accessor :ui_locales, default: -> { I18n.locale }
20
+ mattr_accessor :allow_create, default: true
20
21
  mattr_accessor :userinfo_cache_expires_in, default: 1.minute
21
22
  mattr_accessor :introspect_cache_expires_in, default: 0.seconds
22
- mattr_accessor :whitelisted_clients, default: []
23
23
 
24
24
  def setup
25
25
  yield(self) if block_given?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gamora
4
- VERSION = "0.10.0"
4
+ VERSION = "0.12.0"
5
5
  end
@@ -19,7 +19,7 @@ Gamora.setup do |config|
19
19
  # config.default_branding = "amco"
20
20
  # config.default_theme = "default"
21
21
  # config.ui_locales = -> { I18n.locale }
22
+ # config.allow_create = true
22
23
  # config.userinfo_cache_expires_in = 1.minute
23
24
  # config.introspect_cache_expires_in = 0.seconds
24
- # config.whitelisted_clients = []
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamora
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Gutiérrez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-21 00:00:00.000000000 Z
11
+ date: 2024-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2