-
Notifications
You must be signed in to change notification settings - Fork 28
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(recaps): add proposed api #139
base: main
Are you sure you want to change the base?
Conversation
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.
Seems reasonable.
type CeramicWrite = { | ||
"ceramic/write": [] | ||
} |
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.
Do we want to keep Ceramic specific things outside of here? Currently all Ceramic specific code of SIWx lives in the js-ceramic codebase.
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.
Mostly likely in the end, but thinking that for now everything ceramic specific goes here for now (to keep more self contained while experimental), and more useful to drive with specific use case first (ceramic), then generalize after
even if specs dont have namespaces, a general library will need to have some form of that, similar to spruce libs, lots of the rules/parsing are defined by that
likely will make sense to combine most of siwx + recap things together instead this separate library here
*/ | ||
// TODO att/caps may not be ordered, unless spec says otherwise | ||
verifyStatment(statement:string, delegee: string):boolean { | ||
return this.toStatement(delegee) === statement |
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.
Note that the complete SIWE statement may contain additional data after the ReCap statement. Might make sense to do startsWith
instead.
return this.toStatement(delegee) === statement | |
return statement.startsWith(this.toStatement(delegee)) |
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.
yeah thats a good point, this does assume only the recap statement and not the siwx statement. As mentioned above, think siwx + recap stuff will end up together, and this would validated like this at that level.
Opened as ongoing DRAFT:
Currently just includes the proposed API for first iteration (to be implemented soon).