Fork me on GitHub
#leiningen
<
2021-08-13
>
danm13:08:42

Is there a way to tell lein which region an S3 bucket as a Maven repo is in? I'm hitting a problem where I need to use credentials from account X to access a Maven repo bucket in account Y, and it's failing. Digging into that, it seems to be because Maven is trying to do a bucket location lookup, and permissions for that cannot be granted cross-account. deps.edn allows you to manually specify ?region=xxxxx as part of the repo URL, but the same doesn't seem to be working for project.clj (See https://clojurians.slack.com/archives/C03S1KBA2/p1628859798359100)

deleted14:08:53

and then I'd try path-style addressing and see if it works, like <s3://s3.us-west-2.amazonaws.com/bucketname|s3://s3.us-west-2.amazonaws.com/bucketname>

danm18:08:38

My understanding from the docs is that path style addressing is only valid for http:// bucket paths. Is that wrong? Cool if so

danm18:08:19

Hmm. Doesn't seem to work for the CLI for me 😞

danm18:08:26

Everything I can find about s3-wagon-private is about publishing. I just need to consume what has been published elsewhere. But it's not a public bucket and I don't have a user in the bucket account

danm18:08:41

The issue seems to be that the permissions for GetBucketLocation can only be granted to users/roles in the same account, not cross account like every other API call... So I can ListObjects and GetObject, but if my calls need to look up the location, it fails

danm18:08:11

That's why I can get clj to work, because it provides a param to override the location so the lookup isn't needed

danm18:08:50

Sadly it doesn't look like lein offers the same functionality

ghadi16:08:44

@carr0t clj and lein use different maven libraries

ghadi16:08:56

https://clojure.org/reference/deps_and_cli Have you read the docs about bucket regions?

danm18:08:36

This works fine for clj/`deps.edn`, but not for lein. We still need lein for bits of our build and deployment pipeline

danm18:08:46

I fixed the clj issue later down the linked thread, but lein is still causing issues

danm18:08:27

I guess I could hack something together where I invoke clj to populate my local Maven cache and then launch lein, which finds the relevant files locally, but... eww

ghadi16:08:30

you can set region directly

bajrachar18:08:58

hello everyone - need a bit of help with deploying to clojars.

bajrachar18:08:48

when I run lein deploy clojars it goes through steps of copying over the jar and pom.xml files but chokes on the metdata.xml file -- complaining about missing checksum

bajrachar18:08:52

ReasonPhrase: Forbidden - no checksums provided for <repo.jar.asc>

bajrachar18:08:41

Any idea how I could fix this or debug further