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

SAML Integration Tests #1088

Merged
merged 46 commits into from
Sep 19, 2022
Merged

SAML Integration Tests #1088

merged 46 commits into from
Sep 19, 2022

Conversation

expani
Copy link
Contributor

@expani expani commented Aug 30, 2022

Description

Adds integration tests using selenium web driver for SAML Authentication flows

Category

Integration Tests

What is the old behavior before changes and new behavior after changes?

Integration test were not included.

Issues Resolved

Integration tests for fixes #1058 and #1039

Duplicate of the previous PR #1044

Testing

Integration tests are present in the file saml_auth.test.ts

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

devardee and others added 8 commits August 30, 2022 23:00
… driver

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
…ation in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
…ation in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
@expani
Copy link
Contributor Author

expani commented Aug 30, 2022

@peternied The integration tests keep failing because of an issue we have observed during testing as well.
FailedWorkflow

For local testing we performed the following steps :

  • Start and stop the OpenSearch Dashboard Server using yarn start
  • Run the integration tests using yarn test:jest_server

If we don't run yarn start after a fresh checkout, then the Selenium Web-driver throws up an error ( attached SS ) after logging in via IDP.

Screenshot 2022-08-30 at 2 43 41 PM

A naive solution is to start and stop the OpenSearch Dashboard Server before this

Could you share some insights on what exactly could be causing this ?

@expani
Copy link
Contributor Author

expani commented Aug 31, 2022

I have identified the issue for the integration tests failing in Github Actions workflow.

Enabled verbose logging for OSD Server.

logging: {
  silent: false,
  verbose: true
}

Checked out the security-dashboard-plugin and ran yarn osd bootstrap

Ran the jest Integration tests using the command yarn test:jest_server with headless mode disabled for the Selenium web-driver.

When the tests ran, all the ITs failed as after SAML login the error page attached in previous comment was thrown. Upon checking the logs, I could see lot of calls to fetch plugin bundles were failing with the 404 response code.

Screenshot 2022-08-31 at 11 12 44 PM

Checked around OSD Server code base and found that build_opensearch_dashboards_platform_plugins gets invoked for generating these plugins when yarn start command is called.

So, ran the command node scripts/build_opensearch_dashboards_platform_plugins.js after yarn osd bootstrap before starting the Integration tests. The entire suite of selenium web-driver based tests ran without any hiccups.

In order, to make the same run in Github Actions, I think we can add the following line before this

node ./OpenSearch-Dashboards/scripts/build_opensearch_dashboards_platform_plugins.js

This will ensure that all integration tests using selenium web driver with security-dashboards-plugin work seamlessly in the future.

Signed-off-by: Aniketh Jain <anijainc@amazon.com>
@expani expani marked this pull request as ready for review September 1, 2022 06:34
@expani expani requested a review from a team September 1, 2022 06:34
Removed a comment no longer required

Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2022

Codecov Report

Merging #1088 (f247dbb) into main (5d018b0) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1088   +/-   ##
=======================================
  Coverage   72.43%   72.43%           
=======================================
  Files          88       88           
  Lines        1919     1919           
  Branches      246      246           
=======================================
  Hits         1390     1390           
  Misses        474      474           
  Partials       55       55           
Impacted Files Coverage Δ
...-plugin/public/apps/account/account-nav-button.tsx 71.42% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
echo -e "\n\nPrinting the Settings"
curl -XGET https://localhost:9200/_cluster/settings?include_defaults=true -u 'admin:admin' -k
echo -e "\nFetching Docker Logs for OS Server\n"
docker logs oss
Copy link
Member

Choose a reason for hiding this comment

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

Are \ns needed from line 117 - 122?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are added for debugging, will remove once the ITs succeed.

@@ -157,6 +157,9 @@ export class SecurityClient {
// location="https://<your-auth-domain.com>/api/saml2/v1/sso?SAMLRequest=<some-encoded-string>"
// requestId="<request_id>"
// '

console.log('Recieved error from authinfo API', error);
Copy link
Member

Choose a reason for hiding this comment

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

Please remove if this is for debugging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are added for debugging, will remove once the ITs succeed.

@@ -20,7 +20,7 @@ import { AUTHORIZATION_HEADER_NAME } from '../constant';

export function extractAuthCookie(response: Response) {
const setCookieHeaders = response.header['set-cookie'] as string[];
let securityAuthCookie: string;
let securityAuthCookie: string | null = null;
Copy link
Member

Choose a reason for hiding this comment

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

Does securityAuthCookie need to be null here? The return value can be undefined.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, since null can valid value for securityAuthCookie

await driver.wait(until.elementsLocated(By.xpath(pageTitleXPath)), 10000);

const cookie = await driver.manage().getCookies();
expect(cookie.length).toEqual(2);
Copy link
Member

@cliu123 cliu123 Sep 1, 2022

Choose a reason for hiding this comment

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

Is the length of the cookie a constant here? alway equals to 2?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, one cookie for set by the idp and one cookie set by the security dashboard plugin. So in total there should be two cookies

Copy link
Member

Choose a reason for hiding this comment

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

It looks like the confusion here is in the variable name cookie. The call to getCookies is returning all cookies that the browser encounters which is multiple cookies in this case. Perhaps we should rename this variable to cookies?

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

In order, to make the same run in Github Actions, I think we can add the following line before this
node ./OpenSearch-Dashboards/scripts/build_opensearch_dashboards_platform_plugins.js
This will ensure that all integration tests using selenium web driver with security-dashboards-plugin work seamlessly in the future.

Sure, if we need to update how the configuration is performed we should do so, it looks this added this to the current changes 👍

In the CI run it looks like there are some failures - it seems like there was several API call failures Recieved error from authinfo API StatusCodeError {... that might indicate there was a problem during the test setup

@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
Copy link
Member

Choose a reason for hiding this comment

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

Let's generate these certs so we don't have to check them into the codebase

@@ -17,6 +17,7 @@
"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 &",
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this start the IDP before all jest tests, could we start it in the setup for the saml_auth.tests.ts?

Copy link
Member

Choose a reason for hiding this comment

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

I'm curious as well, can we spin this up and tear it down as needed for a test or suite of tests?

} catch (error) {
console.log('Got an error!!', error.stack);
}
console.log('The Config Response is : ' + JSON.stringify(config));
Copy link
Member

Choose a reason for hiding this comment

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

This looks like debugging info, is this needed during a standard run to diagnose failures? If not could we remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will remove it post integration tests run successfully.

@@ -0,0 +1,340 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

Previously there was mention of // 1 Integ Test to test Cookie expiry could you include that test as well?

Signed-off-by: Aniketh Jain <anijainc@amazon.com>
@cwperks cwperks merged commit a4fa35d into opensearch-project:main Sep 19, 2022
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1088-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a4fa35d0008b2652c3922f5f2fa814bfa79e0ff3
# Push it to GitHub
git push --set-upstream origin backport/backport-1088-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1088-to-2.x.

@cwperks
Copy link
Member

cwperks commented Sep 19, 2022

Backport to 2.x failed - manually created backport PR: #1104

@cwperks
Copy link
Member

cwperks commented Sep 19, 2022

Automatic backport failed because this PR did not get the backport 2.x label: #1039

cwperks pushed a commit to cwperks/security-dashboards-plugin that referenced this pull request Sep 23, 2022
* Refactor + add support to run saml based integ tests via selenium web driver

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Add plugins.security.unsupported.restapi.allow_securityconfig_modification in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Add one more test

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Added tests for checking tenancy retention after logout in SAML

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Lint formatting fixes

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed unused imports

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Add plugins.security.unsupported.restapi.allow_securityconfig_modification in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Added License header

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added building the plugin bundles while running ITs

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Signed off the commit

Removed a comment no longer required

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added a new stage for debug loggers before cleanup

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added a new stage for debug loggers before cleanup

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added logger to print error recieved from auth info during saml login

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added Docker host N/W Config to allow connection to SAML IDP

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added discovery type config to be single node for passing bootstrap checks

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted run command to see change in error

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Trying with full docker image of OS

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Refactored the integration test yaml to use OS Full Docker image

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed all debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added selfSigned package for generating certs and integrated with saml-idp

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Deleted checked-in key and cert for saml-idp server

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted use of docker image and testing again with manual build

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted use of docker image and testing again with manual build

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Upgraded version from 2.3 to 2.4

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed debug pointers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Commented out failing IT temporarily

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Lint formatting fix

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added the commented failing test back again

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed assertion from test again to make it pass

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Used a better XPath and improved error logging in tests

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed an unused XPath

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added back the assertion for failing IT

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added steps to run Selenium based Integ Tests

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Commented out the test, will re-enable it again in the fix PR

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Parameterized the getDriver function

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Co-authored-by: Deepak Devarakonda <devardee@amazon.com>
(cherry picked from commit a4fa35d)
aoguan1990 pushed a commit to aoguan1990/security-dashboards-plugin that referenced this pull request Sep 26, 2022
* Refactor + add support to run saml based integ tests via selenium web driver

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Add plugins.security.unsupported.restapi.allow_securityconfig_modification in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Add one more test

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Added tests for checking tenancy retention after logout in SAML

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Lint formatting fixes

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed unused imports

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Add plugins.security.unsupported.restapi.allow_securityconfig_modification in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Added License header

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added building the plugin bundles while running ITs

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Signed off the commit

Removed a comment no longer required

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added a new stage for debug loggers before cleanup

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added a new stage for debug loggers before cleanup

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added logger to print error recieved from auth info during saml login

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added Docker host N/W Config to allow connection to SAML IDP

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added discovery type config to be single node for passing bootstrap checks

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted run command to see change in error

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Trying with full docker image of OS

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Refactored the integration test yaml to use OS Full Docker image

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed all debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added selfSigned package for generating certs and integrated with saml-idp

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Deleted checked-in key and cert for saml-idp server

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted use of docker image and testing again with manual build

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted use of docker image and testing again with manual build

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Upgraded version from 2.3 to 2.4

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed debug pointers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Commented out failing IT temporarily

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Lint formatting fix

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added the commented failing test back again

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed assertion from test again to make it pass

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Used a better XPath and improved error logging in tests

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed an unused XPath

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added back the assertion for failing IT

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added steps to run Selenium based Integ Tests

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Commented out the test, will re-enable it again in the fix PR

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Parameterized the getDriver function

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Co-authored-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aozixuan Priscilla Guan <aoguan@amazon.com>
peternied pushed a commit that referenced this pull request Sep 28, 2022
* SAML Integration Tests (#1088)
(cherry picked from commit a4fa35d)

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: anijain-Amazon <110471048+anijain-Amazon@users.noreply.github.com>
@expani expani mentioned this pull request Oct 6, 2022
3 tasks
expani added a commit to expani/security-dashboards-plugin that referenced this pull request Oct 6, 2022
* Refactor + add support to run saml based integ tests via selenium web driver

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Add plugins.security.unsupported.restapi.allow_securityconfig_modification in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Add one more test

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Added tests for checking tenancy retention after logout in SAML

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Lint formatting fixes

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed unused imports

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Add plugins.security.unsupported.restapi.allow_securityconfig_modification in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Added License header

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added building the plugin bundles while running ITs

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Signed off the commit

Removed a comment no longer required

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added a new stage for debug loggers before cleanup

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added a new stage for debug loggers before cleanup

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added logger to print error recieved from auth info during saml login

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added Docker host N/W Config to allow connection to SAML IDP

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added discovery type config to be single node for passing bootstrap checks

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted run command to see change in error

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Trying with full docker image of OS

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Refactored the integration test yaml to use OS Full Docker image

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed all debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added selfSigned package for generating certs and integrated with saml-idp

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Deleted checked-in key and cert for saml-idp server

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted use of docker image and testing again with manual build

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted use of docker image and testing again with manual build

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Upgraded version from 2.3 to 2.4

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed debug pointers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Commented out failing IT temporarily

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Lint formatting fix

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added the commented failing test back again

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed assertion from test again to make it pass

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Used a better XPath and improved error logging in tests

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed an unused XPath

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added back the assertion for failing IT

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added steps to run Selenium based Integ Tests

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Commented out the test, will re-enable it again in the fix PR

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Parameterized the getDriver function

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Co-authored-by: Deepak Devarakonda <devardee@amazon.com>
(cherry picked from commit a4fa35d)
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
expani added a commit to expani/security-dashboards-plugin that referenced this pull request Oct 6, 2022
* Refactor + add support to run saml based integ tests via selenium web driver

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Add plugins.security.unsupported.restapi.allow_securityconfig_modification in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Add one more test

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Added tests for checking tenancy retention after logout in SAML

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Lint formatting fixes

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed unused imports

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Add plugins.security.unsupported.restapi.allow_securityconfig_modification in developer guide

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>

* Added License header

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added building the plugin bundles while running ITs

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Signed off the commit

Removed a comment no longer required

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added debug loggers for checking IT failures

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added a new stage for debug loggers before cleanup

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added a new stage for debug loggers before cleanup

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added logger to print error recieved from auth info during saml login

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added Docker host N/W Config to allow connection to SAML IDP

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added discovery type config to be single node for passing bootstrap checks

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted run command to see change in error

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Trying with full docker image of OS

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Refactored the integration test yaml to use OS Full Docker image

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed all debug loggers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added selfSigned package for generating certs and integrated with saml-idp

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Deleted checked-in key and cert for saml-idp server

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted use of docker image and testing again with manual build

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Reverted use of docker image and testing again with manual build

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Upgraded version from 2.3 to 2.4

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed debug pointers

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Commented out failing IT temporarily

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Lint formatting fix

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added the commented failing test back again

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed assertion from test again to make it pass

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Used a better XPath and improved error logging in tests

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Removed an unused XPath

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added back the assertion for failing IT

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Added steps to run Selenium based Integ Tests

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Commented out the test, will re-enable it again in the fix PR

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

* Parameterized the getDriver function

Signed-off-by: Aniketh Jain <anijainc@amazon.com>

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Co-authored-by: Deepak Devarakonda <devardee@amazon.com>
(cherry picked from commit a4fa35d)
peternied pushed a commit that referenced this pull request Oct 7, 2022
…Authentication flow (#1134)

* SAML Integration Tests (#1088)

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Aniketh Jain <110471048+anijain-Amazon@users.noreply.github.com>
Co-authored-by: Deepak Devarakonda <devardee@amazon.com>

(cherry picked from commit a4fa35d)
(cherry picked from commit 05649d6)
peternied pushed a commit that referenced this pull request Oct 7, 2022
* Fix for Tenancy info getting lost on re-login in SAML Authentication flow #1058
* SAML Integration Tests #1088
* Preserve URL Hash for SAML based login #1054

Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
Co-authored-by: Deepak Devarakonda <devardee@amazon.com>
Co-authored-by: Deepak Devarakonda <80896069+devardee@users.noreply.github.com>

(cherry picked from commit a9d10d8)
(cherry picked from commit a4fa35d)
(cherry picked from commit 05649d6)
@opensearch-trigger-bot
Copy link
Contributor

The backport to 1.3 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.3 1.3
# Navigate to the new working tree
cd .worktrees/backport-1.3
# Create a new branch
git switch --create backport/backport-1088-to-1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a4fa35d0008b2652c3922f5f2fa814bfa79e0ff3
# Push it to GitHub
git push --set-upstream origin backport/backport-1088-to-1.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.3

Then, create a pull request where the base branch is 1.3 and the compare/head branch is backport/backport-1088-to-1.3.

cwperks added a commit that referenced this pull request Dec 1, 2022
* SAML Integration Tests (#1088)

* Preserve URL Hash for SAML based login (#1039)

* Preserve URL HASH after user logs via SAML IDP

Signed-off-by: Deepak Devarakonda <devardee@amazon.com>
Signed-off-by: Aniketh Jain <anijainc@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Co-authored-by: anijain-Amazon <110471048+anijain-Amazon@users.noreply.github.com>
Co-authored-by: Deepak Devarakonda <devardee@amazon.com>
Co-authored-by: Deepak Devarakonda <80896069+devardee@users.noreply.github.com>
Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.3 backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants