From 35db1e7b2e78903e8bbc926eab39d837cd584df0 Mon Sep 17 00:00:00 2001 From: Harald Steinlechner Date: Thu, 27 Oct 2016 09:35:05 +0200 Subject: [PATCH] custom print for NugetSourceAuthentication types --- src/Paket.Core/PackageSources.fs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Paket.Core/PackageSources.fs b/src/Paket.Core/PackageSources.fs index 725028a792..eae4a3b7fe 100644 --- a/src/Paket.Core/PackageSources.fs +++ b/src/Paket.Core/PackageSources.fs @@ -27,10 +27,19 @@ type EnvironmentVariable = else None + +[] type NugetSourceAuthentication = | PlainTextAuthentication of username : string * password : string | EnvVarAuthentication of usernameVar : EnvironmentVariable * passwordVar : EnvironmentVariable - | ConfigAuthentication of username : string * password : string + | ConfigAuthentication of username : string * password : string + with + override x.ToString() = + match x with + | PlainTextAuthentication(u,_) -> sprintf "PlainTextAuthentication (username = %s, password = ***)" u + | EnvVarAuthentication(u,_) -> sprintf "EnvVarAuthentication (usernameVar = %s, passwordVar = ***)" u.Variable + | ConfigAuthentication(u,_) -> sprintf "ConfigAuthentication (username = %s, password = ***)" u + member x.AsString = x.ToString() let toBasicAuth = function | PlainTextAuthentication(username,password) | ConfigAuthentication(username, password) ->