Skip to content

Commit

Permalink
chore: Propagate Bitbucket SAAS Oauth secret properties
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Vinokur <[email protected]>
  • Loading branch information
vinokurig committed Jul 18, 2022
1 parent 35bd691 commit c3cf300
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 14 additions & 12 deletions pkg/common/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,20 @@ const (
DefaultCheServiceAccountName = "che"

// OAuth
BitBucketOAuthConfigMountPath = "/che-conf/oauth/bitbucket"
BitBucketOAuthConfigPrivateKeyFileName = "private.key"
BitBucketOAuthConfigConsumerKeyFileName = "consumer.key"
GitHubOAuthConfigMountPath = "/che-conf/oauth/github"
GitHubOAuthConfigClientIdFileName = "id"
GitHubOAuthConfigClientSecretFileName = "secret"
GitLabOAuthConfigMountPath = "/che-conf/oauth/gitlab"
GitLabOAuthConfigClientIdFileName = "id"
GitLabOAuthConfigClientSecretFileName = "secret"
OAuthScmConfiguration = "oauth-scm-configuration"
AccessToken = "access_token"
IdToken = "id_token"
BitBucketOAuthConfigClientIdFileName = "id"
BitBucketOAuthConfigClientSecretFileName = "secret"
BitBucketOAuthConfigMountPath = "/che-conf/oauth/bitbucket"
BitBucketOAuthConfigPrivateKeyFileName = "private.key"
BitBucketOAuthConfigConsumerKeyFileName = "consumer.key"
GitHubOAuthConfigMountPath = "/che-conf/oauth/github"
GitHubOAuthConfigClientIdFileName = "id"
GitHubOAuthConfigClientSecretFileName = "secret"
GitLabOAuthConfigMountPath = "/che-conf/oauth/gitlab"
GitLabOAuthConfigClientIdFileName = "id"
GitLabOAuthConfigClientSecretFileName = "secret"
OAuthScmConfiguration = "oauth-scm-configuration"
AccessToken = "access_token"
IdToken = "id_token"

// Labels
KubernetesComponentLabelKey = "app.kubernetes.io/component"
Expand Down
2 changes: 2 additions & 0 deletions pkg/deploy/server/server_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ func MountBitBucketOAuthConfig(ctx *chetypes.DeployContext, deployment *appsv1.D
mountVolumes(deployment, secret, constants.BitBucketOAuthConfigMountPath)
mountEnv(deployment, "CHE_OAUTH1_BITBUCKET_CONSUMERKEYPATH", constants.BitBucketOAuthConfigMountPath+"/"+constants.BitBucketOAuthConfigConsumerKeyFileName)
mountEnv(deployment, "CHE_OAUTH1_BITBUCKET_PRIVATEKEYPATH", constants.BitBucketOAuthConfigMountPath+"/"+constants.BitBucketOAuthConfigPrivateKeyFileName)
mountEnv(deployment, "CHE_OAUTH2_BITBUCKET_CLIENTID__FILEPATH", constants.BitBucketOAuthConfigMountPath+"/"+constants.BitBucketOAuthConfigClientIdFileName)
mountEnv(deployment, "CHE_OAUTH2_BITBUCKET_CLIENTSECRET__FILEPATH", constants.BitBucketOAuthConfigMountPath+"/"+constants.BitBucketOAuthConfigClientSecretFileName)

oauthEndpoint := secret.Annotations[constants.CheEclipseOrgScmServerEndpoint]
if oauthEndpoint != "" {
Expand Down

0 comments on commit c3cf300

Please sign in to comment.