Skip to content

add tests for sign and verify with a weird obj#82

Draft
staltz wants to merge 1 commit intomainfrom
tests-hmackey-weird
Draft

add tests for sign and verify with a weird obj#82
staltz wants to merge 1 commit intomainfrom
tests-hmackey-weird

Conversation

@staltz
Copy link
Member

@staltz staltz commented Sep 27, 2020

I don't know if anyone out there uses ssb-keys this way, but this is currently supported:

ssbKeys.signObj(keys, someBuffer, anotherBuffer)

That is, the object being signed is a Buffer. Now, this currently executes without errors because every Buffer is an object. But should we forbid this usage?

Created as a draft to indicate I don't want to merge yet before we discuss about it.

@davegomez
Copy link
Contributor

The most extended form of an object to sign in signObject I have seen so far is this:

{
    "address": "net:192.168 ... MpNw="
}

I would say that for type safety sakes, only "real objects" should be allowed in these two functions. In this case, having a less easy developer experience worth it.

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