当前位置: 首页>>代码示例>>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;未经允许,请勿转载。