【问题标题】:How do add an apitoken as part of a custom VSTS service endpoint datasource?如何将 apitoken 添加为自定义 VSTS 服务端点数据源的一部分?
【发布时间】:2018-06-18 13:51:53
【问题描述】:

我正在尝试实现一个添加新服务端点的 VSTS 扩展。至关重要的是,此服务的身份验证方法将 API 作为查询字符串的一部分。

我将"type": "ms.vss-endpoint.endpoint-auth-scheme-token" 用于AuthenticationScheme。

我已经像这样定义了dataSources:

"dataSources": [
    {
        "name": "TestConnection",
        "endpointUrl": "{{endpoint.url}}projects?token={{endpoint.apitoken}}"
    }
]

但是,在对Verify Connection 进行测试时:

查询服务端点api失败:https://myserver.com/projects?token=。

endpoint.apitoken 始终为空白。

是否有一个占位符/替换值可用于访问该值或实现相同最终结果的其他方式?

我尝试过使用不同的身份验证方案(例如“none”)并包含一个inputDescriptor 来捕获我的apitoken,但我得到了相同的结果。似乎没有办法引用这些值?

【问题讨论】:

    标签: azure-devops azure-pipelines-build-task


    【解决方案1】:

    不,不支持。这篇文章可能会让你受益:Service endpoint authentication schemes

    【讨论】:

    • 我设法使以下工作。我正在使用none 的auth scheme。然后将inputDescriptors 放在父properties 元素上(即,不在authenticationSchemes 上。dataSources 现在能够读取这些值,但是如果值是,它们似乎不会隐藏在日志输出中即使设置了isConfidential,也会回显。
    • 我认为物业不能保密。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-10
    • 2014-04-13
    • 2016-10-14
    • 2022-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多