Skip to content

Commit

Permalink
feat(tenant-management): add api for getting all keys of tenants
Browse files Browse the repository at this point in the history
add api for getting all keys of tenants

GH-45
  • Loading branch information
Surbhi-sharma1 committed Sep 25, 2024
1 parent 5e03dcb commit 395971b
Show file tree
Hide file tree
Showing 2 changed files with 1,207 additions and 777 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,32 @@ export class TenantController {
async deleteById(@param.path.string('id') id: string): Promise<void> {
await this.tenantRepository.deleteById(id);
}

@authorize({
permissions: ['*'],
})
@get(`tenant/keys`, {
security: OPERATION_SECURITY_SPEC,
responses: {
[STATUS_CODE.OK]: {
description: 'Array of Tenant keys',
content: {
[CONTENT_TYPE.JSON]: {
schema: {
type: 'array',
items: {
type: 'string',
},
},
},
},
},
},
})
async getTenantKeys(
@param.filter(Tenant) filter?: Filter<Tenant>,
): Promise<string[]> {
const tenants = await this.tenantRepository.find(filter);
return tenants.map((tenant: Tenant) => tenant.key);
}
}
Loading

0 comments on commit 395971b

Please sign in to comment.