gamora 0.13.0 → 0.14.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d73a2356c80a3ae90435c16aaed089ceb8bab96a4c424fd66a819d7dbd9843c5
|
4
|
+
data.tar.gz: 950a900f569d1bd94c039bcbac19df6919ce83953122a71dcd3769dd26a9a848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95a2b078b3546d2a5ad193b45db7ab5c710847db8096ac7a813ddd1af644450fe5e30e443055af43c1860bf26526985eadab8d31500fbed943b9d8fc3fbaf7c9
|
7
|
+
data.tar.gz: d224336f131f0d1c0ff4ef68af57f460f2194288a3d61788d653abd994d20e43a43d9c03151c84400d2a2afcdfed00d954e346dba5488e877a4d3bde24a09ff6
|
@@ -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,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gamora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.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: 2024-
|
11
|
+
date: 2024-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth2
|