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: 5e104c740e37e365b1a0026c7cc35c4484bfe4e3546f2ecc7f29cdc2d983b1c8
4
- data.tar.gz: 4e5386d4a3d3cb3541c9d1b6c67ac648ea33bd0d088aa77c6b598a612e155501
3
+ metadata.gz: d73a2356c80a3ae90435c16aaed089ceb8bab96a4c424fd66a819d7dbd9843c5
4
+ data.tar.gz: 950a900f569d1bd94c039bcbac19df6919ce83953122a71dcd3769dd26a9a848
5
5
  SHA512:
6
- metadata.gz: 3fe807fc7d017463448981f708a68f3e3a0ae6d61ae1985d794230af707cdf0d76e1da05f267afccbe564262273b520e70229548f9f06edafc7e2305573b3a6e
7
- data.tar.gz: 2827ef0787c8e7ccbf7462be3b921c7a82e699f35d91b48c34528db9526209ef34a9ca0aac32e180027ce6fb564cb65e9f37a3117916c787b5c99fa169d5e785
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(json: { message: "Authorized user" }, status: :ok) :
12
- render(json: { error: "Unauthorized user" }, status: :forbidden)
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
@@ -12,6 +12,7 @@ module Gamora
12
12
  family_name: :last_name,
13
13
  phone_number: :phone_number,
14
14
  email_verified: :email_verified,
15
+ associated_user_id: :associated_user_id,
15
16
  phone_number_verified: :phone_number_verified
16
17
  }.freeze
17
18
 
@@ -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: -> (user) { !!user }
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
@@ -12,6 +12,7 @@ module Gamora
12
12
  :first_name,
13
13
  :phone_number,
14
14
  :email_verified,
15
+ :associated_user_id,
15
16
  :phone_number_verified
16
17
  end
17
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gamora
4
- VERSION = "0.13.0"
4
+ VERSION = "0.14.0"
5
5
  end
@@ -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 = -> (user) { user.authorized? }
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.13.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-10-09 00:00:00.000000000 Z
11
+ date: 2024-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2