warrant 2.0.0.rc1 → 2.0.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 +4 -4
- data/lib/warrant/models/warrant.rb +18 -18
- data/lib/warrant/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1a31b7215d1f5c43c9324a9456bfeed330a0c6656e899f670be1a41a9a9ab0a0
|
|
4
|
+
data.tar.gz: a8b43559d231b5a54ab06ff22fdd37ce9123f0bc1442523d23cecf936da56aea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e931736321f72d8ed39331104a5a72a3ebc85680b21659edd6eefc0ade2cd93206bd32865ebb0df51020f3067fc93e6136866c407ebe14d52fd6758019cadd8
|
|
7
|
+
data.tar.gz: 8a273c5d903a66e3e5fc8a4d7bba657f2e3c6b9188f0ebe8cc25b27e2dda361e139eb62a9651ab0650026ba1b400c2bd3615346cffdfeda1e8352ec3123dd9e7
|
|
@@ -32,12 +32,12 @@ module Warrant
|
|
|
32
32
|
# @raise [Warrant::WarrantError]
|
|
33
33
|
def self.create(object, relation, subject, context = nil)
|
|
34
34
|
params = {
|
|
35
|
-
object_type: object.warrant_object_type,
|
|
36
|
-
object_id: object.warrant_object_id,
|
|
35
|
+
object_type: object.warrant_object_type.to_s,
|
|
36
|
+
object_id: object.warrant_object_id.to_s,
|
|
37
37
|
relation: relation,
|
|
38
38
|
subject: {
|
|
39
|
-
object_type: subject.warrant_object_type,
|
|
40
|
-
object_id: subject.warrant_object_id
|
|
39
|
+
object_type: subject.warrant_object_type.to_s,
|
|
40
|
+
object_id: subject.warrant_object_id.to_s
|
|
41
41
|
},
|
|
42
42
|
context: context
|
|
43
43
|
}
|
|
@@ -69,12 +69,12 @@ module Warrant
|
|
|
69
69
|
# @raise [Warrant::WarrantError]
|
|
70
70
|
def self.delete(object, relation, subject, context = nil)
|
|
71
71
|
params = {
|
|
72
|
-
object_type: object.warrant_object_type,
|
|
73
|
-
object_id: object.warrant_object_id,
|
|
72
|
+
object_type: object.warrant_object_type.to_s,
|
|
73
|
+
object_id: object.warrant_object_id.to_s,
|
|
74
74
|
relation: relation,
|
|
75
75
|
subject: {
|
|
76
|
-
object_type: subject.warrant_object_type,
|
|
77
|
-
object_id: subject.warrant_object_id
|
|
76
|
+
object_type: subject.warrant_object_type.to_s,
|
|
77
|
+
object_id: subject.warrant_object_id.to_s
|
|
78
78
|
},
|
|
79
79
|
context: context
|
|
80
80
|
}
|
|
@@ -193,16 +193,16 @@ module Warrant
|
|
|
193
193
|
}.compact!
|
|
194
194
|
else
|
|
195
195
|
subject = {
|
|
196
|
-
object_type: subject.warrant_object_type,
|
|
197
|
-
object_id: subject.warrant_object_id
|
|
196
|
+
object_type: subject.warrant_object_type.to_s,
|
|
197
|
+
object_id: subject.warrant_object_id.to_s
|
|
198
198
|
}
|
|
199
199
|
end
|
|
200
200
|
|
|
201
201
|
unless ::Warrant.config.authorize_endpoint.nil?
|
|
202
202
|
return edge_authorize?(
|
|
203
203
|
warrants: [{
|
|
204
|
-
object_type: object.warrant_object_type,
|
|
205
|
-
object_id: object.warrant_object_id,
|
|
204
|
+
object_type: object.warrant_object_type.to_s,
|
|
205
|
+
object_id: object.warrant_object_id.to_s,
|
|
206
206
|
relation: relation,
|
|
207
207
|
subject: subject,
|
|
208
208
|
context: options[:context]
|
|
@@ -214,8 +214,8 @@ module Warrant
|
|
|
214
214
|
|
|
215
215
|
return authorize?(
|
|
216
216
|
warrants: [{
|
|
217
|
-
object_type: object.warrant_object_type,
|
|
218
|
-
object_id: object.warrant_object_id,
|
|
217
|
+
object_type: object.warrant_object_type.to_s,
|
|
218
|
+
object_id: object.warrant_object_id.to_s,
|
|
219
219
|
relation: relation,
|
|
220
220
|
subject: subject,
|
|
221
221
|
context: options[:context]
|
|
@@ -264,14 +264,14 @@ module Warrant
|
|
|
264
264
|
}.compact!
|
|
265
265
|
else
|
|
266
266
|
subject = {
|
|
267
|
-
object_type: warrant[:subject].warrant_object_type,
|
|
268
|
-
object_id: warrant[:subject].warrant_object_id
|
|
267
|
+
object_type: warrant[:subject].warrant_object_type.to_s,
|
|
268
|
+
object_id: warrant[:subject].warrant_object_id.to_s
|
|
269
269
|
}
|
|
270
270
|
end
|
|
271
271
|
|
|
272
272
|
{
|
|
273
|
-
object_type: warrant[:object].warrant_object_type,
|
|
274
|
-
object_id: warrant[:object].warrant_object_id,
|
|
273
|
+
object_type: warrant[:object].warrant_object_type.to_s,
|
|
274
|
+
object_id: warrant[:object].warrant_object_id.to_s,
|
|
275
275
|
relation: warrant[:relation],
|
|
276
276
|
subject: subject,
|
|
277
277
|
context: warrant[:context]
|
data/lib/warrant/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: warrant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.0
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Warrant
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-12-
|
|
11
|
+
date: 2022-12-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Ruby library for the Warrant API at https://warrant.dev.
|
|
14
14
|
email: hello@warrant.dev
|
|
@@ -49,7 +49,7 @@ metadata:
|
|
|
49
49
|
source_code_uri: https://github.com/warrant-dev/warrant-ruby
|
|
50
50
|
changelog_uri: https://github.com/warrant-dev/warrant-ruby/CHANGELOG.md
|
|
51
51
|
documentation_uri: https://docs.warrant.dev/
|
|
52
|
-
post_install_message:
|
|
52
|
+
post_install_message:
|
|
53
53
|
rdoc_options: []
|
|
54
54
|
require_paths:
|
|
55
55
|
- lib
|
|
@@ -60,12 +60,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
60
60
|
version: 2.3.0
|
|
61
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
62
|
requirements:
|
|
63
|
-
- - "
|
|
63
|
+
- - ">="
|
|
64
64
|
- !ruby/object:Gem::Version
|
|
65
|
-
version:
|
|
65
|
+
version: '0'
|
|
66
66
|
requirements: []
|
|
67
|
-
rubygems_version: 3.
|
|
68
|
-
signing_key:
|
|
67
|
+
rubygems_version: 3.2.33
|
|
68
|
+
signing_key:
|
|
69
69
|
specification_version: 4
|
|
70
70
|
summary: Warrant Ruby Library
|
|
71
71
|
test_files: []
|