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

Cover joinedTheRightTeam with a test #76

Open
HerbCaudill opened this issue Nov 19, 2023 · 0 comments
Open

Cover joinedTheRightTeam with a test #76

HerbCaudill opened this issue Nov 19, 2023 · 0 comments

Comments

@HerbCaudill
Copy link
Member

In the Connection protocol, we confirm that we haven't been spoofed into joining the wrong team: Once we've joined and gotten the full team history, we look for an invitation matching the secret invitation code we were given.

joinedTheRightTeam: (context, event) => {
// Make sure my invitation exists on the signature chain of the team I'm about to join.
// This check prevents an attack in which a fake team pretends to accept my invitation.
const { payload } = event as AcceptInvitationMessage
const { serializedGraph, teamKeyring } = payload
const state = getTeamState(serializedGraph, teamKeyring)
const { id } = this.myProofOfInvitation(context)
return select.hasInvitation(state, id)
},

This looks right but there are currently no tests covering this scenario.

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

No branches or pull requests

1 participant