Skip to content

Commit d45a296

Browse files
authoredJul 18, 2024
Merge branch 'main' into nav-change
2 parents 65b8ab8 + fe847af commit d45a296

18 files changed

+236
-728
lines changed
 

‎DEVELOPER_GUIDE.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ Next, go to the base directory (`cd ../..`) and run `yarn osd bootstrap` to inst
9292
9393
From the base directory, run `yarn start`. This should start dashboard UI successfully. `Cmd+click` the url in the console output (It should look something like `http://0:5601/omf`). Once the page loads, you should be able to log in with user `admin` and password `admin`.
9494
95-
## Integration Tests
95+
## Testing
9696
97-
To run selenium based integration tests, download and export the firefox web-driver to your PATH. Also, run `node scripts/build_opensearch_dashboards_platform_plugins.js` or `yarn start` before running the tests. This is essential to generate the bundles.
97+
The security-dashboards-plugin project uses Jest for unit and integration tests and Cypress for end to end tests. To run frontend unit tests run `yarn test:jest_ui`. To run Cypress tests that live in this repo either use `yarn cypress:run` or `yarn cypress:open`. To run the Cypress tests that live in the [OpenSearch Dashboards Functional Test]( https://github.com/opensearch-project/opensearch-dashboards-functional-test) project first make sure you have OpenSearch and OpenSearch Dashboards running with the Security Plugin and that you can log in to it using a web browser. Then clone [OpenSearch Dashboards Functional Test]( https://github.com/opensearch-project/opensearch-dashboards-functional-test) in your local machine and follow the instructions in its DEVELOPER_GUIDE.md
9898
99-
The integration tests take advantage of [npm "pre" scripts](https://docs.npmjs.com/cli/v9/using-npm/scripts) to run a node based SAML IdP for integration tests related to SAML authentication. This will run a background process that listens on port 7000.
99+
### Integration Tests
100+
101+
The integration tests take advantage of [npm "pre" scripts](https://docs.npmjs.com/cli/v9/using-npm/scripts) to run a node based SAML IdP for integration tests related to SAML authentication. This will run a background process that listens on port 7000. Then run `yarn test:jest_server`.
100102
101103
## Submitting Changes
102104

‎common/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export enum AuthType {
7070
export enum ResourceType {
7171
roles = 'roles',
7272
users = 'users',
73-
serviceAccounts = 'serviceAccounts',
7473
permissions = 'permissions',
7574
tenants = 'tenants',
7675
tenantsManageTab = 'tenantsManageTab',

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@hapi/cryptiles": "5.0.0",
4545
"@hapi/wreck": "^17.1.0",
4646
"html-entities": "1.3.1",
47+
"proxy-agent": "^6.4.0",
4748
"zxcvbn": "^4.4.2"
4849
},
4950
"resolutions": {

‎public/apps/configuration/app-router.tsx

-13
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import { RoleEditMappedUser } from './panels/role-mapping/role-edit-mapped-user'
3636
import { RoleView } from './panels/role-view/role-view';
3737
import { TenantList } from './panels/tenant-list/tenant-list';
3838
import { UserList } from './panels/user-list';
39-
import { ServiceAccountList } from './panels/service-account-list';
4039
import { Action, RouteItem, SubAction } from './types';
4140
import { ResourceType } from '../../../common';
4241
import { buildHashUrl, buildUrl } from './utils/url-builder';
@@ -58,10 +57,6 @@ export const ROUTE_MAP: { [key: string]: RouteItem } = {
5857
name: 'Internal users',
5958
href: buildUrl(ResourceType.users),
6059
},
61-
[ResourceType.serviceAccounts]: {
62-
name: 'Service Accounts',
63-
href: buildUrl(ResourceType.serviceAccounts),
64-
},
6560
[ResourceType.permissions]: {
6661
name: 'Permissions',
6762
href: buildUrl(ResourceType.permissions),
@@ -90,7 +85,6 @@ const getRouteList = (multitenancyEnabled: boolean) => {
9085
ROUTE_MAP[ResourceType.auth],
9186
ROUTE_MAP[ResourceType.roles],
9287
ROUTE_MAP[ResourceType.users],
93-
ROUTE_MAP[ResourceType.serviceAccounts],
9488
ROUTE_MAP[ResourceType.permissions],
9589
...(multitenancyEnabled ? [ROUTE_MAP[ResourceType.tenants]] : []),
9690
ROUTE_MAP[ResourceType.auditLogging],
@@ -234,13 +228,6 @@ export function AppRouter(props: AppDependencies) {
234228
return <UserList {...props} />;
235229
}}
236230
/>
237-
<Route
238-
path={ROUTE_MAP.serviceAccounts.href}
239-
render={() => {
240-
setGlobalBreadcrumbs(ResourceType.serviceAccounts);
241-
return <ServiceAccountList {...props} />;
242-
}}
243-
/>
244231
<Route
245232
path={buildUrl(ResourceType.auditLogging) + SUB_URL_FOR_GENERAL_SETTINGS_EDIT}
246233
render={() => {

‎public/apps/configuration/constants.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ export const API_ENDPOINT_MULTITENANCY = API_PREFIX + '/multitenancy/tenant';
2525
export const API_ENDPOINT_TENANCY_CONFIGS = API_ENDPOINT + '/tenancy/config';
2626
export const API_ENDPOINT_SECURITYCONFIG = API_ENDPOINT + '/securityconfig';
2727
export const API_ENDPOINT_INTERNALUSERS = API_ENDPOINT + '/internalusers';
28-
export const API_ENDPOINT_INTERNALACCOUNTS = API_ENDPOINT + '/internalaccounts';
29-
export const API_ENDPOINT_SERVICEACCOUNTS = API_ENDPOINT + '/serviceaccounts';
3028
export const API_ENDPOINT_AUDITLOGGING = API_ENDPOINT + '/audit';
3129
export const API_ENDPOINT_AUDITLOGGING_UPDATE = API_ENDPOINT_AUDITLOGGING + '/config';
3230
export const API_ENDPOINT_PERMISSIONS_INFO = API_PREFIX + '/restapiinfo';

‎public/apps/configuration/panels/role-mapping/role-edit-mapped-user.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ export function RoleEditMappedUser(props: RoleEditMappedUserProps) {
9191
React.useEffect(() => {
9292
const fetchInternalUserNames = async () => {
9393
try {
94-
setUserNames(
95-
await fetchUserNameList(props.coreStart.http, ResourceType.users, dataSource.id)
96-
);
94+
setUserNames(await fetchUserNameList(props.coreStart.http, dataSource.id));
9795
} catch (e) {
9896
addToast(createUnknownErrorToast('fetchInternalUserNames', 'load data'));
9997
console.error(e);

‎public/apps/configuration/panels/service-account-list.tsx

-248
This file was deleted.

‎public/apps/configuration/panels/test/__snapshots__/service-account-list.test.tsx.snap

-37
This file was deleted.

0 commit comments

Comments
 (0)