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

chore: Apply Bitbucket SAAS Oauth flow #329

Merged
merged 5 commits into from
Jul 27, 2022
Merged

chore: Apply Bitbucket SAAS Oauth flow #329

merged 5 commits into from
Jul 27, 2022

Conversation

vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Jul 15, 2022

Signed-off-by: Igor Vinokur ivinokur@redhat.com

What does this PR do?

Since we support only Bitbucket Server Oauth flow, added a support for the SAAS version

depends on eclipse-che/che-operator#1445

Screenshot/screencast of this PR

What issues does this PR fix or reference?

eclipse-che/che#21517

How to test this PR?

  1. Deploy Eclipse che with the PR image and specific operator image: chectl server:deploy -p=openshift --che-operator-image=quay.io/ivinokur/che-operator:next -i=quay.io/ivinokur/che-server:next
  2. Create an oauth application in your Bitbucket account: https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/
    Set <eclipse-che endpoint>/api/oauth/callback as a Callback URL
    Set all Account and Repository permissions
  3. Create bitbucket oauth secret in the che-server namespace:
kind: Secret
apiVersion: v1
metadata:
  name: bitbucket-oauth-config
  namespace: eclipse-che
  labels:
    app.kubernetes.io/component: oauth-scm-configuration
    app.kubernetes.io/part-of: che.eclipse.org
  annotations:
    che.eclipse.org/oauth-scm-server: bitbucket
data:
  id:<base 64 encoded client id from the bitbucket oauth consummer>
  secret: <base 64 encoded secret from the bitbucket oauth consummer>
type: Opaque
  1. Try to create a factory from a private bitbucket repository.

PR Checklist

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

Reviewers

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

Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
Copy link
Contributor

@svor svor left a comment

Choose a reason for hiding this comment

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

I've added a few small remarks.

Also it was tested on OS 4.10 and it works as expected:

  • I was redirected to the Bitbucket authentication page:
    screenshot-bitbucket org-2022 07 25-15_24_14

  • As a result my private project was cloned:
    screenshot-eclipse-che apps ci-ln-hlz9d1t-72292 origin-ci-int-gce dev rhcloud com-2022 07 25-14_41_38

Just one strange behavior:
If set all permissions in the Bitbucket application:
screenshot-bitbucket org-2022 07 25-14_53_31
Workspace won't start:
screenshot-eclipse-che apps ci-ln-hlz9d1t-72292 origin-ci-int-gce dev rhcloud com-2022 07 25-14_55_06

But i don't think it's related to the current changes

@vinokurig
Copy link
Contributor Author

@svor

Just one strange behavior:
If set all permissions in the Bitbucket application:

Thank you for the catch, I will clarify this in the documentation part.

@vinokurig vinokurig merged commit e59d23b into main Jul 27, 2022
@vinokurig vinokurig deleted the che-21517 branch July 27, 2022 09:24
@che-bot che-bot added this to the 7.52 milestone Jul 27, 2022
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.

4 participants