Skip to content

Confirm that the signature on a link uses the author's signature key at the time of signing #74

@HerbCaudill

Description

@HerbCaudill

Commented-out validator from auth\validate.ts :

  signatureKeyIsCorrect: (...args) => {
    const [prevState, link] = args
    const action = link.body
    const { type } = action

    // at root link, team doesn't yet have members
    if (type === ROOT) return VALID

    const { userId } = link.signed
    const author = select.member(prevState, userId)
    // TODO: test this case
    if (link.signed.key !== author.keys.signature) {
      const msg = `Wrong signature key. Link is signed with ${link.signed.key}, but ${userId}'s signature key is ${author.keys.signature}`
      return fail(msg, ...args)
    }
    return VALID
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions