Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Wazuh changes #1

Closed
wants to merge 15 commits into from
16 changes: 8 additions & 8 deletions .github/actions/install-dashboards/action.yml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ported to #4

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ runs:
- uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards
repository: opensearch-project/OpenSearch-Dashboards
ref: 'main'
repository: wazuh/wazuh-dashboard
ref: ${{ vars.WZD_REF }}
fetch-depth: 0

- run: mkdir -p plugins
Expand All @@ -52,12 +52,12 @@ runs:
working-directory: ${{ steps.determine-plugin-directory.outputs.plugin-directory }}
shell: bash

- id: branch-switch-if-possible
continue-on-error: true # Defaults onto main if the branch switch doesn't work
if: ${{ steps.osd-version.outputs.osd-version }}
run: git checkout ${{ steps.osd-version.outputs.osd-version }} || git checkout ${{ steps.osd-version.outputs.osd-x-version }}x
working-directory: ./OpenSearch-Dashboards
shell: bash
#- id: branch-switch-if-possible
# continue-on-error: true # Defaults onto main if the branch switch doesn't work
# if: ${{ steps.osd-version.outputs.osd-version }}
# run: git checkout ${{ steps.osd-version.outputs.osd-version }} || git checkout ${{ steps.osd-version.outputs.osd-x-version }}x
# working-directory: ./OpenSearch-Dashboards
# shell: bash

- id: tool-versions
run: |
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/cypress-test.yml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ported to #4

Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.4.1/latest/linux/x64/tar/builds/opensearch/dist/opensearch-min-2.4.1-linux-x64.tar.gz
tar -xzf opensearch-*.tar.gz
rm -f opensearch-*.tar.gz

- name: Download OpenSearch Security Plugin
run: wget -O opensearch-security.zip https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.4.1/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-security-2.4.1.0.zip


- name: Run OpenSearch with plugin
run: |
Expand All @@ -48,23 +48,23 @@ jobs:
EOF
docker run -d -p 9200:9200 -p 9600:9600 -i opensearch-test:latest

- name: Checkout OpenSearch Dashboard
- name: Checkout Wazuh Dashboard
uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards
repository: opensearch-project/OpenSearch-Dashboards
ref: '2.4'
repository: wazuh/wazuh-dashboard
ref: ${{ vars.WZD_REF }}
fetch-depth: 0

- name: Create plugins dir
run: |
cd ./OpenSearch-Dashboards
mkdir -p plugins

- name: Checkout OpenSearch Dashboard Security plugin
uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards/plugins/security-dashboards-plugin
path: OpenSearch-Dashboards/plugins/wazuh-security-dashboards-plugin
ref: ${{ github.ref }}

- name: Check OpenSearch Running
Expand All @@ -76,19 +76,19 @@ jobs:
run: |
echo "::set-output name=node_version::$(cat ./OpenSearch-Dashboards/.node-version)"
echo "::set-output name=yarn_version::$(jq -r '.engines.yarn' ./OpenSearch-Dashboards/package.json)"

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ steps.versions.outputs.node_version }}
registry-url: 'https://registry.npmjs.org'

- name: Install correct yarn version for OpenSearch Dashboards
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions.outputs.yarn_version }}

- name: Check OpenSearch Running
continue-on-error: true
run: curl -XGET https://localhost:9200 -u 'admin:admin' -k
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
id: cypress_version
run: |
echo "::set-output name=cypress_version::$(cat ./${{ env.FTR_PATH }}/package.json | jq '.devDependencies.cypress' | tr -d '"')"

- name: Run tests
uses: cypress-io/github-action@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration-test.yml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ported to #4

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.4.1/latest/linux/x64/tar/builds/opensearch/dist/opensearch-min-2.4.1-linux-x64.tar.gz
tar -xzf opensearch-*.tar.gz
rm -f opensearch-*.tar.gz

- name: Download OpenSearch Security Plugin
run: wget -O opensearch-security.zip https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.4.1/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-security-2.4.1.0.zip


