vault icon indicating copy to clipboard operation
vault copied to clipboard

Vault 1.17.2 uses github.com/pires/go-proxyproto v1.0.0 that doesn't exists

Open TatyanaBol opened this issue 1 year ago • 1 comments

The latest version is github.com/pires/go-proxyproto v0.7.0 Build vault 1.17.2 fails

TatyanaBol avatar Jul 21 '24 11:07 TatyanaBol

Hi there! We use a forked repo version of this repo, and the replace directive is here: https://github.com/hashicorp/vault/blob/main/go.mod#L548

The repo should be public, and seem to be working for most. Could you provide more details as to how the build fails for you? How are you trying to build it, and what is the failure output?

VioletHynes avatar Jul 22 '24 13:07 VioletHynes

replace directives are unfortunately not a good solution.

This repo is documented as the official Go client library (https://developer.hashicorp.com/vault/api-docs/libraries), which means anyone using vault from Go code needs to set that same replace directive in their go.mod.

For reference https://github.com/golang/go/issues/44840#issuecomment-1651863470:

Replace directives remain for local development. If you want to post software that others can go install, it needs to build without the replace directives.

dnephin avatar Sep 05 '24 17:09 dnephin

Hey there, thanks for pointing this out. I'm going to reopen this and discuss this further with the team. Thanks for bringing this to our attention!

VioletHynes avatar Sep 05 '24 17:09 VioletHynes

Actually, @dnephin could you clarify?

In your comment you mentioned that the API library isn't working, but you later said:

which means anyone using vault from Go code

We don't actually have a replacement directive in our API or SDK go.mods, just the main go.mod, which would correspond to github.com/hashicorp/vault. It doesn't seem like this issue would affect API/SDK usage at all.

As we point out in the repo's README, we do not support importing github.com/hashicorp/vault directly and never have. I'm going to keep this re-close this as it seems like this would only affect people importing github.com/hashicorp/vault directly, which is not a supported usage pattern. If I'm incorrect, and this is affecting users of the github.com/hashicorp/vault/sdk and github.com/hashicorp/vault/api packages, I'm happy to re-open as necessary. This should not affect the SDK or API packages.

While this is an aside, if there's something that you're using in the github.com/hashicorp/vault that you think should be added to the SDK or API packages, we'd encourage an issue or pull request with details.

VioletHynes avatar Sep 05 '24 17:09 VioletHynes

Thanks for the reply! Fair point. I'll review where we use packages outside of sdk and api and see about opening an issue for that!

dnephin avatar Sep 05 '24 19:09 dnephin

Thanks! Our general stance is that while you shouldn't be importing github.com/hashicorp/vault, you also shouldn't need to, as there should be everything you need in the api and sdk. If there's a gap or something you're missing, we'd love to know.

VioletHynes avatar Sep 05 '24 19:09 VioletHynes

It looks like we are using the main module for the inMemory test vault:

	vault.TestCoreUnsealedWithConfig(t, coreConfig)
	http.TestServer(t, core)

We can try the docker option.

dnephin avatar Sep 05 '24 21:09 dnephin