Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private Ivy repositories do not get their credentials #3599

Closed
zsedem opened this issue Mar 7, 2025 · 7 comments · Fixed by scala-steward-org/sbt-plugin#78
Closed

Private Ivy repositories do not get their credentials #3599

zsedem opened this issue Mar 7, 2025 · 7 comments · Fixed by scala-steward-org/sbt-plugin#78

Comments

@zsedem
Copy link

zsedem commented Mar 7, 2025

We use the Github App to update our repositories, but our dependencies from private Artifactory does not update.
After checking Debug logs I found "unauthorized" errors in the logs, but the credentials clearly right, since the Maven repositories work on the same artifactory.

After digging deeper I found a possible root cause and fixed it in this PR: scala-steward-org/sbt-plugin#78

@mzuehlke
Copy link
Member

mzuehlke commented Mar 9, 2025

Could you explain what the change does, why is was broken before and is better now.
The regex removes all the square brackets.
Our Nexus company repository work with the following
resolver:

{
  "IvyRepository" : {
    "name" : "nexus-ivy",
    "pattern" : "https://bigcorporation.com/repository/ivy-public/[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]"
  }
}

@zsedem
Copy link
Author

zsedem commented Mar 10, 2025

This is only about the credentials. What the change does is fixes the lookup of the credentials of ivy repositories.

Formerly the getHost method was called on:
https://bigcorporation.com/repository/ivy-public/[organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

And the new URL has thrown an exception, because this ivy pattern is not a valid url, until the '[]' are in it, therefore the getHost method returns None, so there won't be credential lookup for the repository.

In the change I only replace the ivyPattern for the getHost lookup, so it can actually retrieve the host from the ivyPattern. I don't use that cleaned Url for anything else, so it won't effect anything else. It will only make it possible to find the credentials for the ivy repository.

@zsedem
Copy link
Author

zsedem commented Mar 10, 2025

How does your company authenticate to the Ivy repository?

@mzuehlke
Copy link
Member

Our nexus is protected by VPN and does not require additional authentication.

@EnviousSwan
Copy link

@zsedem Does scala-steward need a new version published or is there a way to use the latest-version of sbt-plugin?
Or how did you fix the issue after your PR was merged?

@zsedem
Copy link
Author

zsedem commented Mar 12, 2025

I ended up with this as a workaround:

     env:
          COURSIER_CREDENTIALS: |
             company.jfrog.io(Artifactory Realm) ${{ secrets.JFROG_USER }}:${{ secrets.JFROG_RO_TOKEN }}

You can just set the credentials for all cousier access with these credentials and you are done.

@fthomas
Copy link
Member

fthomas commented Mar 14, 2025

Scala Steward 0.33.0 (which includes this fix) was just released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants