diff --git a/src/management/__generated/managers/keys-manager.ts b/src/management/__generated/managers/keys-manager.ts index 1efa14dcd..31320117f 100644 --- a/src/management/__generated/managers/keys-manager.ts +++ b/src/management/__generated/managers/keys-manager.ts @@ -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> { + const response = await this.request( + { + path: `/keys/encryption/rekey`, + method: 'POST', + }, + initOverrides + ); + + return runtime.VoidApiResponse.fromResponse(response); + } + /** * Rotate the Application Signing Key * diff --git a/test/management/fixtures/keys.json b/test/management/fixtures/keys.json index 6a26db1fb..bbf5eb66a 100644 --- a/test/management/fixtures/keys.json +++ b/test/management/fixtures/keys.json @@ -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", diff --git a/test/management/keys-manager.test.ts b/test/management/keys-manager.test.ts index bf3bd5dda..7a9559ba1 100644 --- a/test/management/keys-manager.test.ts +++ b/test/management/keys-manager.test.ts @@ -46,4 +46,10 @@ describe('AnomalyManager', () => { status: 200, }); }); + + it('should rekey the tenant key heirarchy', async () => { + await expect(keysManager.postEncryptionRekey()).resolves.toMatchObject({ + status: 200, + }); + }); });