gamora 0.13.0 → 0.14.1
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/app/controllers/gamora/authorization_controller.rb +5 -3
- data/lib/gamora/authentication/base.rb +1 -0
- data/lib/gamora/configuration.rb +1 -1
- data/lib/gamora/user.rb +1 -0
- data/lib/gamora/version.rb +1 -1
- data/lib/generators/gamora/templates/gamora.rb +1 -1
- metadata +3 -7
- data/app/models/gamora/application_record.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b86b5408e3b789413964ee3f2bda90e09a720f208e0fd0e8321e201bd4b7dbf3
|
4
|
+
data.tar.gz: f4ffab58834e0d101e429bedd2eda712eea88c4c249e32b5705292aac38da64a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5645b009f2fd9547d3e1039c3997c21f7a2ea57bf9a11fdd71fbe38cb0ef7cb5e1bb2ce4e689bd908149252b7c4c12319787382c0587a09addd3f17b6c883aa3
|
7
|
+
data.tar.gz: 0b004457b47a11f2f45abbb87497fb1e91c5c46feb8b57a16765380903847177399dffb3d39f5b6fdc68fe5035d1ca602c90997a14d34a828fbd63f9ef244b6d
|
@@ -7,9 +7,11 @@ module Gamora
|
|
7
7
|
before_action :authenticate_user!
|
8
8
|
|
9
9
|
def show
|
10
|
-
Configuration.authorization_method.call(current_user)
|
11
|
-
render
|
12
|
-
|
10
|
+
if Configuration.authorization_method.call(current_user)
|
11
|
+
render json: { message: "Authorized user" }, status: :ok
|
12
|
+
else
|
13
|
+
render json: { error: "Unauthorized user" }, status: :forbidden
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
data/lib/gamora/configuration.rb
CHANGED
@@ -20,7 +20,7 @@ module Gamora
|
|
20
20
|
mattr_accessor :allow_create, default: true
|
21
21
|
mattr_accessor :userinfo_cache_expires_in, default: 1.minute
|
22
22
|
mattr_accessor :introspect_cache_expires_in, default: 0.seconds
|
23
|
-
mattr_accessor :authorization_method, default: ->
|
23
|
+
mattr_accessor :authorization_method, default: ->(user) { user }
|
24
24
|
|
25
25
|
def setup
|
26
26
|
yield(self) if block_given?
|
data/lib/gamora/user.rb
CHANGED
data/lib/gamora/version.rb
CHANGED
@@ -22,5 +22,5 @@ Gamora.setup do |config|
|
|
22
22
|
# config.allow_create = true
|
23
23
|
# config.userinfo_cache_expires_in = 1.minute
|
24
24
|
# config.introspect_cache_expires_in = 0.seconds
|
25
|
-
# config.authorization_method = ->
|
25
|
+
# config.authorization_method = ->(user) { user.authorized? }
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gamora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alejandro Gutiérrez
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-04-03 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: oauth2
|
@@ -55,7 +54,6 @@ files:
|
|
55
54
|
- app/controllers/gamora/authorization_controller.rb
|
56
55
|
- app/controllers/gamora/callback_controller.rb
|
57
56
|
- app/controllers/gamora/unauthentication_controller.rb
|
58
|
-
- app/models/gamora/application_record.rb
|
59
57
|
- config/routes.rb
|
60
58
|
- lib/gamora.rb
|
61
59
|
- lib/gamora/authentication/base.rb
|
@@ -77,7 +75,6 @@ metadata:
|
|
77
75
|
source_code_uri: https://github.com/amco/gamora-rb
|
78
76
|
changelog_uri: https://github.com/amco/gamora-rb/blob/main/CHANGELOG.md
|
79
77
|
rubygems_mfa_required: 'true'
|
80
|
-
post_install_message:
|
81
78
|
rdoc_options: []
|
82
79
|
require_paths:
|
83
80
|
- lib
|
@@ -92,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
89
|
- !ruby/object:Gem::Version
|
93
90
|
version: '0'
|
94
91
|
requirements: []
|
95
|
-
rubygems_version: 3.
|
96
|
-
signing_key:
|
92
|
+
rubygems_version: 3.6.2
|
97
93
|
specification_version: 4
|
98
94
|
summary: OpenID Connect Relying Party for rails apps.
|
99
95
|
test_files: []
|