Skip to content

Commit

Permalink
Remove service accounts from Main (#2041)
Browse files Browse the repository at this point in the history
  • Loading branch information
derek-ho authored Jul 18, 2024
1 parent 0592b68 commit c523578
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 714 deletions.
8 changes: 5 additions & 3 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ Next, go to the base directory (`cd ../..`) and run `yarn osd bootstrap` to inst
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`.
## Integration Tests
## Testing
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.
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
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.
### Integration Tests
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`.
## Submitting Changes
Expand Down
1 change: 0 additions & 1 deletion common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export enum AuthType {
export enum ResourceType {
roles = 'roles',
users = 'users',
serviceAccounts = 'serviceAccounts',
permissions = 'permissions',
tenants = 'tenants',
tenantsManageTab = 'tenantsManageTab',
Expand Down
13 changes: 0 additions & 13 deletions public/apps/configuration/app-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import { RoleEditMappedUser } from './panels/role-mapping/role-edit-mapped-user'
import { RoleView } from './panels/role-view/role-view';
import { TenantList } from './panels/tenant-list/tenant-list';
import { UserList } from './panels/user-list';
import { ServiceAccountList } from './panels/service-account-list';
import { Action, RouteItem, SubAction } from './types';
import { ResourceType } from '../../../common';
import { buildHashUrl, buildUrl } from './utils/url-builder';
Expand All @@ -58,10 +57,6 @@ const ROUTE_MAP: { [key: string]: RouteItem } = {
name: 'Internal users',
href: buildUrl(ResourceType.users),
},
[ResourceType.serviceAccounts]: {
name: 'Service Accounts',
href: buildUrl(ResourceType.serviceAccounts),
},
[ResourceType.permissions]: {
name: 'Permissions',
href: buildUrl(ResourceType.permissions),
Expand Down Expand Up @@ -90,7 +85,6 @@ const getRouteList = (multitenancyEnabled: boolean) => {
ROUTE_MAP[ResourceType.auth],
ROUTE_MAP[ResourceType.roles],
ROUTE_MAP[ResourceType.users],
ROUTE_MAP[ResourceType.serviceAccounts],
ROUTE_MAP[ResourceType.permissions],
...(multitenancyEnabled ? [ROUTE_MAP[ResourceType.tenants]] : []),
ROUTE_MAP[ResourceType.auditLogging],
Expand Down Expand Up @@ -234,13 +228,6 @@ export function AppRouter(props: AppDependencies) {
return <UserList {...props} />;
}}
/>
<Route
path={ROUTE_MAP.serviceAccounts.href}
render={() => {
setGlobalBreadcrumbs(ResourceType.serviceAccounts);
return <ServiceAccountList {...props} />;
}}
/>
<Route
path={buildUrl(ResourceType.auditLogging) + SUB_URL_FOR_GENERAL_SETTINGS_EDIT}
render={() => {
Expand Down
2 changes: 0 additions & 2 deletions public/apps/configuration/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export const API_ENDPOINT_MULTITENANCY = API_PREFIX + '/multitenancy/tenant';
export const API_ENDPOINT_TENANCY_CONFIGS = API_ENDPOINT + '/tenancy/config';
export const API_ENDPOINT_SECURITYCONFIG = API_ENDPOINT + '/securityconfig';
export const API_ENDPOINT_INTERNALUSERS = API_ENDPOINT + '/internalusers';
export const API_ENDPOINT_INTERNALACCOUNTS = API_ENDPOINT + '/internalaccounts';
export const API_ENDPOINT_SERVICEACCOUNTS = API_ENDPOINT + '/serviceaccounts';
export const API_ENDPOINT_AUDITLOGGING = API_ENDPOINT + '/audit';
export const API_ENDPOINT_AUDITLOGGING_UPDATE = API_ENDPOINT_AUDITLOGGING + '/config';
export const API_ENDPOINT_PERMISSIONS_INFO = API_PREFIX + '/restapiinfo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ export function RoleEditMappedUser(props: RoleEditMappedUserProps) {
React.useEffect(() => {
const fetchInternalUserNames = async () => {
try {
setUserNames(
await fetchUserNameList(props.coreStart.http, ResourceType.users, dataSource.id)
);
setUserNames(await fetchUserNameList(props.coreStart.http, dataSource.id));
} catch (e) {
addToast(createUnknownErrorToast('fetchInternalUserNames', 'load data'));
console.error(e);
Expand Down
248 changes: 0 additions & 248 deletions public/apps/configuration/panels/service-account-list.tsx

This file was deleted.

This file was deleted.

Loading

0 comments on commit c523578

Please sign in to comment.