當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript task.getEndpointAuthorizationParameter函數代碼示例

本文整理匯總了TypeScript中azure-pipelines-task-lib/task.getEndpointAuthorizationParameter函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript getEndpointAuthorizationParameter函數的具體用法?TypeScript getEndpointAuthorizationParameter怎麽用?TypeScript getEndpointAuthorizationParameter使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了getEndpointAuthorizationParameter函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: fetchACRCredential

 public static fetchACRCredential(endpointName: string, registryObject: ACRRegistry): RegistryCredential {
   if (!endpointName || !registryObject) {
     throw Error(`endpointName or registryName is empty when fetching ACR credential`);
   }
   return new RegistryCredential(tl.getEndpointAuthorizationParameter(endpointName, 'serviceprincipalid', true),
     tl.getEndpointAuthorizationParameter(endpointName, 'serviceprincipalkey', true),
     registryObject.loginServer);
 }
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:8,代碼來源:registrycredentialfactory.ts

示例2: createOptimizelyClientInstance

 public createOptimizelyClientInstance(): OptimizelyXClient {
     let endpointId: string = this.taskInputs.getEndpointId();
     let endpointUrl: string = tl.getEndpointUrl(endpointId, false);
     let pat: string = tl.getEndpointAuthorizationParameter(endpointId, 'apitoken', false);
     let oxClient = new OptimizelyXClient(endpointUrl, pat);
     return oxClient;
 }
開發者ID:Microsoft,項目名稱:vsts-rm-extensions,代碼行數:7,代碼來源:TaskOperation.ts

示例3: constructor

    constructor() {
        const serverUrl: string = tl.getVariable('System.TeamFoundationCollectionUri');
        const serverCreds: string = tl.getEndpointAuthorizationParameter('SYSTEMVSSCONNECTION', 'ACCESSTOKEN', false);
        const authHandler = getPersonalAccessTokenHandler(serverCreds);

        const proxy = tl.getHttpProxyConfiguration();
        const options = proxy ? { proxy, ignoreSslError: true } : undefined;

        this.serverConnection = new WebApi(serverUrl, authHandler, options);
    }
開發者ID:Microsoft,項目名稱:vsts-tasks,代碼行數:10,代碼來源:securefiles-common.ts

示例4:

// ===================================================================================================
// TODO: repoUrl could actually be determined as follows:
// var tfsUri = tl.getVariable("System.TeamFoundationServerURI");
// var tfsProject = tl.getVariable("System.TeamProject");
// var repoName = tl.getVariable("Build.RepositoryName");
// var repoUrl = `${tfsUri}/${tfsProject}/${repoName}`;
// unfortunately, the repo name isn't correct in the release vars, so the user must pass it in for now
// ===================================================================================================
var repoUrl = tl.getInput("repoUrl", true);
var pat = tl.getInput("pat", false);

// get build vars
var sourceBranch = tl.getVariable("Build.SourceBranchName");
var buildSourceCommitId = tl.getVariable("Build.SourceVersion");
var token = tl.getEndpointAuthorizationParameter("SystemVssConnection", "AccessToken", false);

tl.debug(`mergeType: ${mergeType}`);
tl.debug(`branchesToMerge: ${branchesToMergeStr}`);
tl.debug(`targetBranch: ${targetBranch}`);
//tl.debug(`testMergeAll: ${testMergeAll}`);
tl.debug(`sourceCommitId: ${sourceCommitId}`);
tl.debug(`remoteName: ${remoteName}`);
tl.debug(`sourceBranch: ${sourceBranch}`);
tl.debug(`buildSourceCommitId: ${buildSourceCommitId}`);
tl.debug(`repoUrl: ${repoUrl}`);
if (ut.isEmpty(pat)) {
    tl.debug("No PAT was provided");
} else {
    tl.debug("A PAT was provided");
}
開發者ID:dtzar,項目名稱:vsts-gitmerge,代碼行數:30,代碼來源:merge.ts


注:本文中的azure-pipelines-task-lib/task.getEndpointAuthorizationParameter函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。