Skip to content

Cover joinedTheRightTeam with a test #76

@HerbCaudill

Description

@HerbCaudill

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions