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

Replace _opendistro route with _plugins #895

Merged
merged 5 commits into from
May 25, 2022

Conversation

pc-jedi
Copy link
Contributor

@pc-jedi pc-jedi commented Jan 31, 2022

Description

In the documentation for SAML the SSO URL and the white listed URL is already updated to _plugins/_security while the routes in the security plugin still are on _opendistro/_security. That causes a 404 response when trying to login.
This PR changes the route in the plugin and aligns with the documentation.

Category

Bug fix and Documentation

Why these changes are required?

To align with the new naming schema and have it working like it is documented.

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

Before this PR the whitelisted URLs for SSO have to be set to _opendistro/_security/.. also the configuration in the IdP to forward to the correct endpoint had to be _security/saml/acs.

New behavior is that the URLs are now aligned with the documentation.

Issues Resolved

#836

Testing

[Please provide details of testing done: unit testing, integration testing and manual testing]

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.

@pc-jedi
Copy link
Contributor Author

pc-jedi commented Feb 3, 2022

@davidlago Could you have a look, please.

@davidlago
Copy link

This is a breaking change. Even though lagging behind the documentation, we should add the new named endpoint (and preserve the old one as deprecated). We can remove when 2.0 goes out.

@pc-jedi
Copy link
Contributor Author

pc-jedi commented Feb 7, 2022

This is a breaking change. Even though lagging behind the documentation, we should add the new named endpoint (and preserve the old one as deprecated). We can remove when 2.0 goes out.

Makes sense. Do you know of a functionality to have multiple path defined like with an array, or should I simply do a copy + paste of the 2 routes?

@davidlago
Copy link

@pc-jedi
Copy link
Contributor Author

pc-jedi commented Feb 8, 2022

It looks like it is just a single value: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/http/router/router.ts#L58

Ok, then I will try to figure out a way to move the handler function into a separate function. Only problem I see is that we would need to bind the this and that the function parameter cannot have type inference and we have to specify the type explicit. If this would be ok, I'll change the PR towards that.

@davidlago
Copy link

UTs failing and it looks like this change that was breaking in 2.0 is affecting us here. It should be a quick fix, making the license field an array like in the link above.

@davidlago
Copy link

Please provide details as to how this was tested, thanks!

@pc-jedi
Copy link
Contributor Author

pc-jedi commented Mar 10, 2022

Please provide details as to how this was tested, thanks!

Sorry for taking so long.
I had setup a local SAML IdP in a Docker container together with OpenSearch with security plugin and the OpenSearch Dashboards with a version of the plugin. Then I tested both URLs as endpoint to check if both are still working, which was the case.
I will fix the merge conflicts. Anything else I should take care of?

@davidlago
Copy link

@pc-jedi thanks for the help! I am sorry for the back and forth, but we are already starting to build 2.0 in main as we are trying to get out a preview version by the end of the month. That means that this PR targeting main no longer needs to worry about preserving the old deprecated route. Could you please remove that old route from the PR? Other than that this should be good to merge. Thanks again for the work on this one!!

@pc-jedi pc-jedi closed this Mar 14, 2022
@pc-jedi pc-jedi deleted the fix-routes branch March 14, 2022 14:57
@pc-jedi pc-jedi restored the fix-routes branch March 14, 2022 14:57
@pc-jedi pc-jedi reopened this Mar 14, 2022
@pc-jedi pc-jedi force-pushed the fix-routes branch 2 times, most recently from 8d9426e to b4362b6 Compare March 14, 2022 15:03
@pc-jedi
Copy link
Contributor Author

pc-jedi commented Mar 14, 2022

@davidlago No worries. I have rebased and squash all things together. All routes should now be _plugins/security. Also I replaced some strings with the already existing constants.

@pc-jedi
Copy link
Contributor Author

pc-jedi commented Mar 14, 2022

I guess the integration test failed, because this plugin was just bumped to 1.3.0 and Dashboards 1.x branch is already at 1.4.0?
opensearch-project/OpenSearch-Dashboards#1341

I think we have to wait for #892

@sharvil-parekh
Copy link

Any timelines when the PR will be merged?

@DarshitChanpura
Copy link
Member

I guess the integration test failed, because this plugin was just bumped to 1.3.0 and Dashboards 1.x branch is already at 1.4.0? opensearch-project/OpenSearch-Dashboards#1341

I think we have to wait for #892

There is a new PR for 2.0.0.0 bump: #928

Signed-off-by: Christian Düfel <christian.duefel@sap.com>
@pc-jedi
Copy link
Contributor Author

pc-jedi commented Apr 26, 2022

Rebased. Please have a look again.

@pc-jedi
Copy link
Contributor Author

pc-jedi commented May 4, 2022

Any plans to merge this so we could have this still in for 2.0? Or is it already too late?

@DarshitChanpura
Copy link
Member

This build can be re-run once #989 is merged.

@pc-jedi
Copy link
Contributor Author

pc-jedi commented May 23, 2022

Last build went through. Should I bump it again to latest main?

@JustinasKO
Copy link

JustinasKO commented Jul 12, 2022

FYI: this is breaking change and was included in minor version 2.1.0. Not sure if this is good practice. For minor version both endpoints (_plugins/_security/..., _opendistro/_security/...) should have be left working.
Not to mentions that its not even work with OpenSearch v2.1.0

@devardee
Copy link
Contributor

@cliu123, @peternied we also need to make corresponding changes in the buildAssertionConsumerEndpoint function in the security plugin as well https://github.com/devardee/security-1/blob/be876c0078b23dc6567f6bd2f585d5f14245b201/src/main/java/com/amazon/dlic/auth/http/saml/Saml2SettingsProvider.java#L217-L219

@varun-lodaya
Copy link
Contributor

@cliu123 @peternied are we working on fixing this? Seems this is breaking the SAML flow currently

DarshitChanpura added a commit that referenced this pull request Jul 18, 2022
DarshitChanpura added a commit that referenced this pull request Jul 20, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 20, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 20, 2022
DarshitChanpura added a commit that referenced this pull request Jul 20, 2022
This reverts commit e4e4032.

(cherry picked from commit cc5b763)

Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
DarshitChanpura added a commit that referenced this pull request Jul 20, 2022
This reverts commit e4e4032.

(cherry picked from commit cc5b763)

Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
spartan2015 pushed a commit to spartan2015/security-dashboards-plugin that referenced this pull request Aug 8, 2022
…)" (opensearch-project#1035)

This reverts commit e4e4032.

Signed-off-by: Vasile Negru <vasile@eosfintek.com>
spartan2015 pushed a commit to spartan2015/security-dashboards-plugin that referenced this pull request Aug 8, 2022
…roject#895)" (opensearch-project#1035)"

This reverts commit c456883362610c61fcc5d54b2974d7a5c6327c1d.

Signed-off-by: Vasile Negru <pro@ChooseExcellenc.localdomain>
Signed-off-by: Vasile Negru <vasile@eosfintek.com>
spartan2015 pushed a commit to spartan2015/security-dashboards-plugin that referenced this pull request Aug 8, 2022
…)" (opensearch-project#1035)

This reverts commit e4e4032.

Signed-off-by: Vasile Negru <pro@ChooseExcellenc.localdomain>
Signed-off-by: Vasile Negru <vasile@eosfintek.com>
spartan2015 pushed a commit to spartan2015/security-dashboards-plugin that referenced this pull request Aug 8, 2022
…roject#895)" (opensearch-project#1035)"

This reverts commit c456883362610c61fcc5d54b2974d7a5c6327c1d.

Signed-off-by: Vasile Negru <vasile@eosfintek.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants