Skip to content

Commit

Permalink
Fix coursierint NPE when credential realm is null
Browse files Browse the repository at this point in the history
As stated in sbt#5492 and sbt#2366 some artifact hosting services (at least
Azure Artifacts, seems to affect GCP as well) do not offer a stable HTTP
Auth realm that can be safely set in SBT credentials, hence the need to
support null or empty Credentials.

The Ivy (publishing) side of the issue was fixed in sbt/ivy#36

As to the resolving side, This commit is only part of the solution as it
just prevents an NPE and does not consider if coursier itself will fall
back to finding credentials with a null realm that matches the server
hostname.

Related-to: sbt#5492
Related-to: sbt#2366
Signed-off-by: Erwan Queffelec <erwan.queffelec@gmail.com>
  • Loading branch information
3rwww1 committed May 3, 2020
1 parent 5a529bf commit 23fdb32
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ object CoursierInputsTasks {
.withHost(c.host)
.withUsername(c.userName)
.withPassword(c.passwd)
.withRealm(Some(c.realm).filter(_.nonEmpty))
.withRealm(Option(c.realm).filter(_.nonEmpty))
.withHttpsOnly(false)
.withMatchHost(true)
}
Expand Down

0 comments on commit 23fdb32

Please sign in to comment.