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: fetching retrieves non-revoked keys for a payment pointer #1837

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

JoblersTune
Copy link
Collaborator

@JoblersTune JoblersTune commented Sep 6, 2023

Changes proposed in this pull request

  • When fetching payment pointer keys only non-revoked keys are returned

Context

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Documentation added
  • Make sure that all checks pass
  • Postman collection updated

@netlify
Copy link

netlify bot commented Sep 6, 2023

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit 66a6cef
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/64f84a3884a476000860599b

@github-actions github-actions bot added type: tests Testing related pkg: backend Changes in the backend package. type: source Changes business logic labels Sep 6, 2023
@JoblersTune
Copy link
Collaborator Author

I have updated the getKeysByPaymentPointerId service function. I wasn't sure if I needed to include any filtering in the routes file where keys are returned based on deps.config.paymentPointerUrl === ctx.paymentPointerUrl

  deps: ServiceDependencies,
  ctx: PaymentPointerKeysContext
): Promise<void> {
  if (ctx.paymentPointer) {
    const keys = await deps.paymentPointerKeyService.getKeysByPaymentPointerId(
      ctx.paymentPointer.id
    )

    ctx.body = {
      keys: keys.map((key) => key.jwk)
    }
  } else if (deps.config.paymentPointerUrl === ctx.paymentPointerUrl) {
    ctx.body = {
      keys: [deps.jwk]
    }
  } else {
    return ctx.throw(404)
  }
}``` 

@mkurapov
Copy link
Contributor

mkurapov commented Sep 6, 2023

@JoblersTune good q, I would say we don't add any filters here because this is the key that is "issued" for the Rafiki instance itself (used when making inter-Rafiki requests, for example to get grants from another Rafiki instance). The key shouldn't be revoked, or some things might break.

@JoblersTune JoblersTune merged commit f6cc3d2 into main Sep 6, 2023
25 checks passed
@JoblersTune JoblersTune deleted the sj/1760/not-returning-revoked-keys branch September 6, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: backend Changes in the backend package. type: source Changes business logic type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not return revoked keys when fetching payment pointer keys
2 participants