-
Notifications
You must be signed in to change notification settings - Fork 90
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
fix(backend): fix OP resource tests #2969
fix(backend): fix OP resource tests #2969
Conversation
365734f
to
a48dfb4
Compare
02caf52
to
821c733
Compare
821c733
to
8c5667a
Compare
@@ -105,42 +105,6 @@ export function initIocContainer( | |||
} | |||
) | |||
|
|||
container.singleton( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, probably due to rebasing, this got duplicated a few times.
@@ -20,10 +20,6 @@ exports.up = function (knex) { | |||
table.uuid('tenantId').notNullable() | |||
table.foreign('tenantId').references('id').inTable('tenants') | |||
}) | |||
.table('grants', function (table) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grant's don't need tenantId
- they're never queried on the backend by that filter, and the tenant it is for can be determined by the auth server URL path. Having the requirement explicitly in this table introduces some backwards compatibility issues.
@@ -14,45 +9,6 @@ export const mapTenantEndpointTypeToModelEndpointType = { | |||
[EndpointType.WebhookBaseUrl]: TenantEndpointType.WebhookBaseUrl | |||
} | |||
|
|||
export const getTenantEndpoints: TenantResolvers<ApolloContext>['endpoints'] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolver not being used anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like it leaves the service getTenantEndpointsPage
method unused... remove?
@@ -1071,8 +1071,6 @@ input CreateQuoteInput { | |||
receiver: String! | |||
"Unique key to ensure duplicate or retried requests are processed only once. See [idempotence](https://en.wikipedia.org/wiki/Idempotence)" | |||
idempotencyKey: String | |||
"ID of the tenant" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tenantId
got removed from the quote resolver input for backwards compatibility issues and it can be retrieved from the wallet address anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be retrieved from the wallet address anyways
I think perhaps this is the better pattern. It's simpler and I don't think we need to verify against the requestor's expectation for what the tenantId
should be (ie, the tenantId
being removed here).
I remember you mentioning that before and not having much of an opinion but I came across it myself when dealing with checking access for the createQuote resolver and felt like passing it in wasn't really providing any value, and it does make the gql input less complicated. Since before it was required for everyone but really only needed when an operator is making it on behalf of a tenant.
@@ -21,10 +21,6 @@ import { | |||
import { v4 as uuid } from 'uuid' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The modifications here are all removing the tenantId
parameter from grant creation calls
52767da
to
3e84958
Compare
Changes proposed in this pull request
operatorApiSecret
whose inclusion the headers will allow seeding to take place during localenv startupbackend
Context
Fixes #2968.
This is part of a greater effort to bring the multi-tenant feature branch back up to par with the standards of the main branch, as a lot of tests and github actions are failing due to changes to the database that add foreign key constraints to many of the tables.
This PR fixes the tests for the Open Payments resources, as well as sets up some fixes for the test environment that gets set up by many of the tests.
Overall story is captured here: #2972
Checklist
fixes #number
user-docs
label (if necessary)