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

fix(auth): render username in top bar #1264

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

andrewazores
Copy link
Member

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Fixes cryostatio/cryostat#489
Related to cryostatio/cryostat#490

Description of the change:

If the response from the server includes the Gap-Auth header, use that to determine the user's logged in username. If not, fall back to using the POST /api/v2.1/auth response body. If anything is blank or fails then use the empty string, which the UI already renders as the anonymous user icon.

How to manually test:

  1. Check out cryostat3 and build with this PR
  2. ./smoketest.bash -O
  3. Verify that the username user appears on the top bar
  4. Restart smoketest as ./smoketest.bash -Op to disable the auth proxy
  5. Verify that the anonymous user icon appears on the top bar

Copy link
Contributor

@aali309 aali309 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@aali309
Copy link
Contributor

aali309 commented Jun 3, 2024

/build_test

Copy link

github-actions bot commented Jun 3, 2024

Test image available:

CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat-web:pr-1264-c77ea3822e750350a4c14cc14ff9dc0d4d49640a bash smoketest.bash # then open http://localhost:8080

@andrewazores andrewazores merged commit 056ebf8 into cryostatio:main Jun 3, 2024
18 checks passed
@andrewazores andrewazores deleted the top-bar-username branch June 3, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Application does not show logged in username
2 participants