Skip to content
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

feat: validate caveat payloads #11

Merged
merged 24 commits into from
Sep 18, 2024
Merged

feat: validate caveat payloads #11

merged 24 commits into from
Sep 18, 2024

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Aug 13, 2024

This allows caveats (nb) to be used in server handler functions.

It adds a minimal validator framework that parses caveats to a Go type.

You can now define a capability with a Go type for caveats (and an IPLD schema). This allows incoming capability invocation payloads to be parsed to check for validity.

Alan Shaw and others added 17 commits August 6, 2024 12:50
change all references to web3-storage package, move to storacha-network package

BREAKING CHANGE: referencing this package at web3-storage will no longer work after this commit
improves the result type with a more functional typed union primitive and useful wrapper functions
# Goals

It had to happen sometime... fixing the names before it gets to
complicated

# Implementation

Change all references to web3-storage package, move to storacha-network
package

BREAKING CHANGE: referencing this package at web3-storage will no longer
work after this commit due to the way go.mod works
# Goals

A result type with terser, more type safe and functional UX

# Implementation

I've been working on this for a few days -- just trying to assemble a
result type that seems more pleasant to work with cause it follows
traditional functional paradigms around typed unions.

This also adds a few recovery functions and restores the NewFailure
function.
@alanshaw alanshaw marked this pull request as ready for review August 13, 2024 18:35
@alanshaw alanshaw requested a review from hannahhoward August 13, 2024 20:31
Base automatically changed from feat/server to main August 14, 2024 06:34
Alan Shaw and others added 4 commits August 14, 2024 08:50
@alanshaw
Copy link
Member Author

@hannahhoward I merged the Rebind changes here - please review the rest when you have a sec 🙏

Copy link
Member

@hannahhoward hannahhoward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm LGTM on the rest of this, but I we should take steps to insure the ucan package does not link to anything else (either by copying the ipld.builder interface, or just putting it in the ucan package)

ucan/lib.go Outdated Show resolved Hide resolved
core/result/result.go Outdated Show resolved Hide resolved
@alanshaw alanshaw merged commit d098f6c into main Sep 18, 2024
1 check passed
@alanshaw alanshaw deleted the feat/cap-in-handler branch September 18, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants