Skip to content

Commit

Permalink
Addressing code review comments for the URL, Credential verification …
Browse files Browse the repository at this point in the history
…feature
  • Loading branch information
ruhullahshah committed Sep 20, 2017
1 parent d77e013 commit dddf2b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/Paket.Core/PublicAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,17 @@ type Dependencies(dependenciesFileName: string) =
projectName, installAfter, runResolver))

/// Adds credentials for a Nuget feed
member this.AddCredentials(source: string, username: string, password : string, authType : string) : unit =
RunInLockedAccessMode(
this.RootPath,
fun () -> ConfigFile.askAndAddAuth source username password authType false |> returnOrFail )

/// Adds credentials for a Nuget feed
member this.AddCredentials(source: string, username: string, password : string, authType : string, verify : bool) : unit =
RunInLockedAccessMode(
this.RootPath,
fun () -> ConfigFile.askAndAddAuth source username password authType verify |> returnOrFail )

/// Adds a token for a source
member this.AddToken(source : string, token : string) : unit =
RunInLockedAccessMode(this.RootPath, fun () -> ConfigFile.AddToken(source, token) |> returnOrFail)
Expand Down
2 changes: 1 addition & 1 deletion src/Paket.Core/Versioning/ConfigFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ let askAndAddAuth (source : string) (username : string) (password : string) (aut

let authResult =
if verify then
Console.WriteLine "Verifying the source URL and credentials..."
tracef "Verifying the source URL and credentials...\n"
let cred = Credentials(username, password, parseAuthTypeString authType)
checkCredentials(source, Some cred)
else
Expand Down

0 comments on commit dddf2b2

Please sign in to comment.