How to use the azure-devops-node-api.getBasicHandler function in azure-devops-node-api

To help you get started, we’ve selected a few azure-devops-node-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / azure-pipelines-artifact-caching-tasks / Tasks / Common / packaging-common / locationUtilities.ts View on Github external
export function getWebApiWithProxy(
  serviceUri: string,
  accessToken?: string
): vsts.WebApi {
  if (!accessToken) {
    accessToken = getSystemAccessToken();
  }
  const credentialHandler = vsts.getBasicHandler("vsts", accessToken);

  const options: IRequestOptions = {
    proxy: tl.getHttpProxyConfiguration(serviceUri),
  };
  return new vsts.WebApi(serviceUri, credentialHandler, options);
}
github microsoft / azure-pipelines-tasks / Tasks / Common / packaging-common / locationUtilities.ts View on Github external
export function getWebApiWithProxy(serviceUri: string, accessToken?: string): vsts.WebApi {
    if (!accessToken) {
        accessToken = getSystemAccessToken();
    }

    const credentialHandler = vsts.getBasicHandler('vsts', accessToken);
    const options: IRequestOptions = {
        proxy: tl.getHttpProxyConfiguration(serviceUri),
        allowRetries: true,
        maxRetries: 5
    };
    return new vsts.WebApi(serviceUri, credentialHandler, options);
}
github microsoft / azure-pipelines-tasks / Tasks / Common / artifacts-common / webapi.ts View on Github external
export function getWebApiWithProxy(serviceUri: string, accessToken: string): api.WebApi {
    const credentialHandler = api.getBasicHandler('vsts', accessToken);
    const options: IRequestOptions = {
        proxy: tl.getHttpProxyConfiguration(serviceUri),
        allowRetries: true,
        maxRetries: 5
    };

    return new api.WebApi(serviceUri, credentialHandler, options);
}
github geeklearningio / gl-vsts-tasks-yarn / Tasks / Yarn / packaging / locationUtilities.ts View on Github external
export function getWebApiWithProxy(
  serviceUri: string,
  accessToken?: string
): vsts.WebApi {
  if (!accessToken) {
    accessToken = getSystemAccessToken();
  }

  const credentialHandler = vsts.getBasicHandler("vsts", accessToken);
  const options: IRequestOptions = {
    proxy: tl.getHttpProxyConfiguration(serviceUri),
    allowRetries: true,
    maxRetries: 5
  };
  return new vsts.WebApi(serviceUri, credentialHandler, options);
}