-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backend): backend tenant graphql resolvers (#3234)
* feat: backend tenant graphql resolvers * chore: formatting * fix: extra testing db for tenants * feat: bruno collection * feat: update graphql schema comments * fix: review comments * feat: optional idp secret & consent url * feat: tenant response requirement * feat: make delete operator-only * chore: cleanup
- Loading branch information
Showing
22 changed files
with
2,679 additions
and
91 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
bruno/collections/Rafiki/Rafiki Admin APIs/Create Tenant.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
meta { | ||
name: Create Tenant | ||
type: graphql | ||
seq: 54 | ||
} | ||
|
||
post { | ||
url: {{RafikiGraphqlHost}}/graphql | ||
body: graphql | ||
auth: none | ||
} | ||
|
||
body:graphql { | ||
mutation CreateTenant($input: CreateTenantInput!) { | ||
createTenant(input:$input) { | ||
tenant { | ||
id | ||
apiSecret | ||
idpConsentUrl | ||
idpSecret | ||
} | ||
} | ||
} | ||
} | ||
|
||
body:graphql:vars { | ||
{ | ||
"input": { | ||
"email": "example@example.com", | ||
"apiSecret": "test-secret", | ||
"idpConsentUrl": "https://example.com/consent", | ||
"idpSecret": "test-idp-secret" | ||
} | ||
} | ||
} | ||
|
||
script:pre-request { | ||
const scripts = require('./scripts'); | ||
|
||
scripts.addApiSignatureHeader(); | ||
} | ||
|
||
script:post-response { | ||
const body = res.getBody(); | ||
|
||
if (body?.data) { | ||
bru.setEnvVar("tenantId", body.data.createTenant.tenant?.id); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
bruno/collections/Rafiki/Rafiki Admin APIs/Delete Tenant.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
meta { | ||
name: Delete Tenant | ||
type: graphql | ||
seq: 56 | ||
} | ||
|
||
post { | ||
url: {{RafikiGraphqlHost}}/graphql | ||
body: graphql | ||
auth: none | ||
} | ||
|
||
body:graphql { | ||
mutation DeleteTenant($id: String!) { | ||
deleteTenant(id:$id) { | ||
success | ||
} | ||
} | ||
} | ||
|
||
body:graphql:vars { | ||
{ | ||
"id": "{{tenantId}}" | ||
} | ||
} | ||
|
||
script:pre-request { | ||
const scripts = require('./scripts'); | ||
|
||
scripts.addApiSignatureHeader(); | ||
} |
43 changes: 43 additions & 0 deletions
43
bruno/collections/Rafiki/Rafiki Admin APIs/Update Tenant.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
meta { | ||
name: Update Tenant | ||
type: graphql | ||
seq: 55 | ||
} | ||
|
||
post { | ||
url: {{RafikiGraphqlHost}}/graphql | ||
body: graphql | ||
auth: none | ||
} | ||
|
||
body:graphql { | ||
mutation UpdateTenant($input: UpdateTenantInput!) { | ||
updateTenant(input:$input) { | ||
tenant { | ||
id | ||
apiSecret | ||
idpConsentUrl | ||
idpSecret | ||
} | ||
} | ||
} | ||
} | ||
|
||
body:graphql:vars { | ||
{ | ||
"input": { | ||
"id": "{{tenantId}}", | ||
"email": "updated@example.com", | ||
"apiSecret": "updated-test-secret", | ||
"idpConsentUrl": "https://example.com/consent-updated", | ||
"idpSecret": "updated-test-idp-secret" | ||
} | ||
} | ||
} | ||
|
||
script:pre-request { | ||
const scripts = require('./scripts'); | ||
|
||
scripts.addApiSignatureHeader(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.