ucan-wg / delegation

1 stars 1 forks source link

data types supported in literals #6

Open Gozala opened 6 months ago

Gozala commented 6 months ago

Literal(Json)

Can we restrict literals to just scalars ? I think it will get hairy otherwise especially if we start extending policy syntax in the future.

expede commented 6 months ago

Just to make sure that I understand the scope of the question, you're suggesting that one shouldn't be able to unify against collections?

// Disallowed
["==", ".foo", [1, 2, 3]]

If that were disallowed, would I have to expand this to the following to do the same:

[
  ["==", ".foo.[0]", 1],
  ["==", ".foo.[1]", 2],
  ["==", ".foo.[2]", 3]
]

I personally think the pattern match is easier to read 🤔

I think it will get hairy otherwise especially if we start extending policy syntax in the future.

Interesting — how so?