Skip to content

Commit

Permalink
update type guard to use correct key
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddharthMantri committed Jun 28, 2024
1 parent 7b2c26f commit caddc90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,5 +264,5 @@ export interface UpdateRestAPIKeyWithKibanaPrivilegesParams {
}

export function isCreateRestAPIKeyParams(params: any): params is CreateRestAPIKeyParams {
return 'role_descriptor' in params;
return 'role_descriptors' in params;
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ describe('API Keys', () => {
role_descriptors: roleDescriptors,
expiration: '1d',
});

expect(result).toEqual({
api_key: 'abc123',
expiration: '1d',
Expand All @@ -254,7 +255,7 @@ describe('API Keys', () => {
expect(mockScopedClusterClient.asCurrentUser.security.createApiKey).toHaveBeenCalledWith({
body: {
name: 'key-name',
role_descriptors: { foo: true },
role_descriptors: roleDescriptors,
expiration: '1d',
},
});
Expand Down

0 comments on commit caddc90

Please sign in to comment.