cedar_policy 0.6.2 → 0.7.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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +12 -0
- data/Cargo.lock +127 -115
- data/README.md +3 -3
- data/ext/cedar_policy/Cargo.toml +5 -4
- data/ext/cedar_policy/src/context.rs +1 -1
- data/ext/cedar_policy/src/diagnostics.rs +3 -6
- data/ext/cedar_policy/src/entities.rs +1 -1
- data/ext/cedar_policy/src/entity_uid.rs +5 -3
- data/ext/cedar_policy/src/policy_set.rs +12 -0
- data/lib/cedar_policy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9cb07aef4cdd19e45459e0121edd1d1fedd37697f6baabce5883cbfbbd2691b
|
|
4
|
+
data.tar.gz: c51c0cc1c141b942f746d00d8e4c52dbe46ecab90e04fcdb2e7f8f2b18a7ba4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d61d6e405a5f0756e5c2f8576a7e005a90386629e83aec87bbc8e6c75447b7ae6bb5f4b9e145d138cc25ca32b2b36cec2807eada8358747e3ad456e2a0540b7
|
|
7
|
+
data.tar.gz: 3defda60852e5be9d88ce198c854b1f8793f7ff161ec9304701f745a26bd1d2f8c36ec30aa1763c989c398ae9524c3c49e88155d7e48f8c86a0a36dc3508d0b1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{".":"0.
|
|
1
|
+
{".":"0.7.0"}
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.0](https://github.com/elct9620/cedar-policy-rb/compare/v0.6.2...v0.7.0) (2026-02-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add policy_ids method to PolicySet ([3812daf](https://github.com/elct9620/cedar-policy-rb/commit/3812dafce10a6574c07316ec73e2e45c15fdcd9f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** enable stable-api-compiled-fallback for Ruby 4.0 support ([c3603ec](https://github.com/elct9620/cedar-policy-rb/commit/c3603ec67e0aa25cba9f57a08c2906a1bb43ccce))
|
|
14
|
+
|
|
3
15
|
## [0.6.2](https://github.com/elct9620/cedar-policy-rb/compare/v0.6.1...v0.6.2) (2025-08-26)
|
|
4
16
|
|
|
5
17
|
|
data/Cargo.lock
CHANGED
|
@@ -11,12 +11,6 @@ dependencies = [
|
|
|
11
11
|
"memchr",
|
|
12
12
|
]
|
|
13
13
|
|
|
14
|
-
[[package]]
|
|
15
|
-
name = "android-tzdata"
|
|
16
|
-
version = "0.1.1"
|
|
17
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
-
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
|
|
19
|
-
|
|
20
14
|
[[package]]
|
|
21
15
|
name = "android_system_properties"
|
|
22
16
|
version = "0.1.5"
|
|
@@ -53,12 +47,6 @@ version = "0.22.1"
|
|
|
53
47
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
54
48
|
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
|
55
49
|
|
|
56
|
-
[[package]]
|
|
57
|
-
name = "beef"
|
|
58
|
-
version = "0.5.2"
|
|
59
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
60
|
-
checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1"
|
|
61
|
-
|
|
62
50
|
[[package]]
|
|
63
51
|
name = "bindgen"
|
|
64
52
|
version = "0.69.5"
|
|
@@ -135,17 +123,15 @@ dependencies = [
|
|
|
135
123
|
|
|
136
124
|
[[package]]
|
|
137
125
|
name = "cedar-policy"
|
|
138
|
-
version = "4.
|
|
126
|
+
version = "4.9.0"
|
|
139
127
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
140
|
-
checksum = "
|
|
128
|
+
checksum = "c55625387d203085efb7dca8eb594188d586c99f97a83cf577d60bc588b1c705"
|
|
141
129
|
dependencies = [
|
|
142
130
|
"cedar-policy-core",
|
|
143
131
|
"cedar-policy-formatter",
|
|
144
132
|
"itertools 0.14.0",
|
|
145
|
-
"
|
|
146
|
-
"lazy_static",
|
|
133
|
+
"linked-hash-map",
|
|
147
134
|
"miette",
|
|
148
|
-
"nonempty",
|
|
149
135
|
"ref-cast",
|
|
150
136
|
"semver",
|
|
151
137
|
"serde",
|
|
@@ -157,9 +143,9 @@ dependencies = [
|
|
|
157
143
|
|
|
158
144
|
[[package]]
|
|
159
145
|
name = "cedar-policy-core"
|
|
160
|
-
version = "4.
|
|
146
|
+
version = "4.9.0"
|
|
161
147
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
162
|
-
checksum = "
|
|
148
|
+
checksum = "c2ac16501266418b913a4ee73d1d14542d479c73baf7fccea2542996a2a82fe2"
|
|
163
149
|
dependencies = [
|
|
164
150
|
"chrono",
|
|
165
151
|
"educe",
|
|
@@ -167,12 +153,13 @@ dependencies = [
|
|
|
167
153
|
"itertools 0.14.0",
|
|
168
154
|
"lalrpop",
|
|
169
155
|
"lalrpop-util",
|
|
170
|
-
"
|
|
156
|
+
"linked-hash-map",
|
|
157
|
+
"linked_hash_set",
|
|
171
158
|
"miette",
|
|
172
159
|
"nonempty",
|
|
173
160
|
"ref-cast",
|
|
174
161
|
"regex",
|
|
175
|
-
"
|
|
162
|
+
"rustc-literal-escaper",
|
|
176
163
|
"serde",
|
|
177
164
|
"serde_json",
|
|
178
165
|
"serde_with",
|
|
@@ -184,13 +171,12 @@ dependencies = [
|
|
|
184
171
|
|
|
185
172
|
[[package]]
|
|
186
173
|
name = "cedar-policy-formatter"
|
|
187
|
-
version = "4.
|
|
174
|
+
version = "4.9.0"
|
|
188
175
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
189
|
-
checksum = "
|
|
176
|
+
checksum = "99f4b40c3d8a88264578fd9ef17b43ef35ec36e1283ae22930542dff8a6b80ae"
|
|
190
177
|
dependencies = [
|
|
191
178
|
"cedar-policy-core",
|
|
192
179
|
"itertools 0.14.0",
|
|
193
|
-
"lazy_static",
|
|
194
180
|
"logos",
|
|
195
181
|
"miette",
|
|
196
182
|
"pretty",
|
|
@@ -200,10 +186,11 @@ dependencies = [
|
|
|
200
186
|
|
|
201
187
|
[[package]]
|
|
202
188
|
name = "cedar_policy"
|
|
203
|
-
version = "0.
|
|
189
|
+
version = "0.7.0"
|
|
204
190
|
dependencies = [
|
|
205
191
|
"cedar-policy",
|
|
206
192
|
"magnus",
|
|
193
|
+
"rb-sys",
|
|
207
194
|
"serde_magnus",
|
|
208
195
|
]
|
|
209
196
|
|
|
@@ -230,15 +217,14 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
|
|
|
230
217
|
|
|
231
218
|
[[package]]
|
|
232
219
|
name = "chrono"
|
|
233
|
-
version = "0.4.
|
|
220
|
+
version = "0.4.43"
|
|
234
221
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
235
|
-
checksum = "
|
|
222
|
+
checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118"
|
|
236
223
|
dependencies = [
|
|
237
|
-
"android-tzdata",
|
|
238
224
|
"iana-time-zone",
|
|
239
225
|
"num-traits",
|
|
240
226
|
"serde",
|
|
241
|
-
"windows-link",
|
|
227
|
+
"windows-link 0.2.1",
|
|
242
228
|
]
|
|
243
229
|
|
|
244
230
|
[[package]]
|
|
@@ -279,9 +265,9 @@ dependencies = [
|
|
|
279
265
|
|
|
280
266
|
[[package]]
|
|
281
267
|
name = "darling"
|
|
282
|
-
version = "0.
|
|
268
|
+
version = "0.21.3"
|
|
283
269
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
284
|
-
checksum = "
|
|
270
|
+
checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0"
|
|
285
271
|
dependencies = [
|
|
286
272
|
"darling_core",
|
|
287
273
|
"darling_macro",
|
|
@@ -289,9 +275,9 @@ dependencies = [
|
|
|
289
275
|
|
|
290
276
|
[[package]]
|
|
291
277
|
name = "darling_core"
|
|
292
|
-
version = "0.
|
|
278
|
+
version = "0.21.3"
|
|
293
279
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
294
|
-
checksum = "
|
|
280
|
+
checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4"
|
|
295
281
|
dependencies = [
|
|
296
282
|
"fnv",
|
|
297
283
|
"ident_case",
|
|
@@ -303,9 +289,9 @@ dependencies = [
|
|
|
303
289
|
|
|
304
290
|
[[package]]
|
|
305
291
|
name = "darling_macro"
|
|
306
|
-
version = "0.
|
|
292
|
+
version = "0.21.3"
|
|
307
293
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
308
|
-
checksum = "
|
|
294
|
+
checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81"
|
|
309
295
|
dependencies = [
|
|
310
296
|
"darling_core",
|
|
311
297
|
"quote",
|
|
@@ -314,12 +300,12 @@ dependencies = [
|
|
|
314
300
|
|
|
315
301
|
[[package]]
|
|
316
302
|
name = "deranged"
|
|
317
|
-
version = "0.
|
|
303
|
+
version = "0.5.5"
|
|
318
304
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
319
|
-
checksum = "
|
|
305
|
+
checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587"
|
|
320
306
|
dependencies = [
|
|
321
307
|
"powerfmt",
|
|
322
|
-
"
|
|
308
|
+
"serde_core",
|
|
323
309
|
]
|
|
324
310
|
|
|
325
311
|
[[package]]
|
|
@@ -525,9 +511,9 @@ dependencies = [
|
|
|
525
511
|
|
|
526
512
|
[[package]]
|
|
527
513
|
name = "keccak"
|
|
528
|
-
version = "0.1.
|
|
514
|
+
version = "0.1.6"
|
|
529
515
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
530
|
-
checksum = "
|
|
516
|
+
checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653"
|
|
531
517
|
dependencies = [
|
|
532
518
|
"cpufeatures",
|
|
533
519
|
]
|
|
@@ -592,6 +578,24 @@ dependencies = [
|
|
|
592
578
|
"windows-targets 0.53.3",
|
|
593
579
|
]
|
|
594
580
|
|
|
581
|
+
[[package]]
|
|
582
|
+
name = "linked-hash-map"
|
|
583
|
+
version = "0.5.6"
|
|
584
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
585
|
+
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
|
|
586
|
+
dependencies = [
|
|
587
|
+
"serde",
|
|
588
|
+
]
|
|
589
|
+
|
|
590
|
+
[[package]]
|
|
591
|
+
name = "linked_hash_set"
|
|
592
|
+
version = "0.1.6"
|
|
593
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
594
|
+
checksum = "984fb35d06508d1e69fc91050cceba9c0b748f983e6739fa2c7a9237154c52c8"
|
|
595
|
+
dependencies = [
|
|
596
|
+
"linked-hash-map",
|
|
597
|
+
]
|
|
598
|
+
|
|
595
599
|
[[package]]
|
|
596
600
|
name = "lock_api"
|
|
597
601
|
version = "0.4.13"
|
|
@@ -610,43 +614,41 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
|
|
610
614
|
|
|
611
615
|
[[package]]
|
|
612
616
|
name = "logos"
|
|
613
|
-
version = "0.
|
|
617
|
+
version = "0.16.1"
|
|
614
618
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
615
|
-
checksum = "
|
|
619
|
+
checksum = "eb2c55a318a87600ea870ff8c2012148b44bf18b74fad48d0f835c38c7d07c5f"
|
|
616
620
|
dependencies = [
|
|
617
621
|
"logos-derive",
|
|
618
622
|
]
|
|
619
623
|
|
|
620
624
|
[[package]]
|
|
621
625
|
name = "logos-codegen"
|
|
622
|
-
version = "0.
|
|
626
|
+
version = "0.16.1"
|
|
623
627
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
624
|
-
checksum = "
|
|
628
|
+
checksum = "58b3ffaa284e1350d017a57d04ada118c4583cf260c8fb01e0fe28a2e9cf8970"
|
|
625
629
|
dependencies = [
|
|
626
|
-
"beef",
|
|
627
630
|
"fnv",
|
|
628
|
-
"lazy_static",
|
|
629
631
|
"proc-macro2",
|
|
630
632
|
"quote",
|
|
633
|
+
"regex-automata",
|
|
631
634
|
"regex-syntax",
|
|
632
|
-
"rustc_version",
|
|
633
635
|
"syn",
|
|
634
636
|
]
|
|
635
637
|
|
|
636
638
|
[[package]]
|
|
637
639
|
name = "logos-derive"
|
|
638
|
-
version = "0.
|
|
640
|
+
version = "0.16.1"
|
|
639
641
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
640
|
-
checksum = "
|
|
642
|
+
checksum = "52d3a9855747c17eaf4383823f135220716ab49bea5fbea7dd42cc9a92f8aa31"
|
|
641
643
|
dependencies = [
|
|
642
644
|
"logos-codegen",
|
|
643
645
|
]
|
|
644
646
|
|
|
645
647
|
[[package]]
|
|
646
648
|
name = "magnus"
|
|
647
|
-
version = "0.
|
|
649
|
+
version = "0.8.2"
|
|
648
650
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
649
|
-
checksum = "
|
|
651
|
+
checksum = "3b36a5b126bbe97eb0d02d07acfeb327036c6319fd816139a49824a83b7f9012"
|
|
650
652
|
dependencies = [
|
|
651
653
|
"magnus-macros",
|
|
652
654
|
"rb-sys",
|
|
@@ -656,9 +658,9 @@ dependencies = [
|
|
|
656
658
|
|
|
657
659
|
[[package]]
|
|
658
660
|
name = "magnus-macros"
|
|
659
|
-
version = "0.
|
|
661
|
+
version = "0.8.0"
|
|
660
662
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
661
|
-
checksum = "
|
|
663
|
+
checksum = "47607461fd8e1513cb4f2076c197d8092d921a1ea75bd08af97398f593751892"
|
|
662
664
|
dependencies = [
|
|
663
665
|
"proc-macro2",
|
|
664
666
|
"quote",
|
|
@@ -680,7 +682,7 @@ dependencies = [
|
|
|
680
682
|
"cfg-if",
|
|
681
683
|
"miette-derive",
|
|
682
684
|
"serde",
|
|
683
|
-
"unicode-width",
|
|
685
|
+
"unicode-width 0.1.14",
|
|
684
686
|
]
|
|
685
687
|
|
|
686
688
|
[[package]]
|
|
@@ -718,18 +720,18 @@ dependencies = [
|
|
|
718
720
|
|
|
719
721
|
[[package]]
|
|
720
722
|
name = "nonempty"
|
|
721
|
-
version = "0.
|
|
723
|
+
version = "0.12.0"
|
|
722
724
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
723
|
-
checksum = "
|
|
725
|
+
checksum = "9737e026353e5cd0736f98eddae28665118eb6f6600902a7f50db585621fecb6"
|
|
724
726
|
dependencies = [
|
|
725
727
|
"serde",
|
|
726
728
|
]
|
|
727
729
|
|
|
728
730
|
[[package]]
|
|
729
731
|
name = "num-conv"
|
|
730
|
-
version = "0.
|
|
732
|
+
version = "0.2.0"
|
|
731
733
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
732
|
-
checksum = "
|
|
734
|
+
checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"
|
|
733
735
|
|
|
734
736
|
[[package]]
|
|
735
737
|
name = "num-traits"
|
|
@@ -808,13 +810,13 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
|
|
|
808
810
|
|
|
809
811
|
[[package]]
|
|
810
812
|
name = "pretty"
|
|
811
|
-
version = "0.12.
|
|
813
|
+
version = "0.12.5"
|
|
812
814
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
813
|
-
checksum = "
|
|
815
|
+
checksum = "0d22152487193190344590e4f30e219cf3fe140d9e7a3fdb683d82aa2c5f4156"
|
|
814
816
|
dependencies = [
|
|
815
817
|
"arrayvec",
|
|
816
818
|
"typed-arena",
|
|
817
|
-
"unicode-width",
|
|
819
|
+
"unicode-width 0.2.2",
|
|
818
820
|
]
|
|
819
821
|
|
|
820
822
|
[[package]]
|
|
@@ -846,18 +848,18 @@ dependencies = [
|
|
|
846
848
|
|
|
847
849
|
[[package]]
|
|
848
850
|
name = "rb-sys"
|
|
849
|
-
version = "0.9.
|
|
851
|
+
version = "0.9.124"
|
|
850
852
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
851
|
-
checksum = "
|
|
853
|
+
checksum = "c85c4188462601e2aa1469def389c17228566f82ea72f137ed096f21591bc489"
|
|
852
854
|
dependencies = [
|
|
853
855
|
"rb-sys-build",
|
|
854
856
|
]
|
|
855
857
|
|
|
856
858
|
[[package]]
|
|
857
859
|
name = "rb-sys-build"
|
|
858
|
-
version = "0.9.
|
|
860
|
+
version = "0.9.124"
|
|
859
861
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
860
|
-
checksum = "
|
|
862
|
+
checksum = "568068db4102230882e6d4ae8de6632e224ca75fe5970f6e026a04e91ed635d3"
|
|
861
863
|
dependencies = [
|
|
862
864
|
"bindgen",
|
|
863
865
|
"lazy_static",
|
|
@@ -870,9 +872,9 @@ dependencies = [
|
|
|
870
872
|
|
|
871
873
|
[[package]]
|
|
872
874
|
name = "rb-sys-env"
|
|
873
|
-
version = "0.
|
|
875
|
+
version = "0.2.2"
|
|
874
876
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
875
|
-
checksum = "
|
|
877
|
+
checksum = "08f8d2924cf136a1315e2b4c7460a39f62ef11ee5d522df9b2750fab55b868b6"
|
|
876
878
|
|
|
877
879
|
[[package]]
|
|
878
880
|
name = "redox_syscall"
|
|
@@ -905,9 +907,9 @@ dependencies = [
|
|
|
905
907
|
|
|
906
908
|
[[package]]
|
|
907
909
|
name = "regex"
|
|
908
|
-
version = "1.
|
|
910
|
+
version = "1.12.2"
|
|
909
911
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
910
|
-
checksum = "
|
|
912
|
+
checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
|
|
911
913
|
dependencies = [
|
|
912
914
|
"aho-corasick",
|
|
913
915
|
"memchr",
|
|
@@ -917,9 +919,9 @@ dependencies = [
|
|
|
917
919
|
|
|
918
920
|
[[package]]
|
|
919
921
|
name = "regex-automata"
|
|
920
|
-
version = "0.4.
|
|
922
|
+
version = "0.4.13"
|
|
921
923
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
922
|
-
checksum = "
|
|
924
|
+
checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
|
|
923
925
|
dependencies = [
|
|
924
926
|
"aho-corasick",
|
|
925
927
|
"memchr",
|
|
@@ -939,22 +941,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
939
941
|
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
|
940
942
|
|
|
941
943
|
[[package]]
|
|
942
|
-
name = "
|
|
943
|
-
version = "0.
|
|
944
|
+
name = "rustc-literal-escaper"
|
|
945
|
+
version = "0.0.7"
|
|
944
946
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
945
|
-
checksum = "
|
|
946
|
-
dependencies = [
|
|
947
|
-
"unicode-xid",
|
|
948
|
-
]
|
|
949
|
-
|
|
950
|
-
[[package]]
|
|
951
|
-
name = "rustc_version"
|
|
952
|
-
version = "0.4.1"
|
|
953
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
954
|
-
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
|
|
955
|
-
dependencies = [
|
|
956
|
-
"semver",
|
|
957
|
-
]
|
|
947
|
+
checksum = "8be87abb9e40db7466e0681dc8ecd9dcfd40360cb10b4c8fe24a7c4c3669b198"
|
|
958
948
|
|
|
959
949
|
[[package]]
|
|
960
950
|
name = "rustversion"
|
|
@@ -1009,9 +999,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
1009
999
|
|
|
1010
1000
|
[[package]]
|
|
1011
1001
|
name = "semver"
|
|
1012
|
-
version = "1.0.
|
|
1002
|
+
version = "1.0.27"
|
|
1013
1003
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1014
|
-
checksum = "
|
|
1004
|
+
checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
|
|
1015
1005
|
|
|
1016
1006
|
[[package]]
|
|
1017
1007
|
name = "seq-macro"
|
|
@@ -1021,18 +1011,28 @@ checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc"
|
|
|
1021
1011
|
|
|
1022
1012
|
[[package]]
|
|
1023
1013
|
name = "serde"
|
|
1024
|
-
version = "1.0.
|
|
1014
|
+
version = "1.0.228"
|
|
1025
1015
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1026
|
-
checksum = "
|
|
1016
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
1017
|
+
dependencies = [
|
|
1018
|
+
"serde_core",
|
|
1019
|
+
"serde_derive",
|
|
1020
|
+
]
|
|
1021
|
+
|
|
1022
|
+
[[package]]
|
|
1023
|
+
name = "serde_core"
|
|
1024
|
+
version = "1.0.228"
|
|
1025
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1026
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
1027
1027
|
dependencies = [
|
|
1028
1028
|
"serde_derive",
|
|
1029
1029
|
]
|
|
1030
1030
|
|
|
1031
1031
|
[[package]]
|
|
1032
1032
|
name = "serde_derive"
|
|
1033
|
-
version = "1.0.
|
|
1033
|
+
version = "1.0.228"
|
|
1034
1034
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1035
|
-
checksum = "
|
|
1035
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
1036
1036
|
dependencies = [
|
|
1037
1037
|
"proc-macro2",
|
|
1038
1038
|
"quote",
|
|
@@ -1041,22 +1041,23 @@ dependencies = [
|
|
|
1041
1041
|
|
|
1042
1042
|
[[package]]
|
|
1043
1043
|
name = "serde_json"
|
|
1044
|
-
version = "1.0.
|
|
1044
|
+
version = "1.0.145"
|
|
1045
1045
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1046
|
-
checksum = "
|
|
1046
|
+
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
|
|
1047
1047
|
dependencies = [
|
|
1048
1048
|
"indexmap 2.11.0",
|
|
1049
1049
|
"itoa",
|
|
1050
1050
|
"memchr",
|
|
1051
1051
|
"ryu",
|
|
1052
1052
|
"serde",
|
|
1053
|
+
"serde_core",
|
|
1053
1054
|
]
|
|
1054
1055
|
|
|
1055
1056
|
[[package]]
|
|
1056
1057
|
name = "serde_magnus"
|
|
1057
|
-
version = "0.
|
|
1058
|
+
version = "0.11.0"
|
|
1058
1059
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1059
|
-
checksum = "
|
|
1060
|
+
checksum = "8ff64c88ddd26acdcad5a501f18bcc339927b77b69f4a03bfaf2a6fc5ba2ac4b"
|
|
1060
1061
|
dependencies = [
|
|
1061
1062
|
"magnus",
|
|
1062
1063
|
"serde",
|
|
@@ -1065,9 +1066,9 @@ dependencies = [
|
|
|
1065
1066
|
|
|
1066
1067
|
[[package]]
|
|
1067
1068
|
name = "serde_with"
|
|
1068
|
-
version = "3.
|
|
1069
|
+
version = "3.16.1"
|
|
1069
1070
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1070
|
-
checksum = "
|
|
1071
|
+
checksum = "4fa237f2807440d238e0364a218270b98f767a00d3dada77b1c53ae88940e2e7"
|
|
1071
1072
|
dependencies = [
|
|
1072
1073
|
"base64",
|
|
1073
1074
|
"chrono",
|
|
@@ -1076,8 +1077,7 @@ dependencies = [
|
|
|
1076
1077
|
"indexmap 2.11.0",
|
|
1077
1078
|
"schemars 0.9.0",
|
|
1078
1079
|
"schemars 1.0.4",
|
|
1079
|
-
"
|
|
1080
|
-
"serde_derive",
|
|
1080
|
+
"serde_core",
|
|
1081
1081
|
"serde_json",
|
|
1082
1082
|
"serde_with_macros",
|
|
1083
1083
|
"time",
|
|
@@ -1085,9 +1085,9 @@ dependencies = [
|
|
|
1085
1085
|
|
|
1086
1086
|
[[package]]
|
|
1087
1087
|
name = "serde_with_macros"
|
|
1088
|
-
version = "3.
|
|
1088
|
+
version = "3.16.1"
|
|
1089
1089
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1090
|
-
checksum = "
|
|
1090
|
+
checksum = "52a8e3ca0ca629121f70ab50f95249e5a6f925cc0f6ffe8256c45b728875706c"
|
|
1091
1091
|
dependencies = [
|
|
1092
1092
|
"darling",
|
|
1093
1093
|
"proc-macro2",
|
|
@@ -1141,9 +1141,9 @@ dependencies = [
|
|
|
1141
1141
|
|
|
1142
1142
|
[[package]]
|
|
1143
1143
|
name = "stacker"
|
|
1144
|
-
version = "0.1.
|
|
1144
|
+
version = "0.1.22"
|
|
1145
1145
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1146
|
-
checksum = "
|
|
1146
|
+
checksum = "e1f8b29fb42aafcea4edeeb6b2f2d7ecd0d969c48b4cf0d2e64aafc471dd6e59"
|
|
1147
1147
|
dependencies = [
|
|
1148
1148
|
"cc",
|
|
1149
1149
|
"cfg-if",
|
|
@@ -1218,30 +1218,30 @@ dependencies = [
|
|
|
1218
1218
|
|
|
1219
1219
|
[[package]]
|
|
1220
1220
|
name = "time"
|
|
1221
|
-
version = "0.3.
|
|
1221
|
+
version = "0.3.47"
|
|
1222
1222
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1223
|
-
checksum = "
|
|
1223
|
+
checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c"
|
|
1224
1224
|
dependencies = [
|
|
1225
1225
|
"deranged",
|
|
1226
1226
|
"itoa",
|
|
1227
1227
|
"num-conv",
|
|
1228
1228
|
"powerfmt",
|
|
1229
|
-
"
|
|
1229
|
+
"serde_core",
|
|
1230
1230
|
"time-core",
|
|
1231
1231
|
"time-macros",
|
|
1232
1232
|
]
|
|
1233
1233
|
|
|
1234
1234
|
[[package]]
|
|
1235
1235
|
name = "time-core"
|
|
1236
|
-
version = "0.1.
|
|
1236
|
+
version = "0.1.8"
|
|
1237
1237
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1238
|
-
checksum = "
|
|
1238
|
+
checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"
|
|
1239
1239
|
|
|
1240
1240
|
[[package]]
|
|
1241
1241
|
name = "time-macros"
|
|
1242
|
-
version = "0.2.
|
|
1242
|
+
version = "0.2.27"
|
|
1243
1243
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1244
|
-
checksum = "
|
|
1244
|
+
checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215"
|
|
1245
1245
|
dependencies = [
|
|
1246
1246
|
"num-conv",
|
|
1247
1247
|
"time-core",
|
|
@@ -1311,6 +1311,12 @@ version = "0.1.14"
|
|
|
1311
1311
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1312
1312
|
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
|
|
1313
1313
|
|
|
1314
|
+
[[package]]
|
|
1315
|
+
name = "unicode-width"
|
|
1316
|
+
version = "0.2.2"
|
|
1317
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1318
|
+
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
|
|
1319
|
+
|
|
1314
1320
|
[[package]]
|
|
1315
1321
|
name = "unicode-xid"
|
|
1316
1322
|
version = "0.2.6"
|
|
@@ -1408,7 +1414,7 @@ checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
|
|
|
1408
1414
|
dependencies = [
|
|
1409
1415
|
"windows-implement",
|
|
1410
1416
|
"windows-interface",
|
|
1411
|
-
"windows-link",
|
|
1417
|
+
"windows-link 0.1.3",
|
|
1412
1418
|
"windows-result",
|
|
1413
1419
|
"windows-strings",
|
|
1414
1420
|
]
|
|
@@ -1441,13 +1447,19 @@ version = "0.1.3"
|
|
|
1441
1447
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1442
1448
|
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
|
|
1443
1449
|
|
|
1450
|
+
[[package]]
|
|
1451
|
+
name = "windows-link"
|
|
1452
|
+
version = "0.2.1"
|
|
1453
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1454
|
+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
|
1455
|
+
|
|
1444
1456
|
[[package]]
|
|
1445
1457
|
name = "windows-result"
|
|
1446
1458
|
version = "0.3.4"
|
|
1447
1459
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1448
1460
|
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
|
|
1449
1461
|
dependencies = [
|
|
1450
|
-
"windows-link",
|
|
1462
|
+
"windows-link 0.1.3",
|
|
1451
1463
|
]
|
|
1452
1464
|
|
|
1453
1465
|
[[package]]
|
|
@@ -1456,7 +1468,7 @@ version = "0.4.2"
|
|
|
1456
1468
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1457
1469
|
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
|
|
1458
1470
|
dependencies = [
|
|
1459
|
-
"windows-link",
|
|
1471
|
+
"windows-link 0.1.3",
|
|
1460
1472
|
]
|
|
1461
1473
|
|
|
1462
1474
|
[[package]]
|
|
@@ -1499,7 +1511,7 @@ version = "0.53.3"
|
|
|
1499
1511
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1500
1512
|
checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
|
|
1501
1513
|
dependencies = [
|
|
1502
|
-
"windows-link",
|
|
1514
|
+
"windows-link 0.1.3",
|
|
1503
1515
|
"windows_aarch64_gnullvm 0.53.0",
|
|
1504
1516
|
"windows_aarch64_msvc 0.53.0",
|
|
1505
1517
|
"windows_i686_gnu 0.53.0",
|
data/README.md
CHANGED
|
@@ -40,7 +40,7 @@ policy_set = CedarPolicy::PolicySet.new(policy)
|
|
|
40
40
|
Prepare the Entity's ID via `EntityUid` or an object with `#to_hash` method which returns a hash with `:type` and `:id` keys.
|
|
41
41
|
|
|
42
42
|
```ruby
|
|
43
|
-
principal = CedarPolicy::EntityUid.new("
|
|
43
|
+
principal = CedarPolicy::EntityUid.new("AdminUser", "1") # or { type: "AdminUser", id: "1" }
|
|
44
44
|
action = CedarPolicy::EntityUid.new("Action", "view")
|
|
45
45
|
resource = CedarPolicy::EntityUid.new("Image", "1")
|
|
46
46
|
```
|
|
@@ -85,10 +85,10 @@ Create an `Authorizer` object and authorize the request with the policy set and
|
|
|
85
85
|
authorizer = CedarPolicy::Authorizer.new
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
If boolean result is enough, use `#
|
|
88
|
+
If boolean result is enough, use `#authorized?` method.
|
|
89
89
|
|
|
90
90
|
```ruby
|
|
91
|
-
authorizer.
|
|
91
|
+
authorizer.authorized?(request, policy_set, entities) # => true
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
If you want to get the decision object, use `#authorize` method.
|
data/ext/cedar_policy/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "cedar_policy"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.7.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
authors = ["Aotokitsuruya <contact@aotoki.me>"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -10,6 +10,7 @@ publish = false
|
|
|
10
10
|
crate-type = ["cdylib"]
|
|
11
11
|
|
|
12
12
|
[dependencies]
|
|
13
|
-
cedar-policy = "4.
|
|
14
|
-
magnus = "0.
|
|
15
|
-
|
|
13
|
+
cedar-policy = "4.9.0"
|
|
14
|
+
magnus = "0.8.2"
|
|
15
|
+
rb-sys = { version = ">=0.9.113", features = ["stable-api-compiled-fallback"] }
|
|
16
|
+
serde_magnus = "0.11.0"
|
|
@@ -28,7 +28,7 @@ impl TryConvert for ContextWrapper {
|
|
|
28
28
|
match value.respond_to("to_hash", false) {
|
|
29
29
|
Ok(true) => {
|
|
30
30
|
let value: Value = value.funcall_public("to_hash", ())?;
|
|
31
|
-
let value: JsonValueWithNoDuplicateKeys = deserialize(value)?;
|
|
31
|
+
let value: JsonValueWithNoDuplicateKeys = deserialize(&handle, value)?;
|
|
32
32
|
Ok(Self(Context::from_json_value(value.into(), None).map_err(
|
|
33
33
|
|e| Error::new(handle.exception_runtime_error(), e.to_string()),
|
|
34
34
|
)?))
|
|
@@ -12,12 +12,9 @@ impl RDiagnostics {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
fn errors(&self) -> RArray {
|
|
15
|
-
let
|
|
16
|
-
.
|
|
17
|
-
|
|
18
|
-
.map(|e| RAuthorizationError::from(e.clone()));
|
|
19
|
-
|
|
20
|
-
RArray::from_iter(errors)
|
|
15
|
+
let ruby = Ruby::get()
|
|
16
|
+
.expect("errors() can only be called from a Ruby thread");
|
|
17
|
+
ruby.ary_from_iter(self.0.errors().cloned().map(RAuthorizationError::from))
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
20
|
|
|
@@ -28,7 +28,7 @@ impl TryConvert for EntitiesWrapper {
|
|
|
28
28
|
match value.respond_to("to_ary", false) {
|
|
29
29
|
Ok(true) => {
|
|
30
30
|
let value: Value = value.funcall_public("to_ary", ())?;
|
|
31
|
-
let value: JsonValueWithNoDuplicateKeys = deserialize(value)?;
|
|
31
|
+
let value: JsonValueWithNoDuplicateKeys = deserialize(&handle, value)?;
|
|
32
32
|
Ok(Self(
|
|
33
33
|
Entities::from_json_value(value.into(), None)
|
|
34
34
|
.map_err(|e| Error::new(handle.exception_arg_error(), e.to_string()))?,
|
|
@@ -34,7 +34,7 @@ impl IntoValue for EntityUidWrapper {
|
|
|
34
34
|
let id = self.0.id().escaped().to_string();
|
|
35
35
|
let class = handle.get_inner(&ENTITY_UID);
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
class.new_instance((type_name, id)).unwrap().into()
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -44,7 +44,7 @@ impl TryConvert for EntityUidWrapper {
|
|
|
44
44
|
match value.respond_to("to_hash", false) {
|
|
45
45
|
Ok(true) => {
|
|
46
46
|
let value: Value = value.funcall_public("to_hash", ())?;
|
|
47
|
-
let value: JsonValueWithNoDuplicateKeys = deserialize(value)?;
|
|
47
|
+
let value: JsonValueWithNoDuplicateKeys = deserialize(&ruby, value)?;
|
|
48
48
|
Ok(Self(EntityUid::from_json(value.into()).map_err(|e| {
|
|
49
49
|
Error::new(ruby.get_inner(&PARSE_ERROR), e.to_string())
|
|
50
50
|
})?))
|
|
@@ -61,7 +61,9 @@ impl TryConvert for EntityUidWrapper {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
pub fn to_euid_value(euid: &EntityUid) -> Value {
|
|
64
|
-
|
|
64
|
+
let ruby = Ruby::get()
|
|
65
|
+
.expect("to_euid_value() can only be called from a Ruby thread");
|
|
66
|
+
EntityUidWrapper::new(euid.clone()).into_value_with(&ruby)
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
pub fn init(ruby: &Ruby) -> Result<(), Error> {
|
|
@@ -23,6 +23,17 @@ impl RPolicySet {
|
|
|
23
23
|
fn is_empty(&self) -> bool {
|
|
24
24
|
self.0.is_empty()
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
fn policy_ids(&self) -> Vec<String> {
|
|
28
|
+
self.0.policies()
|
|
29
|
+
.map(|policy| {
|
|
30
|
+
// Try to get the @id annotation first, fall back to auto-generated ID
|
|
31
|
+
policy.annotation("id")
|
|
32
|
+
.map(|s| s.to_string())
|
|
33
|
+
.unwrap_or_else(|| policy.id().to_string())
|
|
34
|
+
})
|
|
35
|
+
.collect()
|
|
36
|
+
}
|
|
26
37
|
}
|
|
27
38
|
|
|
28
39
|
impl From<&RPolicySet> for PolicySet {
|
|
@@ -43,6 +54,7 @@ pub fn init(ruby: &Ruby, module: &RModule) -> Result<(), Error> {
|
|
|
43
54
|
let class = module.define_class("PolicySet", ruby.class_object())?;
|
|
44
55
|
class.define_singleton_method("new", function!(RPolicySet::new, -1))?;
|
|
45
56
|
class.define_method("empty?", method!(RPolicySet::is_empty, 0))?;
|
|
57
|
+
class.define_method("policy_ids", method!(RPolicySet::policy_ids, 0))?;
|
|
46
58
|
|
|
47
59
|
Ok(())
|
|
48
60
|
}
|
data/lib/cedar_policy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cedar_policy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aotokitsuruya
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-02-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Ruby bindings for Cedar policy evaluation engine.
|
|
14
14
|
email:
|