Commit Graph

209 Commits

Author SHA1 Message Date
Steve Moyer
1b61f2e4db docs(invocation): fix truncated WithEmptyNonce description 2024-11-06 12:16:45 -05:00
Steve Moyer
187e7a869c feat(invocation): ipld unseal to invocation 2024-11-06 12:16:44 -05:00
Steve Moyer
a98653b769 feat(invocation): produce example output similar to spec 2024-11-06 12:16:43 -05:00
Steve Moyer
31d16ac468 feat(invocation): provide New constructor and encoding to wire-format 2024-11-06 12:16:42 -05:00
Michael Muré
884d63a689 Merge pull request #53 from ucan-wg/test-literal
literal: add test suite
2024-11-06 16:45:19 +01:00
Michael Muré
c9f3a6033a delegation: minor fix around meta 2024-11-06 16:43:57 +01:00
Michael Muré
8447499c5a literal: add test suite 2024-11-06 16:42:45 +01:00
Michael Muré
41b8600fbc Merge pull request #52 from ucan-wg/meta-readonly
meta: make a read-only version to enforce token immutability
2024-11-06 15:28:19 +01:00
Michael Muré
6aeb6a8b70 meta: make a read-only version to enforce token immutability 2024-11-06 15:17:35 +01:00
Michael Muré
cfb4446a05 Merge pull request #48 from ucan-wg/pol-partial
policy: implement partial matching, to evaluate in multiple steps with fail early
2024-11-05 16:31:52 +01:00
Michael Muré
06a72868a5 container: add a delegation iterator 2024-11-05 16:26:53 +01:00
Michael Muré
6f9a6fa5c1 literal: make Map and List generic, to avoid requiring conversions 2024-11-05 16:26:14 +01:00
Michael Muré
72f4ef7b5e policy: fix incorrect test for PartialMatch 2024-11-04 19:07:36 +01:00
Fabio Bozzo
02be4010d6 add array quantifiers tests and tiny fix 2024-11-04 18:50:30 +01:00
Michael Muré
61e031529f policy: use "any" 2024-11-04 18:41:18 +01:00
Michael Muré
19721027e4 literal: rewrite Map() to cover more types 2024-11-04 18:34:31 +01:00
Fabio Bozzo
bc847ee027 fix literal.Map to handle list values too 2024-11-04 17:10:57 +01:00
Fabio Bozzo
5bfe430934 add test cases for missing optional values for all operators 2024-11-04 17:07:32 +01:00
Fabio Bozzo
10b5e1e603 add test cases for optional, like pattern, nested policy 2024-11-04 13:04:54 +01:00
Michael Muré
3cf1de6b67 policy: fix distrinction between "no data" and "optional not data" 2024-11-04 11:15:32 +01:00
Michael Muré
400f689a85 literal: some better typing 2024-11-04 11:15:12 +01:00
Fabio Bozzo
6717a3a89c refactor: simplify optional selector handling
Let Select() handle optional selectors by checking its nil return value, rather than explicitly checking IsOptional()
Applied this pattern consistently across all statement kinds (Equal, Like, All, Any, etc)
2024-11-04 10:56:06 +01:00
Fabio Bozzo
9e9c632ded revert typo 2024-11-01 17:47:47 +01:00
Fabio Bozzo
b210c69173 tests for partial match 2024-11-01 17:43:55 +01:00
Fabio Bozzo
6d85b2ba3c additional tests for optional selectors 2024-11-01 13:07:46 +01:00
Steve Moyer
fcb527cc52 Merge pull request #50 from ucan-wg/fix/meta-optional-in-delegation
fix: change meta optional in `delegation` `Token`, model and schema
2024-10-24 18:10:30 -04:00
Steve Moyer
89f648a94e docs(did): re-fix typo RE coercion of secp256k1 public keys 2024-10-24 13:44:32 -04:00
Steve Moyer
e1d771333c fix(delegation): meta is optional 2024-10-24 13:43:52 -04:00
Michael Muré
6b72799818 Merge pull request #41 from ucan-wg/streamline-did
did: simplify public API, add missing required algorithms
2024-10-24 17:09:10 +02:00
Steve Moyer
ccc85d4697 docs(did): correct typos 2024-10-24 10:59:27 -04:00
Steve Moyer
0d63e90b67 docs(did): add comment explaining why some ECDSA public keys are "coerced" to Secp256k1 public keys 2024-10-24 10:54:43 -04:00
Michael Muré
7662fe34db policy: implement partial matching, to evaluate in multiple steps with fail early 2024-10-24 16:21:57 +02:00
Michael Muré
6d0fbd4d5a minor cleanups 2024-10-24 14:46:01 +02:00
Michael Muré
e76354fb0a Merge pull request #47 from ucan-wg/simplify-literal
literal: simplify package with built-in functions
2024-10-24 14:33:33 +02:00
Michael Muré
deaf9c4fe9 Merge pull request #46 from ucan-wg/rework-policies
selector: rework to match the spec, cleanup lots of edge cases
2024-10-24 13:01:10 +02:00
Michael Muré
a1c2c5c067 literal: simplify package with built-in functions 2024-10-24 12:55:06 +02:00
Michael Muré
2c58fedfd5 did: last cleanups 2024-10-24 12:51:21 +02:00
Fabio Bozzo
2ea9f8c93b clamp start idx to length for out of bound 2024-10-24 12:44:25 +02:00
Fabio Bozzo
00ff88ef23 add slicing/indexing for bytes kind 2024-10-24 12:27:01 +02:00
Michael Muré
2ffdf004ac test(did): split the test vector reading code in a separate file/package
tests are much cleaner and explicit now
2024-10-24 12:03:23 +02:00
Michael Muré
a8780f750c policy: remove remnant of policy matching, that concept doesn't really work with complex policies
Maybe it will be revived later.
2024-10-24 11:17:38 +02:00
Michael Muré
c70f68b886 selector: remove incorrect tests
https://github.com/ucan-wg/delegation/issues/5#issuecomment-2434713564

My understanding is that a few of those example are now incorrect/obsolete:

String Index: as per @expede, indexing on strings is now disallowed, to match jq
Optional Iterator, .[][]?: the spec says that iterator on arrays are no-op. It makes sense imho, as jq output multiple values with that, which we can't.
Nested Iterator, .[][]: same reason
2024-10-24 11:11:25 +02:00
Michael Muré
a27eb258e5 selector: remove remnant of policy matching, that concept doesn't really work with complex policies
Maybe it will be revived later.
2024-10-24 11:07:00 +02:00
Fabio Bozzo
866683347f disable support for string indexing 2024-10-23 18:25:16 +02:00
Fabio Bozzo
2fafbe7bf3 enable string indexing/slicing and new selector tests 2024-10-23 17:01:00 +02:00
Fabio Bozzo
1728bf29b8 add more parsing tests 2024-10-23 16:37:35 +02:00
Michael Muré
8fac97b7e7 fix some edge cases:
- slicing is start:end, not start:length, but importantly start to *excluded* end
- backward slicing is illegal
- slicing on string is allowed
- slicing on strings operates on runes, not bytes
2024-10-23 12:18:03 +02:00
Michael Muré
7ad940844c selector: disallow backward slicing 2024-10-23 11:31:41 +02:00
Fabio Bozzo
52ae2eaf60 fix inconsistent test expectations 2024-10-23 11:25:07 +02:00
Michael Muré
570bcdcb6c policy: comment out "filtering" of policies, concept that doesn't really work 2024-10-23 11:25:07 +02:00