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

Switch the home link to logout on security error pages #1564

Merged
merged 19 commits into from
Oct 23, 2023

Conversation

leanneeliatra
Copy link
Contributor

@leanneeliatra leanneeliatra commented Aug 28, 2023

Description

Fix for bug [BUG] missing roles button doesn't do anything #1490

Category

[Bug fix]

Why these changes are required?

The button on the /customerror/missing-role page was not doing anything, it should bring the user back to the dashboard

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

Old behaviour

  1. From the /app/customerror/missing-role screen a button 'Back to OpenSearch dashboards Home ...' did nothing when clicked.

New behaviour

  1. From the /app/customerror/missing-role screen a button 'Back to OpenSearch dashboards Home ...' routes to the app dashboard when clicked

Issues Resolved

[BUG] missing roles button doesn't do anything #1490

Testing

complete
Cypress integration tests added
Unit tests not required, signed off by @peternied
Rigorous manual testing locally complete
[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.

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #1564 (b4d16db) into main (d97192d) will increase coverage by 0.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1564      +/-   ##
==========================================
+ Coverage   67.93%   67.99%   +0.05%     
==========================================
  Files          93       93              
  Lines        2339     2340       +1     
  Branches      317      317              
==========================================
+ Hits         1589     1591       +2     
+ Misses        722      720       -2     
- Partials       28       29       +1     
Files Coverage Δ
public/apps/customerror/custom-error.tsx 25.00% <0.00%> (+25.00%) ⬆️

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.

Thanks for adding this, before we merge could you create/modify a test case that validates the link works?

@leanneeliatra
Copy link
Contributor Author

Thanks for adding this, before we merge could you create/modify a test case that validates the link works?

Yes, for sure Peter thanks. They're in progress I just wanted to submit the changes so far in case there were any comments for the change.

Copy link
Member

@cwperks cwperks left a comment

Choose a reason for hiding this comment

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

Hi @leanneeliatra , from what I understand of the issue the only real action a user with 0 roles could do would be to logout. Reading the comments on the issue, it sounds like the button on that page should be replaced with a logout button. Without a logout button the user would have to clear cookies in the browser to logout.

#1490 (comment)

@cwperks
Copy link
Member

cwperks commented Sep 5, 2023

@leanneeliatra Please see my comment above. From the conversation on the issue, this button should be changed to a logout button.

Hi @leanneeliatra , from what I understand of the issue the only real action a user with 0 roles could do would be to logout. Reading the comments on the issue, it sounds like the button on that page should be replaced with a logout button. Without a logout button the user would have to clear cookies in the browser to logout.

#1490 (comment)

@leanneeliatra
Copy link
Contributor Author

@leanneeliatra Please see my comment above. From the conversation on the issue, this button should be changed to a logout button.

Hi @leanneeliatra , from what I understand of the issue the only real action a user with 0 roles could do would be to logout. Reading the comments on the issue, it sounds like the button on that page should be replaced with a logout button. Without a logout button the user would have to clear cookies in the browser to logout.

#1490 (comment)

Thank you Craig, that's complete

@leanneeliatra
Copy link
Contributor Author

leanneeliatra commented Sep 8, 2023

Hi @peternied I have added the integration tests: opensearch-project/opensearch-dashboards-functional-test#830
There are unit tests covering the logout functionality so that's covered from that aspect.
& I changed the functionality to a logout button cc @cwperks.
That should be everything. Thank you all.

Copy link
Collaborator

@derek-ho derek-ho left a comment

Choose a reason for hiding this comment

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

Other than button text change looks good. Can we change the base branch to main and backport to 2.x?

@derek-ho
Copy link
Collaborator

derek-ho commented Sep 8, 2023

This should also fix: #842

Copy link
Contributor Author

@leanneeliatra leanneeliatra left a comment

Choose a reason for hiding this comment

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

I have added the integration tests @peternied
opensearch-project/opensearch-dashboards-functional-test#830

Unfortunately I'm not sure how to address the '1 change requested: Merging can be performed automatically once the requested changes are addressed.'

Could you accept the changes please? If you are happy with the test linked above? Thank you.

cwperks
cwperks previously approved these changes Sep 8, 2023
peternied
peternied previously approved these changes Sep 11, 2023
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.

Thanks for adding the tests.

@peternied peternied changed the title Rerouting to app/home on button click Switch the home link to logout on security error pages Sep 11, 2023
@peternied peternied changed the base branch from 2.8 to main September 11, 2023 22:39
@peternied peternied dismissed stale reviews from cwperks and themself September 11, 2023 22:39

The base branch was changed.

@peternied
Copy link
Member

I just saw that this PR was pointed to the 2.8 branch, it should go into main, please rebase against main

@leanneeliatra
Copy link
Contributor Author

I just saw that this PR was pointed to the 2.8 branch, it should go into main, please rebase against main

I will indeed thanks @peternied

@leanneeliatra
Copy link
Contributor Author

Hi @leanneeliatra and @peternied . I think the socket failure is related to this issue: cypress-io/cypress-documentation#5483. So it is not from our end. But I can try to fix it by rolling back the chrome driver version.

Thanks for looking into this @RyanL1997 and yes, please do that. It would be great to get this merged in! Thanks.

@leanneeliatra
Copy link
Contributor Author

leanneeliatra commented Oct 4, 2023

Update: frontend pipeline should be fixed, could the checks on this MR be re-run please (I do not have access to do that)
cc @peternied

@leanneeliatra
Copy link
Contributor Author

leanneeliatra commented Oct 5, 2023

I am pulling in @RyanL1997 updates to the CI that will fix my checks on this PR and which will also simultaneously rerun the checks.

peternied and others added 3 commits October 6, 2023 13:33
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
@leanneeliatra
Copy link
Contributor Author

leanneeliatra commented Oct 9, 2023

The main branch has been merged in to my own branch but the CI is still failing, I will reach out to @RyanL1997 to discuss/for thoughts.

@leanneeliatra
Copy link
Contributor Author

leanneeliatra commented Oct 10, 2023

Myself and @RyanL1997 are in communication about the cypress tests.

@leanneeliatra
Copy link
Contributor Author

@RyanL1997 is going to have a look at the cypress tests for me (thank you :) )

