Repository navigation
initial support for credential providers. - #3069
Conversation
| | Encrypt, Credentials(username, password, authType) -> | ||
| ConfigAuthentication(username, password, authType) | ||
| | Plaintext, Credentials(username, password, authType) -> | ||
| PlainTextAuthentication(username, password, authType) |
There was a problem hiding this comment.
This change is a bit fishy. I have no idea where this information was used (or how it was supposed to be used). Apparently this information was not used at all or I introduced a bug.
| | true -> ConfigAuthentication(username, password, authType) | ||
| | false -> PlainTextAuthentication(username, password, authType) | ||
| | true -> Credentials userPass | ||
| | false -> Credentials userPass |
There was a problem hiding this comment.
What was the effect of this?
|
This PR pretty much makes it possible to use existing NuGet credential providers (https://docs.microsoft.com/en-us/nuget/reference/extensibility/nuget-exe-credential-providers). This works already quite nicely on the development PC, but I have no idea how we get a working story for VSTS Team Build. Any idea @isaacabraham ? |
|
@matthid working story? It should just work now I guess. Perhaps @foxrough can test it out to confirm though? |
|
@isaacabraham I tested it and it doesn't just work. The nuget vsts task is doing a lot of magic internally and brings it's own CredentialProvider to make it work. |
|
Problem is that doesn't quite fit in our model of bootstrapping paket within the build as well as how FAKE5 is working. |
|
My current thinking is:
This would work for Paket and FAKE5 |
|
@matthid I already did a (very simple) Paket and Fake extension in VSTS through the F# Helpers extension (https://marketplace.visualstudio.com/items?itemName=isaacabraham.fsharp-helpers-extension). However it's very simple and probably needs a rewrite if it's going to do anything serious. I'm happy to make you an admin of that repo if you want. Alternatively, perhaps we can look / speak to the NuGet team to see how they're doing it in VSTS? |
|
@isaacabraham Yes I can try to extend there, however the question is more fundamental. I'm pretty sure I know what they are doing, however our workflow looks a bit different. But yes maybe extending your tasks to provide an credential manager (just like nuget does it) makes a lot more use-cases viable. Currently I'm trying around various possibilities and creating new tasks. But I can add them to your suite after they start working. |
|
@isaacabraham I guess that is not best practice but I added https://github.com/matthid/Paket.TeamBuildCredentials and some documentation around it. We can add the tasks to your extension if you are OK with how they work. I tested a bit and everything seems to work just fine. |
94db308 to
3b0a316
Compare
|
|
||
| Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | ||
|
|
||
| System.Net.ServicePointManager.SecurityProtocol <- unbox 192 ||| unbox 768 ||| unbox 3072 ||| unbox 48 |
There was a problem hiding this comment.
You should avoid magic number and assign them to constants before ORing them.
There was a problem hiding this comment.
@haf Yes good eyes ;)
I quickly copy&pasted it from Utils.fs. Basically, I think we need to fix this in either Octokit or FAKE
closes #3021, closes #1509
Paket support for Credential Providers
Paket supports Credential Providers through the same interface as NuGet.
Paket extends the definition and allows to run FDD-NetCore applications to run as well (
*.dllfiles!), so Paket additionally searches forCredentialProvider*.dllfiles in the given paths. For this to work Paket needs to be able to resolve adotnetexecutable from thePATHvariable.Development
For regular paket users installing Credential Providers works the same as for the NuGet client. If you have already installed Credential Providers in
%LOCALAPPDATA%\NuGet\CredentialProviderspaket should pick them up immediatly.Example VSTS:
Download the credential providers from your VSTS Instance.

Extract the
CredentialProvider.VSS.exefile into the above path (%LOCALAPPDATA%\NuGet\CredentialProviders)use paket normally (without password in
paket.dependenciesand config) and enter the password in the provided dialog.CI
There are two options to use Credential Providers in your build agent:
Example VSTS:
Install https://github.com/matthid/Paket.TeamBuildCredentials/releases/tag/0.1.1 on your TFS
Add the "Setup Paket credential manager" build step before calling Paket.
See more infos here