mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Security Solution][Serverless] Add HTTP header 'x-elastic-internal-product' to e2e Role/User loader (#163026)
## Summary - Adds http header `x-elastic-internal-product` to the calls made form the Role/User loader to create the roles in cypress tests
This commit is contained in:
parent
2c6fd26f5e
commit
c0030da51b
1 changed files with 10 additions and 0 deletions
|
@ -25,6 +25,10 @@ const ignoreHttp409Error = (error: AxiosError) => {
|
|||
throw error;
|
||||
};
|
||||
|
||||
const DEFAULT_HEADERS = Object.freeze({
|
||||
'x-elastic-internal-product': 'security-solution',
|
||||
});
|
||||
|
||||
export interface LoadedRoleAndUser {
|
||||
role: string;
|
||||
username: string;
|
||||
|
@ -75,6 +79,9 @@ export class RoleAndUserLoader<R extends Record<string, Role> = Record<string, R
|
|||
.request({
|
||||
method: 'PUT',
|
||||
path: `/api/security/role/${roleName}`,
|
||||
headers: {
|
||||
...DEFAULT_HEADERS,
|
||||
},
|
||||
body: roleDefinition,
|
||||
})
|
||||
.catch(ignoreHttp409Error)
|
||||
|
@ -104,6 +111,9 @@ export class RoleAndUserLoader<R extends Record<string, Role> = Record<string, R
|
|||
.request({
|
||||
method: 'POST',
|
||||
path: `/internal/security/users/${username}`,
|
||||
headers: {
|
||||
...DEFAULT_HEADERS,
|
||||
},
|
||||
body: user,
|
||||
})
|
||||
.catch(ignoreHttp409Error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue