Fabio Bozzo
ddaa67ed7d
feat(policy): filter statements subset by selector
2024-09-24 11:33:06 +02:00
Michael Muré
684c21c7a4
delegation: tune the validation step
...
- avoid a double parsing when the flow already parsed (command, policy)
- don't require a did:key, as other types are legal (but might require a resolver, TODO)
- make the command a struct instead of a pointer: we don't need to avoid copy, and the pointer can be interpreted as nil
- make the nonce parameter optional, but generate one if none is given
2024-09-19 11:16:33 +02:00
Michael Muré
ac73cae3ec
glob: a bit of reshaping, and a benchmark
2024-09-18 11:24:37 +02:00
Fabio Bozzo
a19d3505fe
validateGlobPattern is now responsibility of the caller
2024-09-18 11:12:46 +02:00
Fabio Bozzo
16ba4b392d
apply pr feedback
2024-09-17 14:15:36 +02:00
Fabio Bozzo
94a0d4d56e
remove max input size check from fuzz test
2024-09-17 13:54:42 +02:00
Fabio Bozzo
53ef97231d
iterative glob.go and limit FuzzMatch input size
2024-09-17 13:18:12 +02:00
Fabio Bozzo
c960481a10
remove gobwas dep
2024-09-16 18:55:04 +02:00
Fabio Bozzo
d4d4514971
few comments
2024-09-16 18:52:01 +02:00
Fabio Bozzo
282db65900
refactor simpler glob match with one wildcard only
2024-09-16 18:33:36 +02:00
Fabio Bozzo
2459f1a5c3
wip: simple glob match and FuzzMatch
2024-09-16 18:23:14 +02:00
Fabio Bozzo
37f5286315
fix length check per-kind bug
2024-09-16 14:04:45 +02:00
Fabio Bozzo
ad03154b6e
handle list nodes equality in selector
2024-09-16 13:00:13 +02:00
Fabio Bozzo
d57d2a230b
handle Optional Iterator selector
2024-09-13 16:26:46 +02:00
Fabio Bozzo
7060d4bb33
handle Optional Null Iterator selector
2024-09-13 15:33:11 +02:00
Fabio Bozzo
a183b627be
handle String Slice selector
2024-09-13 14:49:52 +02:00
Fabio Bozzo
dbfff3f70c
refactoring resolve func
2024-09-13 14:44:26 +02:00
Fabio Bozzo
cb45d9019b
handle Array Slice selector
2024-09-13 14:18:59 +02:00
Fabio Bozzo
2e17ff8550
handle Bytes Index [0] selector and fix case input
2024-09-13 13:06:49 +02:00
Fabio Bozzo
e86e45be73
handle String Index selector
2024-09-12 18:19:50 +02:00
Michael Muré
97c9990045
policy: fix incorrect policy in tests
2024-09-09 19:32:53 +02:00
Michael Muré
6a17270545
fix import paths
2024-09-05 18:49:01 +02:00
Michael Muré
8bf7fa173c
command: simplify errors
2024-09-05 16:25:22 +02:00
Michael Muré
f731f56dd2
policy: more tests and fixes
2024-09-04 19:08:21 +02:00
Michael Muré
d042b5cdfd
policy: fix "all" and "any" to apply a single statement on a collection
...
Matching the spec
2024-09-04 15:58:08 +02:00
Michael Muré
4dd91f95f7
selector: workaround panic() go-ipld-prime with negative index
...
Waiting on https://github.com/ipld/go-ipld-prime/pull/571 to be released.
2024-09-02 18:08:49 +02:00
Michael Muré
ab2f074b22
policy: working IPLD round-trip
2024-09-02 02:25:34 +02:00
Michael Muré
20efcebab0
policy: remove superfluous interfaces
...
Those interfaces were only used inside the package, where private concrete work just as well.
2024-09-02 02:24:13 +02:00
Michael Muré
8c09024003
policy: IPLD encode/decode
...
Still WIP
2024-09-01 20:27:54 +02:00
Michael Muré
4d0a0a2bcc
selector: use a string builder to avoid excessive allocation
2024-09-01 17:22:21 +02:00
Michael Muré
431a9f008a
policy: split out the parsing for readability
2024-09-01 17:20:09 +02:00
Michael Muré
bd7ff3dc3f
selector: support negative index on lists
2024-09-01 17:08:49 +02:00
Michael Muré
53af455709
selector: don't panic on empty input for Parse()
2024-09-01 17:08:18 +02:00
Michael Muré
735ad45977
selector: add fuzzing
2024-09-01 17:07:45 +02:00
Michael Muré
9286cce884
capability: normal go formatting for enums
2024-09-01 17:06:21 +02:00
Michael Muré
49d3e5ad10
selector: reformat the "supported forms" test in a way that can be run individually
...
For example with "-test.run ^\QTestSupportedForms\E$/^\QPass:_Identity\E$"
2024-09-01 17:04:23 +02:00
Michael Muré
f1ce38dfd1
policy: add additional test vector from the spec
2024-08-31 15:49:02 +02:00
Michael Muré
b0c96b25dc
selector: simplify the public interface of the package
...
Those extra interfaces are not necessary.
2024-08-31 15:48:24 +02:00
Michael Muré
5b26d85c37
policy: remove 5 dependencies
2024-08-30 23:12:32 +02:00
Michael Muré
4b24eef195
make the go module a v1
2024-08-30 23:11:51 +02:00
Michael Muré
69d2e0a530
command: small fixes
2024-08-30 22:50:23 +02:00
Michael Muré
0e5ae7ae0d
policy: move into /capability
2024-08-30 22:49:54 +02:00
Michael Muré
8ddcce3c58
Add 'capability/command/' from commit 'f37a43ac38af8c3710fee4e6a923070f6af4f74c'
...
git-subtree-dir: capability/command
git-subtree-mainline: c2cc0ca0a4
git-subtree-split: f37a43ac38
2024-08-30 22:36:49 +02:00