Skip to content

Treat azure devops redirect response as unauthorized error#755

Merged
vinokurig merged 2 commits intomainfrom
CRW-7941
Jan 24, 2025
Merged

Treat azure devops redirect response as unauthorized error#755
vinokurig merged 2 commits intomainfrom
CRW-7941

Conversation

@vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Jan 22, 2025

What does this PR do?

Handle the 302 redirect response in the azure devops api client and throw unauthorized exception, so the dashboard can handle it properly. Also add 401 unauthorized and 403 forbidden to the unauthorized case.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-7941

How to test this PR?

  1. Deploy che with the pull request image: quay.io/eclipse/che-server:pr-755.
  2. Setup Azure Devops oauth.
  3. Start a workspace from an Azure repository with a devfile, consent the authentication request.
  4. See: Azure devops token is added to the user preferences tokens page.
  5. Go to openshift console -> user namespace and edith the personal access token secret token, so it would become invalid.
  6. Go to the dashboard user preferences page and see: the Azure Devops token is removed.

PR Checklist

As the author of this Pull Request I made sure that:

Release Notes

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@vinokurig
Copy link
Contributor Author

/retest

1 similar comment
@vinokurig
Copy link
Contributor Author

/retest

@openshift-ci openshift-ci bot removed the lgtm label Jan 23, 2025
@vinokurig
Copy link
Contributor Author

/retest

Copy link
Contributor

@SkorikSergey SkorikSergey left a comment

Choose a reason for hiding this comment

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

All Azure factories with OAuth test-cases passed successfully with this fix

@openshift-ci
Copy link

openshift-ci bot commented Jan 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: SkorikSergey, tolusha, vinokurig

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vinokurig vinokurig merged commit c2a6c50 into main Jan 24, 2025
6 of 7 checks passed
@vinokurig vinokurig deleted the CRW-7941 branch January 24, 2025 10:22
@devspacesbuild
Copy link

Build 3.19 :: server_3.x/379: Console, Changes, Git Data

vinokurig added a commit that referenced this pull request Jan 24, 2025
Handle the 302 redirect response in the azure devops api client and throw unauthorized exception, so the dashboard can handle it properly. Also add 401 unauthorized and 403 forbidden to the unauthorized case.
@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.19 :: server_3.x/379: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/8620 triggered

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.19 :: get-sources-rhpkg-container-build_3.x/8729: FAILURE

devspaces-operator-bundle : 3.x :: Failed in 66476777 : BREW:BUILD/STATUS:UNKNOWN
FAILURE:; copied to quay

vinokurig added a commit that referenced this pull request Jan 24, 2025
Handle the 302 redirect response in the azure devops api client and throw unauthorized exception, so the dashboard can handle it properly. Also add 401 unauthorized and 403 forbidden to the unauthorized case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants