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

Filter OP resources by tenantId in Admin API calls #2929

Open
Tracked by #2893
njlie opened this issue Aug 30, 2024 · 0 comments
Open
Tracked by #2893

Filter OP resources by tenantId in Admin API calls #2929

njlie opened this issue Aug 30, 2024 · 0 comments
Assignees
Labels
pkg: backend Changes in the backend package.

Comments

@njlie
Copy link
Contributor

njlie commented Aug 30, 2024

The Rafiki Admin API should use the Kratos session token to retrieve and add a tenantId to the context. Resolvers should use this context to:

  • Only retrieve Open Payments resources that belong to that tenant (unless that tenant is also the instance operator).
  • It should prevent requests where provides a valid id is provided for an Open Payments resource, but that resource does not belong to that tenant. Return a Not Found response in this case.
  • When creating a new resource that requires a tenantId as database field, it should either:
    • Verify that the provided tenantId in the input matches the one added to the context, or is from an operator
    • Provided that tenantId from the context.
      • Maybe we could even remove tenantId as an input from all graphql inputs, and just include it in service requests by pulling it from the context at all times.

This logic should be applied to resolvers for:

  • Quotes
  • Incoming/Outgoing Payments
  • Wallet Addresses
@njlie njlie mentioned this issue Aug 30, 2024
17 tasks
@BlairCurrey BlairCurrey self-assigned this Oct 3, 2024
@njlie njlie mentioned this issue Oct 11, 2024
1 task
@njlie njlie added the pkg: backend Changes in the backend package. label Oct 18, 2024
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.
Projects
Status: Todo
Development

No branches or pull requests

2 participants