You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the only authentication mechanism supported by the mirror task is URI encoding with basic auth in the userinfo subcomponent. Though this is a viable means of authentication with the major git hosting platforms, it's generally discouraged, not necessarily universally supported, and there are of course several other preferable ways to authenticate.
The lack of support for alternatives has been reported as a problem (e.g. #63, #10) and more generally it'd be good for us to support other use cases (e.g. #85, #1)
For anyone interested in working on this, some details/hints are below. It would also probably be a good idea to include support for one of the other authentication mechanisms as part of the PR that addresses this issue (the easiest one may be None)
Two new inputs needs to be added to the task that allow the user to specify the authentication mechanism, one for the Source repo and another for the Target repo (for example sourceGitRepositoryAuthenticationMechanism and destinationGitRepositoryAuthenticationMechanism
Both should be of type picklist since we'll eventually support several such mechanisms
I imagine the first values should have display names like access token (current available option), and probably none
The existing inputs for the access tokens (sourceGitRepositoryPersonalAccessToken and destinationGitRepositoryPersonalAccessToken) need to have visibleRules wired up based on the value of the respective new inputs created in the preceding step
The task code that loads the input values needs to be updated to import the value of the new inputs, and then the second boolean arg used for other getInput calls to indicate whether the input is required will need to be updated to be set dynamically based on the value of the new authentication mechanism input fields vs. a literal bool. e.g. the second arg to getInput will be based on the value of destinationGitRepositoryAuthenticationMechanism
The task code will need to be updated to build the uri and potentially the git command args/flags (for example with Support authorization via header #85-c http.extraheader="AUTHORIZATION: .....) based on the new input values
Currently the only authentication mechanism supported by the mirror task is URI encoding with basic auth in the userinfo subcomponent. Though this is a viable means of authentication with the major git hosting platforms, it's generally discouraged, not necessarily universally supported, and there are of course several other preferable ways to authenticate.
The lack of support for alternatives has been reported as a problem (e.g. #63, #10) and more generally it'd be good for us to support other use cases (e.g. #85, #1)
For anyone interested in working on this, some details/hints are below. It would also probably be a good idea to include support for one of the other authentication mechanisms as part of the PR that addresses this issue (the easiest one may be
None
)sourceGitRepositoryAuthenticationMechanism
anddestinationGitRepositoryAuthenticationMechanism
picklist
since we'll eventually support several such mechanismsaccess token
(current available option), and probablynone
sourceGitRepositoryPersonalAccessToken
anddestinationGitRepositoryPersonalAccessToken
) need to havevisibleRule
s wired up based on the value of the respective new inputs created in the preceding stepvisibleRule
https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/AzureFileCopyV4/task.json#L77getInput
calls to indicate whether the input is required will need to be updated to be set dynamically based on the value of the new authentication mechanism input fields vs. a literal bool. e.g. the second arg togetInput
will be based on the value ofdestinationGitRepositoryAuthenticationMechanism
vsts-mirror-git-repository/src/git-mirror/git-mirror-task.ts
Line 25 in 3b11470
-c http.extraheader="AUTHORIZATION: .....
) based on the new input valuesvsts-mirror-git-repository/src/git-mirror/git-mirror-task.ts
Lines 128 to 141 in 3b11470
vsts-mirror-git-repository/src/git-mirror/git-mirror-task.ts
Lines 91 to 104 in 3b11470
The text was updated successfully, but these errors were encountered: