Skip to content

Commit

Permalink
custom print for NugetSourceAuthentication types
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldsteinlechner committed Oct 27, 2016
1 parent 6c5fd70 commit 35db1e7
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 35db1e7

Please sign in to comment.