Skip to content

Commit

Permalink
CYOK implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharpandey13 committed Sep 30, 2024
1 parent 34497ef commit 39cb2a2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/management/__generated/managers/keys-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ export class KeysManager extends BaseAPI {
return runtime.JSONApiResponse.fromResponse(response);
}

/**
* Perform rekeying operation on the key hierarchy.
* Rekey the key hierarchy
*
* @throws {RequiredError}
*/
async postEncryptionRekey(initOverrides?: InitOverride): Promise<ApiResponse<void>> {
const response = await this.request(
{
path: `/keys/encryption/rekey`,
method: 'POST',
},
initOverrides
);

return runtime.VoidApiResponse.fromResponse(response);
}

/**
* Rotate the Application Signing Key
*
Expand Down
7 changes: 7 additions & 0 deletions test/management/fixtures/keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
"status": 200,
"response": {}
},
{
"scope": "https://test-domain.auth0.com",
"method": "POST",
"path": "/api/v2/keys/encryption/rekey",
"status": 200,
"response": {}
},
{
"scope": "https://test-domain.auth0.com",
"method": "PUT",
Expand Down
6 changes: 6 additions & 0 deletions test/management/keys-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,10 @@ describe('AnomalyManager', () => {
status: 200,
});
});

it('should rekey the tenant key heirarchy', async () => {
await expect(keysManager.postEncryptionRekey()).resolves.toMatchObject({
status: 200,
});
});
});

0 comments on commit 39cb2a2

Please sign in to comment.