Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
custom print for NugetSourceAuthentication types
  • Loading branch information
haraldsteinlechner committed Oct 27, 2016
commit 35db1e7b2e78903e8bbc926eab39d837cd584df0
11 changes: 10 additions & 1 deletion src/Paket.Core/PackageSources.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,19 @@ type EnvironmentVariable =
else
None


[<StructuredFormatDisplay("{AsString}")>]
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) ->
Expand Down