Replies: 2 comments
-
|
I think that there will be generally two cases:
For the second case, For the first case though, one simply needs to store or type the credentials somewhere outside the script. |
Beta Was this translation helpful? Give feedback.
-
|
Cross-referencing #293, I suggested making the Credentials though, I think you're right, the ecosystem lacks a really good solution currently. It would be nice if perhaps Coursier could support platform keychains along the lines of sbt-keychain-credentials, and Scala CLI docs might simply point to a reference of how to set those by repo URL in the keychains. Or better yet have a I could create a feature request on Coursier, maybe @alexarchambault won't mind being pinged here to see if that'd make sense and be welcome, since he's active in Scala CLI too. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I just tried porting one of my work Ammonite scripts to
scala-cliand hit on this and I thought it introduced a few interesting questions.Passing credentials to the various tooling in Scala is a giant headache. If I have an sbt build, an Ammonite script, and Coursier locally, they all have their own ways to define repositories and credentials. This isn't just confusing for newcomers either. Search the Scala tools issue list for "credentials" and you'll get a ton of issues both solved and open. It'd be amazing for
scala-cliif this was made easier somehow.From what I can tell, this should require
COURSIER_REPOSITORIESandCOURSIER_CREDENTIALSto be set in order to pull a dependency from a private repo.If this is the recommended way, you already hit on issues since theCOURSIER_CREDENTIALSseems to not really work? I submitted an issue for this a while back, and it seems others have hit on it as well: coursier/coursier#1826. For example I have this set for a script locally and when I try to run it withscala-cli compile .I can see it search through myCOURSIER_REPOSITORIES, but not authenticate. The same happens with coursier cli unless I explicitly pass it the credentials. The same with creating acredentials.propertiesfile, yet another way to do this.So a few points/questions:
If the current way to do this is outlined correctly above, does it work or am I and a handful of others having issues withCOURSIER_CREDENTIALSoutliers?scala-cli? Is there a way we could make this easier for a person at company X to grab a script and run it when it requires an artifact from a private repository without asking them to set those two variables?EDIT: I found the issue with 1 and shot in a pr to fix it. coursier/coursier#2242
Beta Was this translation helpful? Give feedback.
All reactions