-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Has capability test #58
Conversation
Thanks, that's an amazing contribution.
Yes, this is a bug. Whoops! Your contribution is amazing. You've created a failing test case. We'll use that to implement a fix for this. |
@nichoth Any chance you can rebase this on Would love to get this in so we can fix |
f2fde61
to
3f61962
Compare
Ok I think it has been rebased & merged properly. My brain started overheating thinking about the branches, PRs, etc, but hopefully I did that correctly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🙌 I'll merge this next Monday and will make sure all the tests pass.
I just fixed the type checking with the updates, however there is one type I wasn't sure about -- https://github.com/nichoth/ts-ucan/blob/hasCapability-test/tests/attenuation.test.ts#L234 It is telling me
|
Update -- I have fixed the above error. It was a mixup with the expected object shapes for the capabilities. |
966b1b2
to
61928fc
Compare
61928fc
to
6c21b13
Compare
@nichoth this PR is almost good to go. I proposed some changes to this PR in another PR (see the mention above this comment 👆 ). Once we've merged that PR, we can merge this PR 🎉 |
Changes to "Has capability test"
Revert yarn.lock changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I'd love to merge this.
With my changes this also fixes #60
I'd love to see another quick look at this @icidasset 🙏
This PR adds some tests for the
hasCapability
method. These were things that I was curious about when I was looking at how to validate permissions via UCAN. There is still one question I had, about theoriginator
field. I made a test that currently fails -- https://github.com/nichoth/ts-ucan/blob/f2fde61b72adcd0a434e5ce1ba91cfe1d834fba1/tests/attenuation.test.ts#L296 -- the question is how isoriginator
used? It doesn't seem to affect the return value ofhasCapability
. I'm not sure if this is not implemented yet or if my test is wrong in some way.Thanks. Hopefully this is helpful and not creating needless work 😬