apiphobic-authorization 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/apiphobic/authorization/authorizer.rb +6 -4
- data/lib/apiphobic/authorization/authorizers/parameters.rb +6 -4
- data/lib/apiphobic/authorization/authorizers/scope.rb +8 -6
- data/lib/apiphobic/authorization/resource.rb +11 -11
- data/lib/apiphobic/authorization/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ea83f219faa3fde9a7f400699da72998120e0d566d02e3a110da2e503030f90
|
4
|
+
data.tar.gz: e25f16488e4565a6466d39436f3f2dc497e5fb8ccd2b0fe2dedb520c8a525238
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9535e821c18f7e8d81972db0cc8ac7d0e04bcb783aa3aa817e3b4ded028687318b60dd34df6d03b8195ff1d7e917cb01a90080a395fab168f3516da13d2ec1e1
|
7
|
+
data.tar.gz: 30377b4f59ce2cfa8b44ff0913efde6e3a4b0c10b2f40a51a5b388a541defc67d72df2506cdae2c90a29968c8d4691aaadd4386a313276a5d5cfe61c8ba37806
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -7,15 +7,15 @@ class Authorizer
|
|
7
7
|
:parameters,
|
8
8
|
:resource,
|
9
9
|
:token,
|
10
|
-
:
|
10
|
+
:audience
|
11
11
|
|
12
12
|
# rubocop:disable Metrics/ParameterLists
|
13
|
-
def initialize(action:, token:,
|
13
|
+
def initialize(action:, token:, audience:, issuer:, parameters:, resource:, **other)
|
14
14
|
self.action = action
|
15
|
-
self.
|
16
|
-
self.user = user
|
15
|
+
self.audience = audience
|
17
16
|
self.parameters = parameters
|
18
17
|
self.resource = resource
|
18
|
+
self.token = token
|
19
19
|
|
20
20
|
other.each do |name, value|
|
21
21
|
public_send("#{name}=", value)
|
@@ -23,6 +23,8 @@ class Authorizer
|
|
23
23
|
end
|
24
24
|
# rubocop:enable Metrics/ParameterLists
|
25
25
|
|
26
|
+
alias user audience
|
27
|
+
|
26
28
|
def able_to_index?
|
27
29
|
false
|
28
30
|
end
|
@@ -12,9 +12,9 @@ class Parameters
|
|
12
12
|
using ::AppleCore::Refinements::DeepDup
|
13
13
|
|
14
14
|
attr_accessor :action,
|
15
|
+
:audience,
|
15
16
|
:parameters,
|
16
|
-
:token
|
17
|
-
:user
|
17
|
+
:token
|
18
18
|
|
19
19
|
attr_writer :authorized_attributes,
|
20
20
|
:authorized_filters,
|
@@ -24,11 +24,11 @@ class Parameters
|
|
24
24
|
:ignored_attributes
|
25
25
|
|
26
26
|
# rubocop:disable Metrics/ParameterLists
|
27
|
-
def initialize(action:, token:,
|
27
|
+
def initialize(action:, token:, audience:, issuer:, parameters:, **other)
|
28
28
|
self.action = action
|
29
|
+
self.audience = audience
|
29
30
|
self.parameters = parameters.deep_dup
|
30
31
|
self.token = token
|
31
|
-
self.user = user
|
32
32
|
|
33
33
|
other.each do |name, value|
|
34
34
|
public_send("#{name}=", value)
|
@@ -36,6 +36,8 @@ class Parameters
|
|
36
36
|
end
|
37
37
|
# rubocop:enable Metrics/ParameterLists
|
38
38
|
|
39
|
+
alias user audience
|
40
|
+
|
39
41
|
def authorized_parameters
|
40
42
|
@authorized_parameters || [
|
41
43
|
:include,
|
@@ -9,18 +9,18 @@ class Scope
|
|
9
9
|
using ::AppleCore::Refinements::String
|
10
10
|
|
11
11
|
attr_accessor :action,
|
12
|
-
:
|
13
|
-
:user,
|
12
|
+
:audience,
|
14
13
|
:raw_parameters,
|
15
|
-
:scope_root
|
14
|
+
:scope_root,
|
15
|
+
:token
|
16
16
|
|
17
17
|
# rubocop:disable Metrics/ParameterLists
|
18
|
-
def initialize(action:, token:,
|
18
|
+
def initialize(action:, token:, audience:, issuer:, parameters:, scope_root:, **other)
|
19
19
|
self.action = action
|
20
|
-
self.
|
21
|
-
self.user = user
|
20
|
+
self.audience = audience
|
22
21
|
self.raw_parameters = parameters
|
23
22
|
self.scope_root = scope_root
|
23
|
+
self.token = token
|
24
24
|
|
25
25
|
other.each do |name, value|
|
26
26
|
public_send("#{name}=", value)
|
@@ -28,6 +28,8 @@ class Scope
|
|
28
28
|
end
|
29
29
|
# rubocop:enable Metrics/ParameterLists
|
30
30
|
|
31
|
+
alias user audience
|
32
|
+
|
31
33
|
def user_scope
|
32
34
|
scope_root.public_send("for_#{user_underscored_class_name}", scope_user_id)
|
33
35
|
end
|
@@ -68,10 +68,10 @@ module Resource
|
|
68
68
|
.class
|
69
69
|
.authorizer_parameters_class
|
70
70
|
.new(action: action_name,
|
71
|
-
|
72
|
-
user: authorized_user,
|
71
|
+
audience: authorized_audience,
|
73
72
|
issuer: authorized_issuer,
|
74
|
-
parameters: params
|
73
|
+
parameters: params,
|
74
|
+
token: token)
|
75
75
|
.call
|
76
76
|
end
|
77
77
|
|
@@ -84,11 +84,11 @@ module Resource
|
|
84
84
|
.class
|
85
85
|
.authorizer_scope_class
|
86
86
|
.new(action: action_name,
|
87
|
-
|
88
|
-
user: authorized_user,
|
87
|
+
audience: authorized_audience,
|
89
88
|
issuer: authorized_issuer,
|
90
89
|
parameters: authorized_parameters,
|
91
|
-
scope_root: self.class.authorized_scope_root_class
|
90
|
+
scope_root: self.class.authorized_scope_root_class,
|
91
|
+
token: token)
|
92
92
|
.call
|
93
93
|
end
|
94
94
|
|
@@ -103,11 +103,11 @@ module Resource
|
|
103
103
|
.class
|
104
104
|
.authorizer_class
|
105
105
|
.new(action: action_name,
|
106
|
-
|
107
|
-
user: authorized_user,
|
106
|
+
audience: authorized_audience,
|
108
107
|
issuer: authorized_issuer,
|
109
108
|
parameters: authorized_parameters,
|
110
|
-
resource: authorized_resource&.processed
|
109
|
+
resource: authorized_resource&.processed,
|
110
|
+
token: token)
|
111
111
|
end
|
112
112
|
|
113
113
|
def authorized_resource
|
@@ -129,8 +129,8 @@ module Resource
|
|
129
129
|
parameters: authorized_parameters)
|
130
130
|
end
|
131
131
|
|
132
|
-
def
|
133
|
-
|
132
|
+
def authorized_audience
|
133
|
+
current_audience
|
134
134
|
end
|
135
135
|
|
136
136
|
def authorized_issuer
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apiphobic-authorization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thegranddesign
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
Y2GAoHKstmfIVhc4XHOPpmTd2o/C29O9oaRgjrkfQEhF/KvJ/PhoV5hvokzsCyI5
|
32
32
|
iUeXPfvrGD/itYIBCgk+fnzyQQ4QtE5hTQaWQ3o2
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2018-07-
|
34
|
+
date: 2018-07-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: apiphobic-resource
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
��&:w��Fp�k�����3ݵ3��,��d8�3s�'�[��v��4��0���m��S�<���!�D�ԫ*��=T}�gAW+�&���9��se�4| Q�{�F�����:(����}lWho�;�$D�a�P����V��a��P4���̮͟�DE=��楩��5=���C&2����$��j��Jne��
|
2
|
+
4�3�'A�|���|G���[���Ĕ2e���(݂�p��o��jUC�<�+3ߔ���
|