@RyanL1997
Copy link
Collaborator

RyanL1997 commented Oct 12, 2023

Reference to #1599, the manual testing results:
Screenshot 2023-10-11 at 9 24 53 PM
Screenshot 2023-10-11 at 9 28 03 PM
Screenshot 2023-10-11 at 9 28 56 PM
Screenshot 2023-10-11 at 9 46 02 PM

@leanneeliatra
Copy link
Contributor Author

leanneeliatra commented Oct 12, 2023

Thanks a million @RyanL1997 I really appreciate that!

No further reviews are needed.

@leanneeliatra
Copy link
Contributor Author

Can this be merged please?

@peternied
Copy link
Member

@RyanL1997 could you look into the CI issue?

@leanneeliatra
Copy link
Contributor Author

leanneeliatra commented Oct 23, 2023

Can this be merged please! :) @peternied has previously stated (see comment referenced below) he was happy with the coverage so please merge ASAP. Thank you.

@leanneeliatra
Copy link
Contributor Author

@leanneeliatra I've re-triggered CI test execution, I saw socket failures which would be completely unrelated to your change. @RyanL1997 could you confirm the state of the cypress tests?

Don't worry about that code coverage issue - I am not concerned about that line getting coverage.

Please merge ASAP. Thank you.

@cwperks cwperks added the backport 2.x backport to 2.x branch label Oct 23, 2023
@cwperks cwperks merged commit 27c37d4 into opensearch-project:main Oct 23, 2023
9 of 10 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 23, 2023
* changing return to dashboards with functioning logout button on error page

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
Co-authored-by: Peter Nied <petern@amazon.com>
(cherry picked from commit 27c37d4)
cwperks pushed a commit that referenced this pull request Oct 23, 2023
* changing return to dashboards with functioning logout button on error page

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
Co-authored-by: Peter Nied <petern@amazon.com>
(cherry picked from commit 27c37d4)

Co-authored-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
leanneeliatra added a commit to leanneeliatra/security-dashboards-plugin-fork that referenced this pull request Nov 17, 2023
…oject#1564)

* changing return to dashboards with functioning logout button on error page

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
Co-authored-by: Peter Nied <petern@amazon.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants