Compare commits
16 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
aa213c3003 | |
|
|
88cbaebd1a | |
|
|
e072c7642b | |
|
|
b5f110c659 | |
|
|
95b1c390b2 | |
|
|
858a12b3ff | |
|
|
7c07c3c135 | |
|
|
2cfce0568a | |
|
|
c51919d1e3 | |
|
|
1fc4e07988 | |
|
|
799fcb1d0e | |
|
|
2e27c47f2f | |
|
|
b8e0397b0a | |
|
|
661d852250 | |
|
|
ba6f30f963 | |
|
|
dbe167276a |
|
|
@ -26,4 +26,4 @@ RUN yum install --assumeyes -d1 psmisc python3-pip httpd-tools nodejs && \
|
|||
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
|
||||
chmod +x ./kubectl && \
|
||||
mv ./kubectl /usr/local/bin && \
|
||||
bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next
|
||||
bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next
|
||||
|
|
|
|||
|
|
@ -36,39 +36,47 @@ export CUSTOM_CONFIG_MAP_NAME=${CUSTOM_CONFIG_MAP_NAME:-"custom-ca-certificates"
|
|||
export GIT_SSL_CONFIG_MAP_NAME=${GIT_SSL_CONFIG_MAP_NAME:-"che-self-signed-cert"}
|
||||
|
||||
provisionOpenShiftOAuthUser() {
|
||||
echo -e "[INFO] Provisioning Openshift OAuth user"
|
||||
echo "------- [INFO] Start provisioning Openshift OAuth user -------"
|
||||
htpasswd -c -B -b users.htpasswd ${OCP_ADMIN_USER_NAME} ${OCP_LOGIN_PASSWORD}
|
||||
htpasswd -b users.htpasswd ${OCP_NON_ADMIN_USER_NAME} ${OCP_LOGIN_PASSWORD}
|
||||
oc create secret generic htpass-secret --from-file=htpasswd="users.htpasswd" -n openshift-config
|
||||
oc apply -f ".ci/openshift-ci/htpasswdProvider.yaml"
|
||||
oc adm policy add-cluster-role-to-user cluster-admin ${OCP_ADMIN_USER_NAME}
|
||||
|
||||
echo -e "[INFO] Waiting for htpasswd auth to be working up to 5 minutes"
|
||||
echo "------- [INFO] Waiting for htpasswd auth to be working up to 5 minutes -------"
|
||||
CURRENT_TIME=$(date +%s)
|
||||
ENDTIME=$((CURRENT_TIME + 300))
|
||||
while [ "$(date +%s)" -lt $ENDTIME ]; do
|
||||
if oc login -u=${OCP_ADMIN_USER_NAME} -p=${OCP_LOGIN_PASSWORD} --insecure-skip-tls-verify=false; then
|
||||
break
|
||||
echo "======= [INFO] OpenShift OAuth htpasswd is configured. =======
|
||||
======= [INFO] Login to OCP cluster with admin user credentials is success.======="
|
||||
return 0
|
||||
fi
|
||||
sleep 10
|
||||
sleep 5
|
||||
done
|
||||
|
||||
echo "####### [ERROR] Error occurred while waiting OpenShift OAuth htpasswd setup. Try to rerun test. #######"
|
||||
exit 1
|
||||
}
|
||||
|
||||
configureGitSelfSignedCertificate() {
|
||||
echo "[INFO] Configure self-signed certificate for Git provider"
|
||||
echo "------- [INFO] Configure self-signed certificate for Git provider -------"
|
||||
oc adm new-project ${CHE_NAMESPACE}
|
||||
oc project ${CHE_NAMESPACE}
|
||||
|
||||
echo -e "[INFO] Create ConfigMap with the required TLS certificate"
|
||||
echo "------- [INFO] Create ConfigMap with the required TLS certificate -------"
|
||||
oc create configmap ${CUSTOM_CONFIG_MAP_NAME} --from-file=.ci/openshift-ci/ca.crt
|
||||
oc label configmap ${CUSTOM_CONFIG_MAP_NAME} app.kubernetes.io/part-of=che.eclipse.org app.kubernetes.io/component=ca-bundle
|
||||
|
||||
echo "[INFO] Create ConfigMap to support Git repositories with self-signed certificates"
|
||||
oc create configmap ${GIT_SSL_CONFIG_MAP_NAME} --from-file=.ci/openshift-ci/ca.crt --from-literal=githost=$GIT_PROVIDER_URL
|
||||
echo "------- [INFO] Create ConfigMap to support Git repositories with self-signed certificates -------"
|
||||
oc create configmap ${GIT_SSL_CONFIG_MAP_NAME} --from-file=.ci/openshift-ci/ca.crt --from-literal=githost=${GIT_PROVIDER_URL}
|
||||
oc label configmap ${GIT_SSL_CONFIG_MAP_NAME} app.kubernetes.io/part-of=che.eclipse.org
|
||||
|
||||
echo "======= [INFO] ConfigMaps are configured ======="
|
||||
}
|
||||
|
||||
createCustomResourcesFile() {
|
||||
echo "------- [INFO] Create custom resourses file -------"
|
||||
cat > custom-resources.yaml <<-END
|
||||
apiVersion: org.eclipse.che/v2
|
||||
spec:
|
||||
|
|
@ -76,26 +84,53 @@ spec:
|
|||
maxNumberOfRunningWorkspacesPerUser: 10000
|
||||
END
|
||||
|
||||
echo "Generated custom resources file"
|
||||
echo "======= [INFO] Generated custom resources file ======="
|
||||
cat custom-resources.yaml
|
||||
}
|
||||
|
||||
patchCustomResourcesFile() {
|
||||
echo "------- [INFO] Edit the custom resources file to add 'gitTrustedCertsConfigMapName' -------"
|
||||
yq -y '.spec.devEnvironments.trustedCerts += {"gitTrustedCertsConfigMapName": "'${GIT_SSL_CONFIG_MAP_NAME}'"}' custom-resources.yaml -i
|
||||
|
||||
echo "======= [INFO] Patched custom resources file ======="
|
||||
cat custom-resources.yaml
|
||||
}
|
||||
|
||||
deployChe() {
|
||||
echo "------- [INFO] Start installing Eclipse Che -------"
|
||||
chectl server:deploy --cheimage=$CHE_SERVER_IMAGE \
|
||||
--che-operator-cr-patch-yaml=custom-resources.yaml \
|
||||
--platform=openshift \
|
||||
--telemetry=off \
|
||||
--batch
|
||||
|
||||
waitFinishDeploymentCheServer
|
||||
echo "======= [INFO] Eclipse Che is successfully installed ======="
|
||||
}
|
||||
|
||||
waitFinishDeploymentCheServer() {
|
||||
CURRENT_TIME=$(date +%s)
|
||||
ENDTIME=$((CURRENT_TIME + 60))
|
||||
|
||||
while [ "$(date +%s)" -lt $ENDTIME ]; do
|
||||
podCheServerName=$(oc get pod -n ${CHE_NAMESPACE} -l component=che | grep "che" | awk '{ print $1 }')
|
||||
echo "Pod Che_Server: $podCheServerName"
|
||||
count=$(echo "$podCheServerName" | wc -l)
|
||||
if [ $count -eq 1 ]; then
|
||||
echo "------- [INFO] Only one Che Server pod is left. -------"
|
||||
return 0
|
||||
fi
|
||||
echo "------- [INFO] Waiting until only one Che Server pod remains. -------"
|
||||
sleep 5
|
||||
done
|
||||
|
||||
echo "####### [ERROR] Error occurred while waiting for only one Che Server pod. #######"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# this command starts port forwarding between the local machine and the che-host service in the OpenShift cluster.
|
||||
forwardPortToService() {
|
||||
echo "------- [INFO] Start forwarding between the local machine and the che-host service -------"
|
||||
oc port-forward service/che-host ${CHE_FORWARDED_PORT}:8080 -n ${CHE_NAMESPACE} &
|
||||
sleep 3s
|
||||
}
|
||||
|
|
@ -120,28 +155,28 @@ requestFactoryResolverGitRepoUrl() {
|
|||
|
||||
# check that factory resolver returns correct value without any PAT/OAuth setup
|
||||
testFactoryResolverNoPatOAuth() {
|
||||
echo "[INFO] Check factory resolver for public repository with NO PAT/OAuth setup"
|
||||
echo "------- [INFO] Check factory resolver for public repository with NO PAT/OAuth setup -------"
|
||||
testFactoryResolverResponse $1 200
|
||||
|
||||
echo "[INFO] Check factory resolver for private repository with NO PAT/OAuth setup"
|
||||
echo "------- [INFO] Check factory resolver for private repository with NO PAT/OAuth setup -------"
|
||||
testFactoryResolverResponse $2 500
|
||||
}
|
||||
|
||||
# check that raw devfile url factory resolver returns correct value without any PAT/OAuth setup
|
||||
testFactoryResolverNoPatOAuthRaw() {
|
||||
echo "[INFO] Check factory resolver for public repository with NO PAT/OAuth setup"
|
||||
echo "------- [INFO] Check factory resolver for public repository with NO PAT/OAuth setup -------"
|
||||
testFactoryResolverResponse $1 200
|
||||
|
||||
echo "[INFO] Check factory resolver for private repository with NO PAT/OAuth setup"
|
||||
echo "------- [INFO] Check factory resolver for private repository with NO PAT/OAuth setup -------"
|
||||
testFactoryResolverResponse $2 400
|
||||
}
|
||||
|
||||
# check that factory resolver returns correct value with PAT/OAuth setup
|
||||
testFactoryResolverWithPatOAuth() {
|
||||
echo "[INFO] Check factory resolver for public repository with PAT/OAuth setup"
|
||||
echo "------- [INFO] Check factory resolver for public repository with PAT/OAuth setup -------"
|
||||
testFactoryResolverResponse $1 200
|
||||
|
||||
echo "[INFO] Check factory resolver for private repository with PAT/OAuth setup"
|
||||
echo "------- [INFO] Check factory resolver for private repository with PAT/OAuth setup -------"
|
||||
testFactoryResolverResponse $2 200
|
||||
}
|
||||
|
||||
|
|
@ -149,11 +184,11 @@ testFactoryResolverResponse() {
|
|||
URL=$1
|
||||
RESPONSE_CODE=$2
|
||||
|
||||
echo "[INFO] Check factory resolver"
|
||||
if [ "$(requestFactoryResolverGitRepoUrl ${URL} | grep "HTTP/1.1 ${RESPONSE_CODE}")" ]; then
|
||||
echo "[INFO] Factory resolver returned 'HTTP/1.1 ${RESPONSE_CODE}' status code. Expected client side response."
|
||||
echo "======= [INFO] Factory resolver returned 'HTTP/1.1 ${RESPONSE_CODE}' status code. Expected client side response. ======="
|
||||
else
|
||||
echo "[ERROR] Factory resolver returned wrong status code. Expected: HTTP/1.1 ${RESPONSE_CODE}."
|
||||
echo "####### [ERROR] Factory resolver returned wrong status code. Expected: HTTP/1.1 ${RESPONSE_CODE}. #######
|
||||
####### Cause possible: PR code regress or service is changed. Need to investigate it. #######"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
@ -171,12 +206,19 @@ requestProvisionNamespace() {
|
|||
initUserNamespace() {
|
||||
OCP_USER_NAME=$1
|
||||
|
||||
echo "[INFO] Initialize user namespace"
|
||||
echo "------- [INFO] Initialize user namespace -------"
|
||||
oc login -u=${OCP_USER_NAME} -p=${OCP_LOGIN_PASSWORD} --insecure-skip-tls-verify=false
|
||||
if [ "$(requestProvisionNamespace | grep "HTTP/1.1 200")" ]; then
|
||||
echo "[INFO] Request provision user namespace returned 'HTTP/1.1 200' status code."
|
||||
|
||||
request_result=$(requestProvisionNamespace) || true
|
||||
|
||||
if [ -z "$request_result" ]; then
|
||||
echo "####### [ERROR] Cause possible: lost connection to pod, this is an infrastructure problem. Try to rerun the test. #######"
|
||||
exit 1
|
||||
elif [ "$(echo "$request_result" | grep "HTTP/1.1 200")" ]; then
|
||||
echo "======= [INFO] Request provision user namespace returned 'HTTP/1.1 200' status code. User namespace is created. ======="
|
||||
else
|
||||
echo "[ERROR] Request provision user namespace returned wrong status code. Expected: HTTP/1.1 200"
|
||||
echo "####### [ERROR] Request provision user namespace returned wrong status code. Expected: HTTP/1.1 200. #######
|
||||
####### User namespace creation failed. Cause possible: PR code regression or service is changed. Need to investigate. #######"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
@ -186,7 +228,7 @@ setupPersonalAccessToken() {
|
|||
GIT_PROVIDER_URL=$2
|
||||
GIT_PROVIDER_PAT=$3
|
||||
|
||||
echo "[INFO] Setup Personal Access Token Secret"
|
||||
echo "------- [INFO] Setup Personal Access Token Secret -------"
|
||||
oc project ${USER_CHE_NAMESPACE}
|
||||
CHE_USER_ID=$(oc get secret user-profile -o jsonpath='{.data.id}' | base64 -d)
|
||||
ENCODED_PAT=$(echo -n ${GIT_PROVIDER_PAT} | base64)
|
||||
|
|
@ -205,13 +247,14 @@ setupPersonalAccessToken() {
|
|||
cat pat-secret.yaml
|
||||
|
||||
oc apply -f pat-secret.yaml -n ${USER_CHE_NAMESPACE}
|
||||
echo "======= [INFO] Personal Access Token is created. ======="
|
||||
}
|
||||
|
||||
setupSSHKeyPairs() {
|
||||
GIT_PRIVATE_KEY=$1
|
||||
GIT_PUBLIC_KEY=$2
|
||||
|
||||
echo "[INFO] Setup SSH Key Pairs Secret"
|
||||
echo "------- [INFO] Setup SSH Key Pairs Secret "-------
|
||||
oc project ${USER_CHE_NAMESPACE}
|
||||
ENCODED_GIT_PRIVATE_KEY=$(echo "${GIT_PRIVATE_KEY}" | base64 -w 0)
|
||||
ENCODED_GIT_PUBLIC_KEY=$(echo "${GIT_PUBLIC_KEY}" | base64 -w 0)
|
||||
|
|
@ -224,6 +267,7 @@ setupSSHKeyPairs() {
|
|||
cat ssh-secret.yaml
|
||||
|
||||
oc apply -f ssh-secret.yaml -n ${USER_CHE_NAMESPACE}
|
||||
echo "======= [INFO] SSH Secret is created. ======="
|
||||
}
|
||||
|
||||
# Only for GitLab server administrator users
|
||||
|
|
@ -232,7 +276,7 @@ createOAuthApplicationGitLabServer() {
|
|||
|
||||
CHE_URL=https://$(oc get route -n ${CHE_NAMESPACE} che -o jsonpath='{.spec.host}')
|
||||
|
||||
echo "[INFO] Create OAuth Application"
|
||||
echo "------- [INFO] Create OAuth Application -------"
|
||||
response=$(curl -k -X POST \
|
||||
${GIT_PROVIDER_URL}/api/v4/applications \
|
||||
-H "PRIVATE-TOKEN: ${ADMIN_ACCESS_TOKEN}" \
|
||||
|
|
@ -240,15 +284,11 @@ createOAuthApplicationGitLabServer() {
|
|||
-d "redirect_uri=${CHE_URL}/api/oauth/callback" \
|
||||
-d "scopes=api write_repository openid")
|
||||
|
||||
echo "[INFO] Response of the created OAuth Application"
|
||||
echo "------- [INFO] Response of the created OAuth Application -------"
|
||||
|
||||
OAUTH_ID=$(echo "$response" | jq -r '.id')
|
||||
APPLICATION_ID=$(echo "$response" | jq -r '.application_id')
|
||||
APPLICATION_SECRET=$(echo "$response" | jq -r '.secret')
|
||||
|
||||
echo "[INFO] OAuth ID: ${OAUTH_ID}"
|
||||
echo "[INFO] Application ID: ${APPLICATION_ID}"
|
||||
echo "[INFO] Application Secret: ${APPLICATION_SECRET}"
|
||||
}
|
||||
|
||||
# Only for GitLab server administrator users
|
||||
|
|
@ -256,10 +296,12 @@ deleteOAuthApplicationGitLabServer() {
|
|||
OAUTH_ID=$1
|
||||
ADMIN_ACCESS_TOKEN=$2
|
||||
|
||||
echo "[INFO] Delete OAuth Application"
|
||||
echo "------- [INFO] Delete OAuth Application -------"
|
||||
curl -i -k -X DELETE \
|
||||
${GIT_PROVIDER_URL}/api/v4/applications/${OAUTH_ID} \
|
||||
-H "PRIVATE-TOKEN: ${ADMIN_ACCESS_TOKEN}"
|
||||
|
||||
echo "======= [INFO] OAuth Application is deleted ======="
|
||||
}
|
||||
|
||||
# Only for GitLab server
|
||||
|
|
@ -267,18 +309,18 @@ revokeAuthorizedOAuthApplication() {
|
|||
APPLICATION_ID=$1
|
||||
APPLICATION_SECRET=$2
|
||||
|
||||
echo "[INFO] Revoke authorized OAuth application"
|
||||
echo "------- [INFO] Revoke authorized OAuth application -------"
|
||||
oc project ${USER_CHE_NAMESPACE}
|
||||
OAUTH_TOKEN_NAME=$(oc get secret | grep 'personal-access-token'| awk 'NR==1 { print $1 }')
|
||||
echo "[INFO] OAuth token name: "$OAUTH_TOKEN_NAME
|
||||
OAUTH_TOKEN=$(oc get secret $OAUTH_TOKEN_NAME -o jsonpath='{.data.token}' | base64 -d)
|
||||
echo "[INFO] Oauth token: "$OAUTH_TOKEN
|
||||
|
||||
curl -i -k -X POST \
|
||||
${GIT_PROVIDER_URL}/oauth/revoke \
|
||||
-d "client_id=${APPLICATION_ID}" \
|
||||
-d "client_secret=${APPLICATION_SECRET}" \
|
||||
-d "token=${OAUTH_TOKEN}"
|
||||
|
||||
echo "======= [INFO] Authorized OAuth application is revoked ======="
|
||||
}
|
||||
|
||||
# Only for GitLab server
|
||||
|
|
@ -286,7 +328,7 @@ setupOAuthSecret() {
|
|||
APPLICATION_ID=$1
|
||||
APPLICATION_SECRET=$2
|
||||
|
||||
echo "[INFO] Setup OAuth Secret"
|
||||
echo "------- [INFO] Setup OAuth Secret -------"
|
||||
oc login -u=${OCP_ADMIN_USER_NAME} -p=${OCP_LOGIN_PASSWORD} --insecure-skip-tls-verify=false
|
||||
oc project ${CHE_NAMESPACE}
|
||||
SERVER_POD=$(oc get pod -l component=che | grep "che" | awk 'NR==1 { print $1 }')
|
||||
|
|
@ -303,7 +345,7 @@ setupOAuthSecret() {
|
|||
cat oauth-secret.yaml
|
||||
oc apply -f oauth-secret.yaml -n ${CHE_NAMESPACE}
|
||||
|
||||
echo "[INFO] Wait updating deployment after create OAuth secret"
|
||||
echo "------- [INFO] Wait updating deployment after create OAuth secret -------"
|
||||
oc wait --for=delete pod/${SERVER_POD} --timeout=120s
|
||||
}
|
||||
|
||||
|
|
@ -316,6 +358,7 @@ runTestWorkspaceWithGitRepoUrl() {
|
|||
oc project ${OCP_USER_NAMESPACE}
|
||||
cat .ci/openshift-ci/devworkspace-test.yaml > devworkspace-test.yaml
|
||||
|
||||
echo "------- [INFO] Preparing 'devworkspace-test.yaml' and run test workspace -------"
|
||||
# patch the devworkspace-test.yaml file
|
||||
sed -i "s#ws-name#${WS_NAME}#g" devworkspace-test.yaml
|
||||
sed -i "s#project-name#${PROJECT_NAME}#g" devworkspace-test.yaml
|
||||
|
|
@ -325,7 +368,7 @@ runTestWorkspaceWithGitRepoUrl() {
|
|||
|
||||
oc apply -f devworkspace-test.yaml -n ${OCP_USER_NAMESPACE}
|
||||
oc wait -n ${OCP_USER_NAMESPACE} --for=condition=Ready dw ${WS_NAME} --timeout=360s
|
||||
echo "[INFO] Test workspace is run"
|
||||
echo "======= [INFO] Test workspace is run ======="
|
||||
}
|
||||
|
||||
testProjectIsCloned() {
|
||||
|
|
@ -334,9 +377,9 @@ testProjectIsCloned() {
|
|||
|
||||
WORKSPACE_POD_NAME=$(oc get pods -n ${OCP_USER_NAMESPACE} | grep workspace | awk '{print $1}')
|
||||
if oc exec -it -n ${OCP_USER_NAMESPACE} ${WORKSPACE_POD_NAME} -- test -f /projects/${PROJECT_NAME}/${YAML_FILE_NAME}; then
|
||||
echo "[INFO] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} exists."
|
||||
echo "======= [INFO] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} exists. ======="
|
||||
else
|
||||
echo "[INFO] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} is absent."
|
||||
echo "======= [INFO] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} is absent. ======="
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
|
@ -346,7 +389,7 @@ testGitCredentialsData() {
|
|||
GIT_PROVIDER_PAT=$2
|
||||
GIT_PROVIDER_URL=$3
|
||||
|
||||
echo "[INFO] Check the 'git credentials' is in a workspace"
|
||||
echo "------- [INFO] Check the 'git credentials' is in a workspace -------"
|
||||
hostName="${GIT_PROVIDER_URL#https://}"
|
||||
|
||||
if [ "${GIT_PROVIDER_TYPE}" == "azure-devops" ]; then
|
||||
|
|
@ -358,9 +401,10 @@ testGitCredentialsData() {
|
|||
gitCredentials="https://${userName}:${GIT_PROVIDER_PAT}@${hostName}"
|
||||
WORKSPACE_POD_NAME=$(oc get pods -n ${OCP_USER_NAMESPACE} | grep workspace | awk '{print $1}')
|
||||
if oc exec -it -n ${OCP_USER_NAMESPACE} ${WORKSPACE_POD_NAME} -- cat /.git-credentials/credentials | grep -q ${gitCredentials}; then
|
||||
echo "[INFO] Git credentials file '/.git-credentials/credentials' exists and has the expected content."
|
||||
echo "======= [INFO] Git credentials file '/.git-credentials/credentials' exists and has the expected content. ======="
|
||||
else
|
||||
echo "[ERROR] Git credentials file '/.git-credentials/credentials' does not exist or has incorrect content."
|
||||
echo "####### [ERROR] Git credentials file '/.git-credentials/credentials' does not exist or has incorrect content. ######
|
||||
###### Cause possible: PR code regress or service is changed. Need to investigate it. #######"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
@ -368,7 +412,7 @@ testGitCredentialsData() {
|
|||
deleteTestWorkspace() {
|
||||
WS_NAME=$1
|
||||
OCP_USER_NAMESPACE=$2
|
||||
|
||||
echo "------- [INFO] Delete test workspace -------"
|
||||
oc delete dw ${WS_NAME} -n ${OCP_USER_NAMESPACE}
|
||||
}
|
||||
|
||||
|
|
@ -386,7 +430,7 @@ startOAuthFactoryTest() {
|
|||
sed -i "s#GIT_PROVIDER_USER_NAME#${GIT_PROVIDER_LOGIN}#g" oauth-factory-test.yaml
|
||||
sed -i "s#GIT_PROVIDER_USER_PASSWORD#${GIT_PROVIDER_PASSWORD}#g" oauth-factory-test.yaml
|
||||
|
||||
echo "[INFO] Applying the following patched OAuth Factory Test Pod:"
|
||||
echo "------- [INFO] Applying the following patched OAuth Factory Test Pod: -------"
|
||||
cat oauth-factory-test.yaml
|
||||
echo "[INFO] --------------------------------------------------"
|
||||
oc apply -f oauth-factory-test.yaml
|
||||
|
|
@ -397,7 +441,7 @@ startOAuthFactoryTest() {
|
|||
PHASE=$(oc get pod -n ${CHE_NAMESPACE} ${TEST_POD_NAME} \
|
||||
--template='{{ .status.phase }}')
|
||||
if [[ ${PHASE} == "Running" ]]; then
|
||||
echo "[INFO] Factory test started successfully."
|
||||
echo "======= [INFO] Factory test started successfully. ======="
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
@ -405,7 +449,8 @@ startOAuthFactoryTest() {
|
|||
n=$(( n+1 ))
|
||||
done
|
||||
|
||||
echo "[ERROR] Failed to start Factory test."
|
||||
echo "####### [ERROR] Failed to start Factory test. #######
|
||||
###### Cause possible: an infrastructure problem, pod could not start, try to rerun the test. #######"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
@ -418,7 +463,7 @@ startSmokeTest() {
|
|||
sed -i "s#OCP_USER_NAME#${OCP_NON_ADMIN_USER_NAME}#g" che-smoke-test.yaml
|
||||
sed -i "s#OCP_USER_PASSWORD#${OCP_LOGIN_PASSWORD}#g" che-smoke-test.yaml
|
||||
|
||||
echo "[INFO] Applying the following patched Smoke Test Pod:"
|
||||
echo "------- [INFO] Applying the following patched Smoke Test Pod: -------"
|
||||
cat che-smoke-test.yaml
|
||||
echo "[INFO] --------------------------------------------------"
|
||||
oc apply -f che-smoke-test.yaml
|
||||
|
|
@ -429,7 +474,7 @@ startSmokeTest() {
|
|||
PHASE=$(oc get pod -n ${CHE_NAMESPACE} ${TEST_POD_NAME} \
|
||||
--template='{{ .status.phase }}')
|
||||
if [[ ${PHASE} == "Running" ]]; then
|
||||
echo "[INFO] Smoke test started successfully."
|
||||
echo "======= [INFO] Smoke test started successfully. ======="
|
||||
return
|
||||
fi
|
||||
|
||||
|
|
@ -437,22 +482,26 @@ startSmokeTest() {
|
|||
n=$(( n+1 ))
|
||||
done
|
||||
|
||||
echo "[ERROR] Failed to start Smoke test."
|
||||
echo "####### [ERROR] Failed to start Smoke test. #######
|
||||
####### Cause possible: an infrastructure problem, pod could not start, try to rerun the test. #######"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Catch the finish of the job and write logs in artifacts.
|
||||
catchFinish() {
|
||||
echo "[INFO] Terminate the process after finish the test script."
|
||||
local RESULT=$?
|
||||
killProcessByPort
|
||||
if [ "$RESULT" != "0" ]; then
|
||||
set +e
|
||||
collectEclipseCheLogs
|
||||
set -e
|
||||
fi
|
||||
|
||||
[[ "${RESULT}" != "0" ]] && echo "[ERROR] Job failed." || echo "[INFO] Job completed successfully."
|
||||
echo "------- [INFO] Terminate the process after finish the test script. -------"
|
||||
set +e
|
||||
killProcessByPort
|
||||
set -e
|
||||
|
||||
[[ "${RESULT}" != "0" ]] && echo "####### [ERROR] Job failed. #######" || echo "####### [INFO] Job completed successfully. #######"
|
||||
exit $RESULT
|
||||
}
|
||||
|
||||
|
|
@ -466,16 +515,16 @@ collectEclipseCheLogs() {
|
|||
}
|
||||
|
||||
collectLogs() {
|
||||
echo "[INFO] Waiting until test pod finished"
|
||||
echo "------- [INFO] Waiting until test pod finished. -------"
|
||||
oc logs -n ${CHE_NAMESPACE} ${TEST_POD_NAME} -c test -f
|
||||
sleep 3
|
||||
|
||||
# Download artifacts
|
||||
set +e
|
||||
echo "[INFO] Collect all Eclipse Che logs and cluster CR."
|
||||
echo -------" [INFO] Collect all Eclipse Che logs and cluster CR. -------"
|
||||
collectEclipseCheLogs
|
||||
|
||||
echo "[INFO] Downloading test report."
|
||||
echo "------- [INFO] Downloading test report. -------"
|
||||
mkdir -p ${ARTIFACTS_DIR}/e2e
|
||||
oc rsync -n ${CHE_NAMESPACE} ${TEST_POD_NAME}:/tmp/e2e/report/ ${ARTIFACTS_DIR}/e2e -c download-reports
|
||||
oc exec -n ${CHE_NAMESPACE} ${TEST_POD_NAME} -c download-reports -- touch /tmp/done
|
||||
|
|
@ -490,10 +539,11 @@ collectLogs() {
|
|||
|
||||
EXIT_CODE=$(oc logs -n ${CHE_NAMESPACE} ${TEST_POD_NAME} -c test | grep EXIT_CODE)
|
||||
if [[ ${EXIT_CODE} != "+ EXIT_CODE=0" ]]; then
|
||||
echo "[ERROR] GUI test failed. Job failed."
|
||||
echo "####### [ERROR] GUI test failed. Job failed. #######
|
||||
###### Cause possible: PR code regress or service is changed. Need to investigate it. #######"
|
||||
exit 1
|
||||
fi
|
||||
echo "[INFO] Job completed successfully."
|
||||
echo "======= [INFO] Job completed successfully. ======="
|
||||
}
|
||||
|
||||
testCloneGitRepoNoProjectExists() {
|
||||
|
|
@ -503,10 +553,11 @@ testCloneGitRepoNoProjectExists() {
|
|||
OCP_USER_NAMESPACE=$4
|
||||
|
||||
runTestWorkspaceWithGitRepoUrl ${WS_NAME} ${PROJECT_NAME} ${GIT_REPO_URL} ${OCP_USER_NAMESPACE}
|
||||
echo "[INFO] Check the private repository is NOT cloned with NO PAT/OAuth setup"
|
||||
echo "------- [INFO] Check the private repository is NOT cloned with NO PAT/OAuth setup. -------"
|
||||
testProjectIsCloned ${PROJECT_NAME} ${OCP_USER_NAMESPACE} && \
|
||||
{ echo "[ERROR] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} should NOT be present" && exit 1; }
|
||||
echo "[INFO] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} is NOT present. This is EXPECTED"
|
||||
{ echo "####### [ERROR] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} should NOT be present. #######
|
||||
####### Cause possible: PR code regress or service is changed. Need to investigate it. #######" && exit 1; }
|
||||
echo "======= [INFO] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} is NOT present. This is EXPECTED. ======="
|
||||
}
|
||||
|
||||
# Test that the repository is cloned when PAT, OAuth or SSH is configured
|
||||
|
|
@ -517,9 +568,10 @@ testCloneGitRepoProjectShouldExists() {
|
|||
OCP_USER_NAMESPACE=$4
|
||||
|
||||
runTestWorkspaceWithGitRepoUrl ${WS_NAME} ${PROJECT_NAME} ${GIT_REPO_URL} ${OCP_USER_NAMESPACE}
|
||||
echo "[INFO] Check the repository is cloned"
|
||||
echo "------- [INFO] Check the repository is cloned. -------"
|
||||
testProjectIsCloned ${PROJECT_NAME} ${OCP_USER_NAMESPACE} || \
|
||||
{ echo "[ERROR] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} should be present." && exit 1; }
|
||||
{ echo "####### [ERROR] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} should be present. #######
|
||||
###### Cause possible: PR code regress or service is changed. Need to investigate it. #######" && exit 1; }
|
||||
}
|
||||
|
||||
setupTestEnvironment() {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_RAW_PATH_URL=${PUBLIC_REPO_RAW_PATH_URL:-"https://dev.azure.com/chepullreq1/che-pr-public/_apis/git/repositories/public-repo/items?path=/devfile.yaml"}
|
||||
export PRIVATE_REPO_RAW_PATH_URL=${PRIVATE_REPO_URL:-"https://dev.azure.com/chepullreq1/che-pr-private/_apis/git/repositories/private-repo/items?path=/devfile.yaml"}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_SSH_URL=${PUBLIC_REPO_SSH_URL:-"git@ssh.dev.azure.com:v3/chepullreq1/che-pr-public/public-repo"}
|
||||
export PRIVATE_REPO_SSH_URL=${PRIVATE_REPO_SSH_URL:-"git@ssh.dev.azure.com:v3/chepullreq1/che-pr-private/private-repo"}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://chepullreq1@dev.azure.com/chepullreq1/che-pr-public/_git/public-repo"}
|
||||
export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://dev.azure.com/chepullreq1/che-pr-private/_git/private-repo"}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://chepullreq1@dev.azure.com/chepullreq1/che-pr-public/_git/public-repo"}
|
||||
export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://dev.azure.com/chepullreq1/che-pr-private/_git/private-repo"}
|
||||
export GIT_PROVIDER_TYPE=${GIT_PROVIDER_TYPE:-"azure-devops"}
|
||||
|
|
@ -34,24 +36,24 @@ setupPersonalAccessToken ${GIT_PROVIDER_TYPE} ${GIT_PROVIDER_URL} ${AZURE_PAT}
|
|||
requestProvisionNamespace
|
||||
testFactoryResolverWithPatOAuth ${PUBLIC_REPO_URL} ${PRIVATE_REPO_URL}
|
||||
|
||||
echo "[INFO] Check clone public repository with PAT setup"
|
||||
echo "------- [INFO] Check clone public repository with PAT setup -------"
|
||||
testCloneGitRepoProjectShouldExists ${PUBLIC_REPO_WORKSPACE_NAME} ${PUBLIC_PROJECT_NAME} ${PUBLIC_REPO_URL} ${USER_CHE_NAMESPACE}
|
||||
testGitCredentialsData ${USER_CHE_NAMESPACE} ${AZURE_PAT} ${GIT_PROVIDER_URL}
|
||||
deleteTestWorkspace ${PUBLIC_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
||||
echo "[INFO] Check clone private repository with PAT setup"
|
||||
echo "------- [INFO] Check clone private repository with PAT setup -------"
|
||||
testCloneGitRepoProjectShouldExists ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_URL} ${USER_CHE_NAMESPACE}
|
||||
testGitCredentialsData ${USER_CHE_NAMESPACE} ${AZURE_PAT} ${GIT_PROVIDER_URL}
|
||||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
||||
echo "[INFO] Check clone private repository by raw devfile URL with PAT setup"
|
||||
echo "------- [INFO] Check clone private repository by raw devfile URL with PAT setup -------"
|
||||
testFactoryResolverResponse ${PRIVATE_REPO_RAW_PATH_URL} 200
|
||||
testCloneGitRepoProjectShouldExists ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_RAW_PATH_URL} ${USER_CHE_NAMESPACE}
|
||||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
||||
setupSSHKeyPairs "${AZURE_PRIVATE_KEY}" "${AZURE_PUBLIC_KEY}"
|
||||
|
||||
echo "[INFO] Check clone private repository by SSH URL with PAT setup"
|
||||
echo "------- [INFO] Check clone private repository by SSH URL with PAT setup -------"
|
||||
testFactoryResolverResponse ${PRIVATE_REPO_SSH_URL} 200
|
||||
testCloneGitRepoProjectShouldExists ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_SSH_URL} ${USER_CHE_NAMESPACE}
|
||||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_RAW_PATH_URL=${PUBLIC_REPO_RAW_PATH_URL:-"https://bitbucket.org/chepullreq/public-repo/raw/746000bd63a54eaf8ea8aba9dfe6620e5c6c61d7/devfile.yaml"}
|
||||
export PRIVATE_REPO_RAW_PATH_URL=${PRIVATE_REPO_URL:-"https://bitbucket.org/chepullreq/private-repo/raw/80b183d27c6c533462128b0c092208aad73b2906/devfile.yaml"}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_SSH_URL=${PUBLIC_REPO_SSH_URL:-"git@bitbucket.org:chepullreq/public-repo.git"}
|
||||
export PRIVATE_REPO_SSH_URL=${PRIVATE_REPO_SSH_URL:-"git@bitbucket.org:chepullreq/private-repo.git"}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://chepullreq1@bitbucket.org/chepullreq/public-repo.git"}
|
||||
export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://chepullreq1@bitbucket.org/chepullreq/private-repo.git"}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export TEST_POD_NAME=${TEST_POD_NAME:-"che-smoke-test"}
|
||||
|
||||
# import common test functions
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_SSH_URL=${PUBLIC_REPO_SSH_URL:-"git@gitea.com:chepullreq1/public-repo.git"}
|
||||
export PRIVATE_REPO_SSH_URL=${PRIVATE_REPO_SSH_URL:-"git@gitea.com:chepullreq1/private-repo.git"}
|
||||
export PUBLIC_REPO_RAW_PATH_URL=${PUBLIC_REPO_RAW_PATH_URL:-"https://gitea.com/chepullreq1/public-repo/raw/branch/main/devfile.yaml"}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PRIVATE_REPO_RAW_PATH_URL=${PRIVATE_REPO_RAW_PATH_URL:-"https://${GITEA_PAT}@gitea.com/chepullreq1/private-repo/raw/branch/main/devfile.yaml"}
|
||||
|
||||
# import common test functions
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_RAW_PATH_URL=${PUBLIC_REPO_RAW_PATH_URL:-"https://raw.githubusercontent.com/chepullreq1/public-repo/main/devfile.yaml"}
|
||||
export PRIVATE_REPO_RAW_PATH_URL=${PRIVATE_REPO_URL:-"https://raw.githubusercontent.com/chepullreq1/private-repo/main/devfile.yaml"}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_SSH_URL=${PUBLIC_REPO_SSH_URL:-"git@github.com:chepullreq1/public-repo.git"}
|
||||
export PRIVATE_REPO_SSH_URL=${PRIVATE_REPO_SSH_URL:-"git@github.com:chepullreq1/private-repo.git"}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://github.com/chepullreq1/public-repo.git"}
|
||||
export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://github.com/chepullreq1/private-repo.git"}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://github.com/chepullreq1/public-repo.git"}
|
||||
export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://github.com/chepullreq1/private-repo.git"}
|
||||
export GIT_PROVIDER_TYPE=${GIT_PROVIDER_TYPE:-"github"}
|
||||
|
|
@ -34,24 +36,24 @@ setupPersonalAccessToken ${GIT_PROVIDER_TYPE} ${GIT_PROVIDER_URL} ${GITHUB_PAT}
|
|||
requestProvisionNamespace
|
||||
testFactoryResolverWithPatOAuth ${PUBLIC_REPO_URL} ${PRIVATE_REPO_URL}
|
||||
|
||||
echo "[INFO] Check clone public repository with PAT setup"
|
||||
echo "------- [INFO] Check clone public repository with PAT setup -------"
|
||||
testCloneGitRepoProjectShouldExists ${PUBLIC_REPO_WORKSPACE_NAME} ${PUBLIC_PROJECT_NAME} ${PUBLIC_REPO_URL} ${USER_CHE_NAMESPACE}
|
||||
testGitCredentialsData ${USER_CHE_NAMESPACE} ${GITHUB_PAT} ${GIT_PROVIDER_URL}
|
||||
deleteTestWorkspace ${PUBLIC_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
||||
echo "[INFO] Check clone private repository with PAT setup"
|
||||
echo "------- [INFO] Check clone private repository with PAT setup -------"
|
||||
testCloneGitRepoProjectShouldExists ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_URL} ${USER_CHE_NAMESPACE}
|
||||
testGitCredentialsData ${USER_CHE_NAMESPACE} ${GITHUB_PAT} ${GIT_PROVIDER_URL}
|
||||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
||||
echo "[INFO] Check clone private repository by raw devfile URL with PAT setup"
|
||||
echo "------- [INFO] Check clone private repository by raw devfile URL with PAT setup -------"
|
||||
testFactoryResolverResponse ${PRIVATE_REPO_RAW_PATH_URL} 200
|
||||
testCloneGitRepoProjectShouldExists ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_RAW_PATH_URL} ${USER_CHE_NAMESPACE}
|
||||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
||||
setupSSHKeyPairs "${GITHUB_PRIVATE_KEY}" "${GITHUB_PUBLIC_KEY}"
|
||||
|
||||
echo "[INFO] Check clone private repository by SSH URL with PAT setup"
|
||||
echo "------- [INFO] Check clone private repository by SSH URL with PAT setup -------"
|
||||
testFactoryResolverResponse ${PRIVATE_REPO_SSH_URL} 200
|
||||
testCloneGitRepoProjectShouldExists ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_SSH_URL} ${USER_CHE_NAMESPACE}
|
||||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_RAW_PATH_URL=${PUBLIC_REPO_RAW_PATH_URL:-"https://gitlab.com/chepullreq1/public-repo/-/raw/main/devfile.yaml"}
|
||||
export PRIVATE_REPO_RAW_PATH_URL=${PRIVATE_REPO_URL:-"https://gitlab.com/chepullreq1/private-repo/-/raw/main/devfile.yaml"}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_SSH_URL=${PUBLIC_REPO_SSH_URL:-"git@gitlab.com:chepullreq1/public-repo.git"}
|
||||
export PRIVATE_REPO_SSH_URL=${PRIVATE_REPO_SSH_URL:-"git@gitlab.com:chepullreq1/private-repo.git"}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://gitlab.com/chepullreq1/public-repo.git"}
|
||||
export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://gitlab.com/chepullreq1/private-repo.git"}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export TEST_POD_NAME=${TEST_POD_NAME:-"oauth-factory-test"}
|
||||
export GIT_PROVIDER_TYPE=${GIT_PROVIDER_TYPE:-"gitlab"}
|
||||
export GIT_PROVIDER_URL=${GIT_PROVIDER_URL:-"https://gitlab-gitlab-system.apps.git.crw-qe.com"}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ set -ex
|
|||
# only exit with zero if all commands of the pipeline exit successfully
|
||||
set -o pipefail
|
||||
|
||||
echo "======= [INFO] OpenShift CI infrastructure is ready. Running test. ======="
|
||||
|
||||
export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://gitlab.com/chepullreq1/public-repo.git"}
|
||||
export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://gitlab.com/chepullreq1/private-repo.git"}
|
||||
export GIT_PROVIDER_TYPE=${GIT_PROVIDER_TYPE:-"gitlab"}
|
||||
|
|
@ -34,24 +36,24 @@ setupPersonalAccessToken ${GIT_PROVIDER_TYPE} ${GIT_PROVIDER_URL} ${GITLAB_PAT}
|
|||
requestProvisionNamespace
|
||||
testFactoryResolverWithPatOAuth ${PUBLIC_REPO_URL} ${PRIVATE_REPO_URL}
|
||||
|
||||
echo "[INFO] Check clone public repository with PAT setup"
|
||||
echo "------- [INFO] Check clone public repository with PAT setup -------"
|
||||
testCloneGitRepoProjectShouldExists ${PUBLIC_REPO_WORKSPACE_NAME} ${PUBLIC_PROJECT_NAME} ${PUBLIC_REPO_URL} ${USER_CHE_NAMESPACE}
|
||||
testGitCredentialsData ${USER_CHE_NAMESPACE} ${GITLAB_PAT} ${GIT_PROVIDER_URL}
|
||||
deleteTestWorkspace ${PUBLIC_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
||||
echo "[INFO] Check clone private repository with PAT setup"
|
||||
echo "------- [INFO] Check clone private repository with PAT setup -------"
|
||||
testCloneGitRepoProjectShouldExists ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_URL} ${USER_CHE_NAMESPACE}
|
||||
testGitCredentialsData ${USER_CHE_NAMESPACE} ${GITLAB_PAT} ${GIT_PROVIDER_URL}
|
||||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
||||
echo "[INFO] Check clone private repository by raw devfile URL with PAT setup"
|
||||
echo "------- [INFO] Check clone private repository by raw devfile URL with PAT setup -------"
|
||||
testFactoryResolverResponse ${PRIVATE_REPO_RAW_PATH_URL} 200
|
||||
testCloneGitRepoProjectShouldExists ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_RAW_PATH_URL} ${USER_CHE_NAMESPACE}
|
||||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
||||
setupSSHKeyPairs "${GITLAB_PRIVATE_KEY}" "${GITLAB_PUBLIC_KEY}"
|
||||
|
||||
echo "[INFO] Check clone private repository by SSH URL with PAT setup"
|
||||
echo "------- [INFO] Check clone private repository by SSH URL with PAT setup -------"
|
||||
testFactoryResolverResponse ${PRIVATE_REPO_SSH_URL} 200
|
||||
testCloneGitRepoProjectShouldExists ${PRIVATE_REPO_WORKSPACE_NAME} ${PRIVATE_PROJECT_NAME} ${PRIVATE_REPO_SSH_URL} ${USER_CHE_NAMESPACE}
|
||||
deleteTestWorkspace ${PRIVATE_REPO_WORKSPACE_NAME} ${USER_CHE_NAMESPACE}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-che-tomcat</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-main</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-root-war</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-swagger-war</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>assembly-wsmaster-war</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ che.factory.default_devfile_filenames=devfile.yaml,.devfile.yaml
|
|||
### Devfile defaults
|
||||
# Editor used for factories that are created from a remote Git repository
|
||||
# which doesn't contain any {prod-short}-specific workspace descriptor.
|
||||
che.factory.default_editor=eclipse/che-theia/latest
|
||||
che.factory.default_editor=eclipse/che-theia/next
|
||||
|
||||
# File size limit for the URL fetcher which fetches files from the SCM repository.
|
||||
che.factory.scm_file_fetcher_limit_bytes=102400
|
||||
|
|
@ -622,7 +622,7 @@ che.factory.devfile2_files_resolution_list=.che/che-editor.yaml,.che/che-theia-p
|
|||
# Default editor that should be provisioned into Devfile if there is no specified editor.
|
||||
# The format is `editorPublisher/editorName/editorVersion` value.
|
||||
# A `NULL` or absence of value means that default editor should not be provisioned.
|
||||
che.workspace.devfile.default_editor=eclipse/che-theia/latest
|
||||
che.workspace.devfile.default_editor=eclipse/che-theia/next
|
||||
|
||||
# Default plug-ins which should be provisioned for the default editor.
|
||||
# All plug-ins from this list that aren't explicitly mentioned in the user-defined devfile
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-server</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-assembly-parent</artifactId>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
|
||||
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8-minimal
|
||||
FROM registry.access.redhat.com/ubi8-minimal:8.9-1108
|
||||
FROM registry.access.redhat.com/ubi8-minimal:8.9-1161
|
||||
USER root
|
||||
ENV CHE_HOME=/home/user/eclipse-che
|
||||
ENV JAVA_HOME=/usr/lib/jvm/jre
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
|
||||
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8-minimal
|
||||
FROM ubi8-minimal:8.9-1108
|
||||
FROM ubi8-minimal:8.9-1161
|
||||
USER root
|
||||
ENV CHE_HOME=/home/user/devspaces
|
||||
ENV JAVA_HOME=/usr/lib/jvm/jre
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-core</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-dto-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-dto</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-model</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-logback</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-metrics-core</artifactId>
|
||||
<name>Che Core :: Commons :: Metrics :: Core</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-tracing-core</artifactId>
|
||||
<name>Che Core :: Commons :: Tracing :: Core</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-tracing-metrics</artifactId>
|
||||
<name>Che Core :: Commons :: Tracing :: Metrics</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-tracing-web</artifactId>
|
||||
<name>Che Core :: Commons :: Tracing :: Web</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-typescript-dto-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-annotations</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-inject</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-j2ee</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-json</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-lang</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-observability</artifactId>
|
||||
<name>Che Core :: Commons :: Tracing and Monitoring wrapper</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-schedule</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-test</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-tracing</artifactId>
|
||||
<name>Che Core :: Commons :: Tracing</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-core-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-core-commons-parent</artifactId>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-server</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-infrastructures-parent</artifactId>
|
||||
<groupId>org.eclipse.che.infrastructure</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>infrastructure-distributed</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-infrastructures-parent</artifactId>
|
||||
<groupId>org.eclipse.che.infrastructure</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>infrastructure-factory</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ public class KubernetesPersonalAccessTokenManager implements PersonalAccessToken
|
|||
public static final String NAME_PATTERN = "personal-access-token-";
|
||||
|
||||
public static final String ANNOTATION_CHE_USERID = "che.eclipse.org/che-userid";
|
||||
public static final String ANNOTATION_SCM_PROVIDER_NAME = "che.eclipse.org/scm-provider-name";
|
||||
public static final String ANNOTATION_SCM_ORGANIZATION = "che.eclipse.org/scm-organization";
|
||||
public static final String ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_ID =
|
||||
"che.eclipse.org/scm-personal-access-token-id";
|
||||
|
|
@ -103,6 +104,7 @@ public class KubernetesPersonalAccessTokenManager implements PersonalAccessToken
|
|||
new ImmutableMap.Builder<String, String>()
|
||||
.put(ANNOTATION_CHE_USERID, personalAccessToken.getCheUserId())
|
||||
.put(ANNOTATION_SCM_URL, personalAccessToken.getScmProviderUrl())
|
||||
.put(ANNOTATION_SCM_PROVIDER_NAME, personalAccessToken.getScmProviderName())
|
||||
.put(
|
||||
ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_ID,
|
||||
personalAccessToken.getScmTokenId())
|
||||
|
|
@ -210,10 +212,11 @@ public class KubernetesPersonalAccessTokenManager implements PersonalAccessToken
|
|||
PersonalAccessToken personalAccessToken =
|
||||
new PersonalAccessToken(
|
||||
personalAccessTokenParams.getScmProviderUrl(),
|
||||
getScmProviderName(personalAccessTokenParams),
|
||||
secretAnnotations.get(ANNOTATION_CHE_USERID),
|
||||
personalAccessTokenParams.getOrganization(),
|
||||
scmUsername.get(),
|
||||
secretAnnotations.get(ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_NAME),
|
||||
personalAccessTokenParams.getScmTokenName(),
|
||||
personalAccessTokenParams.getScmTokenId(),
|
||||
personalAccessTokenParams.getToken());
|
||||
return Optional.of(personalAccessToken);
|
||||
|
|
@ -239,6 +242,20 @@ public class KubernetesPersonalAccessTokenManager implements PersonalAccessToken
|
|||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the SCM provider. If the name is not set, the name of the token is used.
|
||||
* This is used to support back compatibility with the old token secrets, which do not have the
|
||||
* 'che.eclipse.org/scm-provider-name' annotation.
|
||||
*
|
||||
* @param params the parameters of the personal access token
|
||||
* @return the name of the SCM provider
|
||||
*/
|
||||
private String getScmProviderName(PersonalAccessTokenParams params) {
|
||||
return isNullOrEmpty(params.getScmProviderName())
|
||||
? params.getScmTokenName()
|
||||
: params.getScmProviderName();
|
||||
}
|
||||
|
||||
private boolean deleteSecretIfMisconfigured(Secret secret) throws InfrastructureException {
|
||||
Map<String, String> secretAnnotations = secret.getMetadata().getAnnotations();
|
||||
LOG.debug("Secret annotations: {}", secretAnnotations);
|
||||
|
|
@ -270,15 +287,17 @@ public class KubernetesPersonalAccessTokenManager implements PersonalAccessToken
|
|||
Map<String, String> secretAnnotations = secret.getMetadata().getAnnotations();
|
||||
|
||||
String token = new String(Base64.getDecoder().decode(secret.getData().get("token"))).trim();
|
||||
String configuredOAuthProviderName =
|
||||
String configuredOAuthTokenName =
|
||||
secretAnnotations.get(ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_NAME);
|
||||
String configuredTokenId = secretAnnotations.get(ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_ID);
|
||||
String configuredScmOrganization = secretAnnotations.get(ANNOTATION_SCM_ORGANIZATION);
|
||||
String configuredScmServerUrl = secretAnnotations.get(ANNOTATION_SCM_URL);
|
||||
String configuredScmProviderName = secretAnnotations.get(ANNOTATION_SCM_PROVIDER_NAME);
|
||||
|
||||
return new PersonalAccessTokenParams(
|
||||
trimEnd(configuredScmServerUrl, '/'),
|
||||
configuredOAuthProviderName,
|
||||
configuredScmProviderName,
|
||||
configuredOAuthTokenName,
|
||||
configuredTokenId,
|
||||
token,
|
||||
configuredScmOrganization);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2023 Red Hat, Inc.
|
||||
* Copyright (c) 2012-2024 Red Hat, Inc.
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
|
|
@ -92,7 +92,13 @@ public class KubernetesGitCredentialManagerTest {
|
|||
|
||||
PersonalAccessToken token =
|
||||
new PersonalAccessToken(
|
||||
"https://bitbucket.com", "cheUser", "username", "token-name", "tid-23434", "token123");
|
||||
"https://bitbucket.com",
|
||||
"provider",
|
||||
"cheUser",
|
||||
"username",
|
||||
"token-name",
|
||||
"tid-23434",
|
||||
"token123");
|
||||
|
||||
// when
|
||||
kubernetesGitCredentialManager.createOrReplace(token);
|
||||
|
|
@ -174,6 +180,7 @@ public class KubernetesGitCredentialManagerTest {
|
|||
PersonalAccessToken token =
|
||||
new PersonalAccessToken(
|
||||
"https://bitbucket.com",
|
||||
"provider",
|
||||
"cheUser",
|
||||
"username",
|
||||
"oauth2-token-name",
|
||||
|
|
@ -199,6 +206,7 @@ public class KubernetesGitCredentialManagerTest {
|
|||
PersonalAccessToken token =
|
||||
new PersonalAccessToken(
|
||||
"https://bitbucket.com:5648",
|
||||
"provider",
|
||||
"cheUser",
|
||||
"username",
|
||||
"token-name",
|
||||
|
|
|
|||
|
|
@ -139,7 +139,13 @@ public class KubernetesPersonalAccessTokenManagerTest {
|
|||
|
||||
PersonalAccessToken token =
|
||||
new PersonalAccessToken(
|
||||
"https://bitbucket.com", "cheUser", "username", "token-name", "tid-24", "token123");
|
||||
"https://bitbucket.com",
|
||||
"provider",
|
||||
"cheUser",
|
||||
"username",
|
||||
"token-name",
|
||||
"tid-24",
|
||||
"token123");
|
||||
|
||||
// when
|
||||
personalAccessTokenManager.store(token);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-infrastructures-parent</artifactId>
|
||||
<groupId>org.eclipse.che.infrastructure</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>infrastructure-metrics</artifactId>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-infrastructures-parent</artifactId>
|
||||
<groupId>org.eclipse.che.infrastructure</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>infrastructure-permission</artifactId>
|
||||
<name>Infrastructure :: Kubernetes Permissions</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-infrastructures-parent</artifactId>
|
||||
<groupId>org.eclipse.che.infrastructure</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>infrastructure-kubernetes</artifactId>
|
||||
<name>Infrastructure :: Kubernetes</name>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2023 Red Hat, Inc.
|
||||
* Copyright (c) 2012-2024 Red Hat, Inc.
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
|
|
@ -101,7 +101,7 @@ public class K8sContainerResolver {
|
|||
}
|
||||
// TODO: add 'httpGetAction' and 'tcpSocketAction' support
|
||||
io.fabric8.kubernetes.api.model.LifecycleHandler k8SHandler =
|
||||
new io.fabric8.kubernetes.api.model.LifecycleHandler(exec, null, null);
|
||||
new io.fabric8.kubernetes.api.model.LifecycleHandler(exec, null, null, null);
|
||||
return k8SHandler;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-infrastructures-parent</artifactId>
|
||||
<groupId>org.eclipse.che.infrastructure</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>infrastructure-openshift</artifactId>
|
||||
<name>Infrastructure :: OpenShift</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-server</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.infrastructure</groupId>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-authentication-commons</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-authorization-impl</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-authorization</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-organization-shared</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-organization</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-permission-shared</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-permission</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-resource-shared</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-resource</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api-workspace-activity</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-parent</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-api</artifactId>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-keycloak</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-keycloak-server</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-keycloak</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-keycloak-shared</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-keycloak</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-keycloak-token-provider</artifactId>
|
||||
<name>Che Multiuser :: Keycloak Token Provider</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-keycloak</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-keycloak-user-remover</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-parent</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-keycloak</artifactId>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-machine-auth</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-machine-authentication-shared</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-machine-auth</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-machine-authentication</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-parent</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-machine-auth</artifactId>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-parent</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-oidc</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-permission</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-permission-devfile</artifactId>
|
||||
<name>Che Multiuser :: Devfile Permissions</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-permission</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-permission-logger</artifactId>
|
||||
<name>Che Multiuser :: Logger Permissions</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-permission</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-permission-resource</artifactId>
|
||||
<name>Che Multiuser :: Resource :: Permissions</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-permission</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-permission-system</artifactId>
|
||||
<name>Che Multiuser :: System Permissions</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-permission</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-permission-user</artifactId>
|
||||
<name>Che Multiuser :: User Permissions</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-permission</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-permission-workspace-activity</artifactId>
|
||||
<name>Che Multiuser :: Workspace Activity Permissions</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-permission</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-permission-workspace</artifactId>
|
||||
<name>Che Multiuser :: Workspace Permissions</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-parent</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-permission</artifactId>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-parent</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-personal-account</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-server</artifactId>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-multiuser-parent</artifactId>
|
||||
<groupId>org.eclipse.che.multiuser</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>che-multiuser-sql-schema</artifactId>
|
||||
|
|
|
|||
10
pom.xml
10
pom.xml
|
|
@ -16,7 +16,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.che</groupId>
|
||||
<artifactId>che-server</artifactId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Che Server</name>
|
||||
<description>Eclipse Che Server</description>
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
</scm>
|
||||
<properties>
|
||||
<aopalliance.version>1.0</aopalliance.version>
|
||||
<ch.qos.logback.version>1.4.11</ch.qos.logback.version>
|
||||
<ch.qos.logback.version>1.5.6</ch.qos.logback.version>
|
||||
<com.auth0.jwks-rsa.version>0.22.1</com.auth0.jwks-rsa.version>
|
||||
<com.fasterxml.jackson.version>2.15.2</com.fasterxml.jackson.version>
|
||||
<com.github.kirviq.dumbster.version>1.7.1</com.github.kirviq.dumbster.version>
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
<enforcer.skip>false</enforcer.skip>
|
||||
<integration.mysql.db.image>quay.io/eclipse/che--centos--mysql-57-centos7:latest-e08ee4d43b7356607685b69bde6335e27cf20c020f345b6c6c59400183882764</integration.mysql.db.image>
|
||||
<integration.postgresql.db.image>quay.io/eclipse/che--centos--postgresql-13-centos7:1-71b24684d64da46f960682cc4216222a7e4ed8b1a31dd5a865b3e71afdea20d2</integration.postgresql.db.image>
|
||||
<io.fabric8.kubernetes-client>6.9.0</io.fabric8.kubernetes-client>
|
||||
<io.fabric8.kubernetes-client>6.10.0</io.fabric8.kubernetes-client>
|
||||
<io.github.mweirauch.micrometer-jvm-extras.version>0.2.2</io.github.mweirauch.micrometer-jvm-extras.version>
|
||||
<io.jaegertracing.micrometer.version>1.8.1</io.jaegertracing.micrometer.version>
|
||||
<io.jaegertracing.version>1.8.1</io.jaegertracing.version>
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
<license_contributor>Red Hat, Inc. - initial API and implementation</license_contributor>
|
||||
<?SORTPOM IGNORE?>
|
||||
<build.info>${project.version}</build.info>
|
||||
<che.version>7.83.0</che.version>
|
||||
<che.version>7.86.0-SNAPSHOT</che.version>
|
||||
<specification.version>1.0-beta2</specification.version>
|
||||
<?SORTPOM RESUME?>
|
||||
<license_copyrightOwner>Red Hat, Inc.</license_copyrightOwner>
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
<org.apache.maven.plugin-testing.maven-plugin-testing-harness.version>3.3.0</org.apache.maven.plugin-testing.maven-plugin-testing-harness.version>
|
||||
<org.apache.maven.plugin-tools.plugin-annotations.version>3.9.0</org.apache.maven.plugin-tools.plugin-annotations.version>
|
||||
<org.apache.maven.version>3.9.4</org.apache.maven.version>
|
||||
<org.apache.tomcat.version>10.1.6</org.apache.tomcat.version>
|
||||
<org.apache.tomcat.version>10.1.14</org.apache.tomcat.version>
|
||||
<org.codehaus.plexus.utils.version>3.4.1</org.codehaus.plexus.utils.version>
|
||||
<org.eclipse.persistence.eclipselink.version>2.7.10</org.eclipse.persistence.eclipselink.version>
|
||||
<org.eclipse.persistence.version>2.2.3</org.eclipse.persistence.version>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<packaging>pom</packaging>
|
||||
<name>Che TypeScript DTO</name>
|
||||
<properties>
|
||||
<che.version>7.83.0</che.version>
|
||||
<che.version>7.86.0-SNAPSHOT</che.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-master-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-account</artifactId>
|
||||
<name>Che Core :: API :: Account</name>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-master-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-auth-azure-devops</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-master-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-auth-bitbucket</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2023 Red Hat, Inc.
|
||||
* Copyright (c) 2012-2024 Red Hat, Inc.
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
package org.eclipse.che.security.oauth;
|
||||
|
||||
import static com.google.common.base.Strings.isNullOrEmpty;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl;
|
||||
import com.google.api.client.util.store.MemoryDataStoreFactory;
|
||||
|
|
@ -77,7 +78,7 @@ public class BitbucketOAuthAuthenticator extends OAuthAuthenticator {
|
|||
private String getTestRequestUrl() {
|
||||
return "https://bitbucket.org".equals(bitbucketEndpoint)
|
||||
? "https://api.bitbucket.org/2.0/user"
|
||||
: bitbucketEndpoint + "/rest/api/1.0/application-properties";
|
||||
: bitbucketEndpoint + "/plugins/servlet/applinks/whoami";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -89,11 +90,12 @@ public class BitbucketOAuthAuthenticator extends OAuthAuthenticator {
|
|||
throws OAuthAuthenticationException {
|
||||
HttpURLConnection urlConnection = null;
|
||||
InputStream urlInputStream = null;
|
||||
|
||||
String result;
|
||||
try {
|
||||
urlConnection = (HttpURLConnection) new URL(requestUrl).openConnection();
|
||||
urlConnection.setRequestProperty("Authorization", "Bearer " + accessToken);
|
||||
urlInputStream = urlConnection.getInputStream();
|
||||
result = new String(urlInputStream.readAllBytes(), UTF_8);
|
||||
} catch (IOException e) {
|
||||
throw new OAuthAuthenticationException(e.getMessage(), e);
|
||||
} finally {
|
||||
|
|
@ -108,5 +110,8 @@ public class BitbucketOAuthAuthenticator extends OAuthAuthenticator {
|
|||
urlConnection.disconnect();
|
||||
}
|
||||
}
|
||||
if (isNullOrEmpty(result)) {
|
||||
throw new OAuthAuthenticationException("Empty response from Bitbucket Server API");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<parent>
|
||||
<artifactId>che-master-parent</artifactId>
|
||||
<groupId>org.eclipse.che.core</groupId>
|
||||
<version>7.83.0</version>
|
||||
<version>7.86.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>che-core-api-auth-github-common</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue