Comments (6)
yes you can create a custom service endpoint using extensions. To do that you will need to add a new contribution that targets ms.vss-endpoint.endpoint-types. Here is an example of chef endpoint type contribution that uses basic authentication:
"contributions": [
{
"id": "custom-chef-endpoint-type",
"description": "Service Endpoint type for all Chef connections",
"type": "ms.vss-endpoint.service-endpoint-type",
"targets": [ "ms.vss-endpoint.endpoint-types" ],
"properties": {
"name": "customchef",
"displayName": "Custom Chef",
"authenticationSchemes": [
{
"type": "ms.vss-endpoint.endpoint-auth-scheme-basic",
"inputDescriptors": [
{
"id": "username",
"name": "Node Name (Username)",
"description": "Chef username",
"inputMode": "textbox",
"isConfidential": false,
"validation": {
"isRequired": true,
"dataType": "string"
}
},
{
"id": "password",
"name": "Client Key",
"description": "Client key specified in the .pem file",
"inputMode": "textarea",
"isConfidential": false,
"validation": {
"isRequired": true,
"dataType": "string"
}
}
]
}
],
"helpMarkDown": "Learn More"
}
}
]
from vsts-extension-samples.
For token based authentication, the autheticationSchemes field will look like:
"authenticationSchemes": [
{
"type": "ms.vss-endpoint.endpoint-auth-scheme-token",
"inputDescriptors": [
{
"id": "apitoken",
"name": "API Key",
"description": "API key for connection",
"inputMode": "textbox",
"isConfidential": false,
"validation": {
"isRequired": true,
"dataType": "string"
}
}
],
"headers": [
{
"name": "Authorization",
"value": "api_key {{endpoint.apitoken}}"
}
]
}
]
from vsts-extension-samples.
Thank you very much!
That's precisely what I was searching, although I thought it may be that I should somewhere implement ITaskEndpoint interface. The dictionary that this interface exposes, called Data, contains all of the information about the username and password. The password is however passed as a string. Is there a way to have it persisted as a SecureString?
What does isConfidential property on inputDescriptors do?
For the validation, what sort of dataType's do we have at our disposition?
I'll jump right away on it and check how it works.
Mario
from vsts-extension-samples.
Hi Mario,
All the authentication data belonging to an endpoint(i.e all the fields belonging to authentication scheme) are encrypted and persisted using strongbox service. In memory they are represented as strings, values for which are fetched and unencrypted only when required.
isConfidential false means that input will be visible after typing, if you set it to true that we will mask the input using ******.
For different dataTypes have a look at https://www.visualstudio.com/en-us/integrate/extensions/reference/client/api/vss/common/contracts/forminput/inputdatatype
from vsts-extension-samples.
Thank you for the detailed answers!
from vsts-extension-samples.
In case folks come across this Issue first, another Issue exists that discusses consuming Service Connections in a TypeScript extension: #135
from vsts-extension-samples.
Related Issues (20)
- Is there any way to test dashboard widgets extension locally HOT 1
- Develop own widget on dashboard view
- Grid not showing data in IE11 nor Edge HOT 1
- build-results-enhancer not showing data in IE11 nor Edge HOT 2
- LightboxOptions code in widget
- Getting error while compiling Types Script
- How to use a connected service from a custom Azure Devops extension index.ts? HOT 2
- No emails from data-storage notifications
- Build Results Enhancer no longer works HOT 2
- Missing Repository creation extension point
- Is it possible to register to workitem change event in backlogs panel extension?
- An undefined error occurred while attempting to connect to the server. Status code 0:
- Current Repository in Web Context
- Pull Request Status Menu for policy regardless of genre
- How to get build id from ms.vss-build-web.build-results-tab HOT 1
- How to get workItems in ms.vss-dashboards-web.widget-configuration
- Callback with workitem Id from new workitem window
- VSTS Extension - How to get selected suite data from test suites table on loading of custom tab HOT 1
- This repo is missing important files HOT 4
- Is this project still maintained?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vsts-extension-samples.