Skip to content
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

CYOK implementation #1041

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": {}
},
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added fixture for testing rekey

"scope": "https://test-domain.auth0.com",
"method": "POST",
"path": "/api/v2/keys/encryption/rekey",
tusharpandey13 marked this conversation as resolved.
Show resolved Hide resolved
"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,
});
});
});
Loading