-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
173 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,102 +5,100 @@ | |
*/ | ||
import { AUTHENTICATION } from './authentication'; | ||
|
||
export const createUsersAndRoles = async (es, supertest) => { | ||
await supertest.put('/api/security/role/kibana_legacy_user') | ||
.send({ | ||
elasticsearch: { | ||
indices: [{ | ||
export const createUsersAndRoles = async (es: any, supertest: SuperTest<any>) => { | ||
await supertest.put('/api/security/role/kibana_legacy_user').send({ | ||
elasticsearch: { | ||
indices: [ | ||
{ | ||
names: ['.kibana'], | ||
privileges: ['manage', 'read', 'index', 'delete'] | ||
}] | ||
} | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_legacy_dashboard_only_user') | ||
.send({ | ||
elasticsearch: { | ||
indices: [{ | ||
privileges: ['manage', 'read', 'index', 'delete'], | ||
}, | ||
], | ||
}, | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_legacy_dashboard_only_user').send({ | ||
elasticsearch: { | ||
indices: [ | ||
{ | ||
names: ['.kibana'], | ||
privileges: ['read', 'view_index_metadata'] | ||
}] | ||
} | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_dual_privileges_user') | ||
.send({ | ||
elasticsearch: { | ||
indices: [{ | ||
privileges: ['read', 'view_index_metadata'], | ||
}, | ||
], | ||
}, | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_dual_privileges_user').send({ | ||
elasticsearch: { | ||
indices: [ | ||
{ | ||
names: ['.kibana'], | ||
privileges: ['manage', 'read', 'index', 'delete'] | ||
}] | ||
}, | ||
kibana: { | ||
global: ['all'] | ||
} | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_dual_privileges_dashboard_only_user') | ||
.send({ | ||
elasticsearch: { | ||
indices: [{ | ||
privileges: ['manage', 'read', 'index', 'delete'], | ||
}, | ||
], | ||
}, | ||
kibana: { | ||
global: ['all'], | ||
}, | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_dual_privileges_dashboard_only_user').send({ | ||
elasticsearch: { | ||
indices: [ | ||
{ | ||
names: ['.kibana'], | ||
privileges: ['read', 'view_index_metadata'] | ||
}] | ||
privileges: ['read', 'view_index_metadata'], | ||
}, | ||
], | ||
}, | ||
kibana: { | ||
global: ['read'], | ||
}, | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_user').send({ | ||
kibana: { | ||
global: ['all'], | ||
}, | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_dashboard_only_user').send({ | ||
kibana: { | ||
global: ['read'], | ||
}, | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_default_space_all_user').send({ | ||
kibana: { | ||
space: { | ||
default: ['all'], | ||
}, | ||
}, | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_default_space_read_user').send({ | ||
kibana: { | ||
space: { | ||
default: ['read'], | ||
}, | ||
kibana: { | ||
global: ['read'] | ||
} | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_user') | ||
.send({ | ||
kibana: { | ||
global: ['all'] | ||
} | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_dashboard_only_user') | ||
.send({ | ||
kibana: { | ||
global: ['read'] | ||
} | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_default_space_all_user') | ||
.send({ | ||
kibana: { | ||
space: { | ||
default: ['all'] | ||
} | ||
} | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_default_space_read_user') | ||
.send({ | ||
kibana: { | ||
space: { | ||
default: ['read'] | ||
} | ||
} | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_space_1_all_user') | ||
.send({ | ||
kibana: { | ||
space: { | ||
space_1: ['all'] | ||
} | ||
} | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_space_1_read_user') | ||
.send({ | ||
kibana: { | ||
space: { | ||
space_1: ['read'] | ||
} | ||
} | ||
}); | ||
}, | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_space_1_all_user').send({ | ||
kibana: { | ||
space: { | ||
space_1: ['all'], | ||
}, | ||
}, | ||
}); | ||
|
||
await supertest.put('/api/security/role/kibana_rbac_space_1_read_user').send({ | ||
kibana: { | ||
space: { | ||
space_1: ['read'], | ||
}, | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
username: AUTHENTICATION.NOT_A_KIBANA_USER.USERNAME, | ||
|
@@ -109,7 +107,7 @@ export const createUsersAndRoles = async (es, supertest) => { | |
roles: [], | ||
full_name: 'not a kibana user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
|
@@ -119,17 +117,17 @@ export const createUsersAndRoles = async (es, supertest) => { | |
roles: ['kibana_legacy_user'], | ||
full_name: 'a kibana legacy user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
username: AUTHENTICATION.KIBANA_LEGACY_DASHBOARD_ONLY_USER.USERNAME, | ||
body: { | ||
password: AUTHENTICATION.KIBANA_LEGACY_DASHBOARD_ONLY_USER.PASSWORD, | ||
roles: ["kibana_legacy_dashboard_only_user"], | ||
roles: ['kibana_legacy_dashboard_only_user'], | ||
full_name: 'a kibana legacy dashboard only user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
|
@@ -139,17 +137,17 @@ export const createUsersAndRoles = async (es, supertest) => { | |
roles: ['kibana_dual_privileges_user'], | ||
full_name: 'a kibana dual_privileges user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
username: AUTHENTICATION.KIBANA_DUAL_PRIVILEGES_DASHBOARD_ONLY_USER.USERNAME, | ||
body: { | ||
password: AUTHENTICATION.KIBANA_DUAL_PRIVILEGES_DASHBOARD_ONLY_USER.PASSWORD, | ||
roles: ["kibana_dual_privileges_dashboard_only_user"], | ||
roles: ['kibana_dual_privileges_dashboard_only_user'], | ||
full_name: 'a kibana dual_privileges dashboard only user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
|
@@ -159,17 +157,17 @@ export const createUsersAndRoles = async (es, supertest) => { | |
roles: ['kibana_rbac_user'], | ||
full_name: 'a kibana user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
username: AUTHENTICATION.KIBANA_RBAC_DASHBOARD_ONLY_USER.USERNAME, | ||
body: { | ||
password: AUTHENTICATION.KIBANA_RBAC_DASHBOARD_ONLY_USER.PASSWORD, | ||
roles: ["kibana_rbac_dashboard_only_user"], | ||
roles: ['kibana_rbac_dashboard_only_user'], | ||
full_name: 'a kibana dashboard only user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
|
@@ -179,7 +177,7 @@ export const createUsersAndRoles = async (es, supertest) => { | |
roles: ['kibana_rbac_default_space_all_user'], | ||
full_name: 'a kibana default space all user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
|
@@ -189,7 +187,7 @@ export const createUsersAndRoles = async (es, supertest) => { | |
roles: ['kibana_rbac_default_space_read_user'], | ||
full_name: 'a kibana default space read-only user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
|
@@ -199,7 +197,7 @@ export const createUsersAndRoles = async (es, supertest) => { | |
roles: ['kibana_rbac_space_1_all_user'], | ||
full_name: 'a kibana rbac space 1 all user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
|
||
await es.shield.putUser({ | ||
|
@@ -209,6 +207,6 @@ export const createUsersAndRoles = async (es, supertest) => { | |
roles: ['kibana_rbac_space_1_read_user'], | ||
full_name: 'a kibana rbac space 1 read-only user', | ||
email: '[email protected]', | ||
} | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.