- name: Run OpenSearch with plugin
run: |
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- id: install-dashboards
uses: ./.github/actions/install-dashboards
with:
plugin_name: security-dashboards-plugin
plugin_name: wazuh-security-dashboards-plugin

- name: Start Dashboards in background
run: node scripts/build_opensearch_dashboards_platform_plugins.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ported to #4

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- id: install-dashboards
uses: ./.github/actions/install-dashboards
with:
plugin_name: security-dashboards-plugin
plugin_name: wazuh-security-dashboards-plugin

- name: Run lint
run: yarn lint
Expand Down
2 changes: 1 addition & 1 deletion public/apps/account/account-app.tsx
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ported to #5

Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function setupTopNavButton(coreStart: CoreStart, config: ClientConf
}
}

setShouldShowTenantPopup(shouldShowTenantPopup);
setShouldShowTenantPopup(false);

coreStart.chrome.navControls.registerRight({
// Pin to rightmost, since newsfeed plugin is using 1000, here needs a number > 1000
Expand Down
4 changes: 2 additions & 2 deletions public/apps/account/test/account-app.test.tsx
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ported to #5

Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ describe('Account app', () => {
});
});

it('Should show tenant selection popup when neither securitytenant in url nor saved tenant', (done) => {
it('Should not show tenant selection popup', (done) => {
(getSavedTenant as jest.Mock).mockReturnValueOnce(null);

setupTopNavButton(mockCoreStart, mockConfig as any);

process.nextTick(() => {
expect(getSavedTenant).toBeCalledTimes(1);
expect(setShouldShowTenantPopup).toBeCalledWith(true);
expect(setShouldShowTenantPopup).toBeCalledWith(false);
done();
});
});
Expand Down
7 changes: 3 additions & 4 deletions public/apps/login/login-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from '@elastic/eui';
import { CoreStart } from '../../../../../src/core/public';
import { ClientConfigType } from '../../types';
import defaultBrandImage from '../../assets/opensearch_logo_h.svg';
import defaultBrandImage from '../../assets/ui/wazuh_logo.svg';
import { validateCurrentPassword } from '../../utils/login-utils';
import {
ANONYMOUS_AUTH_LOGIN,
Expand Down Expand Up @@ -250,12 +250,11 @@ export function LoginPage(props: LoginPageDeps) {
)}
<EuiSpacer size="s" />
<EuiText size="m" textAlign="center">
{props.config.ui.basicauth.login.title || 'Log in to OpenSearch Dashboards'}
{props.config.ui.basicauth.login.title || ''}
</EuiText>
<EuiSpacer size="s" />
<EuiText size="s" textAlign="center">
{props.config.ui.basicauth.login.subtitle ||
'If you have forgotten your username or password, contact your system administrator.'}
{props.config.ui.basicauth.login.subtitle || ''}
</EuiText>
<EuiSpacer size="s" />
<EuiForm component="form">
Expand Down
16 changes: 4 additions & 12 deletions public/apps/login/test/__snapshots__/login-page.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,14 @@ exports[`Login page renders renders with default value: string 1`] = `
<EuiText
size="m"
textAlign="center"
>
Log in to OpenSearch Dashboards
</EuiText>
/>
<EuiSpacer
size="s"
/>
<EuiText
size="s"
textAlign="center"
>
If you have forgotten your username or password, contact your system administrator.
</EuiText>
/>
<EuiSpacer
size="s"
/>
Expand Down Expand Up @@ -477,18 +473,14 @@ exports[`Login page renders renders with default value: string array 1`] = `
<EuiText
size="m"
textAlign="center"
>
Log in to OpenSearch Dashboards
</EuiText>
/>
<EuiSpacer
size="s"
/>
<EuiText
size="s"
textAlign="center"
>
If you have forgotten your username or password, contact your system administrator.
</EuiText>
/>
<EuiSpacer
size="s"
/>
Expand Down
Loading