Skip to content

Commit

Permalink
Do not decode access token for git-credentials secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig committed Nov 20, 2024
1 parent 0aec196 commit 2abd0ba
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -13,7 +13,6 @@

import static com.google.common.base.Strings.isNullOrEmpty;
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.eclipse.che.api.factory.server.scm.PersonalAccessTokenFetcher.OAUTH_2_PREFIX;
import static org.eclipse.che.workspace.infrastructure.kubernetes.provision.secret.KubernetesSecretAnnotationNames.ANNOTATION_AUTOMOUNT;
import static org.eclipse.che.workspace.infrastructure.kubernetes.provision.secret.KubernetesSecretAnnotationNames.ANNOTATION_DEV_WORKSPACE_MOUNT_PATH;
Expand All @@ -31,7 +30,6 @@
import io.fabric8.kubernetes.client.KubernetesClient;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -154,7 +152,7 @@ public void createOrReplace(PersonalAccessToken personalAccessToken)
"%s://%s:%s@%s%s",
scmUrl.getProtocol(),
getUsernameSegment(personalAccessToken),
URLEncoder.encode(personalAccessToken.getToken(), UTF_8),
personalAccessToken.getToken(),
scmUrl.getHost(),
scmUrl.getPort() != 80 && scmUrl.getPort() != -1
? ":" + scmUrl.getPort()
Expand Down

0 comments on commit 2abd0ba

Please sign in to comment.