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(recaps): add proposed api #139

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

zachferland
Copy link
Contributor

Opened as ongoing DRAFT:

Currently just includes the proposed API for first iteration (to be implemented soon).

@zachferland zachferland requested a review from oed January 13, 2023 22:02
Copy link
Member

@oed oed left a comment

Choose a reason for hiding this comment

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

Seems reasonable.

Comment on lines +1 to +3
type CeramicWrite = {
"ceramic/write": []
}
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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.

Suggested change
return this.toStatement(delegee) === statement
return statement.startsWith(this.toStatement(delegee))

Copy link
Contributor Author

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.

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.

None yet

2 participants