mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
Fetch error when creating token without request
This commit is contained in:
@@ -35,6 +35,9 @@ package sonia.scm.repository;
|
|||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
|
import com.google.inject.ProvisionException;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import sonia.scm.web.HgUtil;
|
import sonia.scm.web.HgUtil;
|
||||||
|
|
||||||
//~--- JDK imports ------------------------------------------------------------
|
//~--- JDK imports ------------------------------------------------------------
|
||||||
@@ -50,6 +53,8 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
public final class HgEnvironment
|
public final class HgEnvironment
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(HgEnvironment.class);
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
public static final String ENV_PYTHON_PATH = "PYTHONPATH";
|
public static final String ENV_PYTHON_PATH = "PYTHONPATH";
|
||||||
|
|
||||||
@@ -109,8 +114,12 @@ public final class HgEnvironment
|
|||||||
hookUrl = hookManager.createUrl();
|
hookUrl = hookManager.createUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
String credentials = hookManager.getCredentials();
|
try {
|
||||||
environment.put(SCM_BEARER_TOKEN, credentials);
|
String credentials = hookManager.getCredentials();
|
||||||
|
environment.put(SCM_BEARER_TOKEN, credentials);
|
||||||
|
} catch (ProvisionException e) {
|
||||||
|
LOG.debug("could not create bearer token; looks like currently we are not in a request", e);
|
||||||
|
}
|
||||||
environment.put(ENV_PYTHON_PATH, HgUtil.getPythonPath(handler.getConfig()));
|
environment.put(ENV_PYTHON_PATH, HgUtil.getPythonPath(handler.getConfig()));
|
||||||
environment.put(ENV_URL, hookUrl);
|
environment.put(ENV_URL, hookUrl);
|
||||||
environment.put(ENV_CHALLENGE, hookManager.getChallenge());
|
environment.put(ENV_CHALLENGE, hookManager.getChallenge());
|
||||||
|
|||||||
Reference in New Issue
Block a user