Skip to content

Commit

Permalink
fixup! Respect authorisation request opt-out on workspace start
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuznyetsov authored and vinokurig committed Oct 10, 2023
1 parent 1d18eb8 commit 48c7d2c
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package org.eclipse.che.api.factory.server.git.ssh;

import static org.eclipse.che.api.factory.server.FactoryResolverPriority.LOWEST;
import static org.eclipse.che.api.factory.shared.Constants.CURRENT_VERSION;
import static org.eclipse.che.api.factory.shared.Constants.URL_PARAMETER_NAME;
import static org.eclipse.che.dto.server.DtoFactory.newDto;

Expand Down Expand Up @@ -84,12 +85,16 @@ public FactoryMetaDto createFactory(@NotNull final Map<String, String> factoryPa
// no need to check null value of url parameter as accept() method has performed the check
final GitSshUrl gitSshUrl = gitSshURLParser.parse(factoryParameters.get(URL_PARAMETER_NAME));

return super.createFactory(
factoryParameters,
gitSshUrl,
new GitSshFactoryVisitor(gitSshUrl),
new GitSshAuthorizingFileContentProvider(
gitSshUrl, urlFetcher, personalAccessTokenManager));
// create factory from the following location if location exists, else create default factory
return urlFactoryBuilder
.createFactoryFromDevfile(
gitSshUrl,
new GitSshAuthorizingFileContentProvider(
gitSshUrl, urlFetcher, personalAccessTokenManager),
extractOverrideParams(factoryParameters),
true)
.orElseGet(() -> newDto(FactoryDto.class).withV(CURRENT_VERSION).withSource("repo"))
.acceptVisitor(new GitSshFactoryVisitor(gitSshUrl));
}

/**
Expand Down

0 comments on commit 48c7d2c

Please sign in to comment.