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

Remove implicit dependency to admin as password #1855

Merged
merged 10 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/run-cypress-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ runs:
if: ${{ runner.os == 'Linux' }}
run: |
cd ./OpenSearch-Dashboards/plugins/security-dashboards-plugin
yarn pretest:jest_server
yarn runIdp
shell: bash

- name: Run OpenSearch Dashboards with provided configuration
Expand Down
26 changes: 5 additions & 21 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
TEST_BROWSER_HEADLESS: 1
CI: 1
PLUGIN_NAME: opensearch-security
OPENSEARCH_INITIAL_ADMIN_PASSWORD: admin
OPENSEARCH_INITIAL_ADMIN_PASSWORD: myStrongPassword123!
derek-ho marked this conversation as resolved.
Show resolved Hide resolved

jobs:
tests:
Expand Down Expand Up @@ -34,24 +34,6 @@ jobs:
echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV
shell: bash

- uses: browser-actions/[email protected]
derek-ho marked this conversation as resolved.
Show resolved Hide resolved
- run: geckodriver --version

- name: Set up Firefox browser
if: ${{ runner.os == 'Linux' }}
uses: browser-actions/setup-firefox@v1

- run: firefox --version
if: ${{ runner.os == 'Linux' }}

# Browser-action version does not work on Windows
- name: Set up Firefox browser for Windows
if: ${{ runner.os == 'Windows' }}
uses: RyanL1997/setup-browser@main
with:
browser: firefox
version: latest

- name: Download security plugin and create setup scripts
uses: ./.github/actions/download-plugin
with:
Expand Down Expand Up @@ -91,13 +73,15 @@ jobs:
run: |
echo "check if opensearch is ready"
curl -XGET https://localhost:9200 -u 'admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }}' -k
yarn test:jest_server --coverage
ADMIN_PASSWORD=${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} yarn test:jest_server --coverage
shell: bash
working-directory: ${{ steps.install-dashboards.outputs.plugin-directory }}

- name: Run integration tests on Windows
if: ${{ runner.os == 'Windows' }}
run: |
echo "check if opensearch is ready"
curl -XGET https://localhost:9200 -u 'admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }}' -k
node .\test\run_jest_tests.js --runInBand --detectOpenHandles --forceExit --config .\test\jest.config.server.js
export ADMIN_PASSWORD=${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} && node ./test/run_jest_tests.js --runInBand --detectOpenHandles --forceExit --config ./test/jest.config.server.js
shell: bash
working-directory: ${{ steps.install-dashboards.outputs.plugin-directory }}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"lint:es": "node ../../scripts/eslint",
"lint:style": "node ../../scripts/stylelint",
"lint": "yarn run lint:es && yarn run lint:style",
"pretest:jest_server": "node ./test/jest_integration/runIdpServer.js &",
"test:jest_server": "node ./test/run_jest_tests.js --config ./test/jest.config.server.js",
"runIdp": "node ./test/jest_integration/runIdpServer.js &",
"test:jest_server": "ADMIN_PASSWORD=$ADMIN_PASSWORD node ./test/run_jest_tests.js --config ./test/jest.config.server.js",
"test:jest_ui": "node ./test/run_jest_tests.js --config ./test/jest.config.ui.js",
"prepare": "husky install"
},
Expand Down
2 changes: 1 addition & 1 deletion test/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ELASTICSEARCH_VERSION: string = opensearchDashboards.version;
export const SECURITY_ES_PLUGIN_VERSION: string = version;

export const ADMIN_USER: string = 'admin';
export const ADMIN_PASSWORD: string = 'admin';
export const ADMIN_PASSWORD: string = process.env.ADMIN_PASSWORD || 'admin';
const ADMIN_USER_PASS: string = `${ADMIN_USER}:${ADMIN_PASSWORD}`;
export const ADMIN_CREDENTIALS: string = `Basic ${Buffer.from(ADMIN_USER_PASS).toString('base64')}`;
export const AUTHORIZATION_HEADER_NAME: string = 'Authorization';
Loading