Skip to content

Commit

Permalink
Merge pull request #293 from rtimush/load-file-credentials
Browse files Browse the repository at this point in the history
Fix loading credentials from a file
  • Loading branch information
rtimush committed Feb 6, 2022
2 parents cabc809 + 5390d0c commit 51bfb61
Showing 1 changed file with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@ case class RepositoryAuthentication(
object RepositoryAuthentication {

def fromCredentials(c: Credentials): Option[RepositoryAuthentication] =
c match {
case d: DirectCredentials =>
Some(
RepositoryAuthentication(
repositoryId = None,
realm = Some(d.realm),
host = Some(d.host),
user = d.userName,
password = d.passwd,
headers = Nil
)
)
case _ => None
allCatch.opt(Credentials.toDirect(c)).map { d =>
RepositoryAuthentication(
repositoryId = None,
realm = Some(d.realm),
host = Some(d.host),
user = d.userName,
password = d.passwd,
headers = Nil
)
}

def fromCoursier(c: CoursierConfiguration): Seq[RepositoryAuthentication] =
Expand Down

0 comments on commit 51bfb61

Please sign in to comment.