BetterCloud / vault-java-driver

Zero-dependency Java client for HashiCorp's Vault
https://bettercloud.github.io/vault-java-driver/
335 stars 224 forks source link

need kubernetes auth support with jwt #170

Closed zzhu2 closed 5 years ago

zzhu2 commented 5 years ago

We need to login vault which is with Kubernetes jwt to get the vault token.

The auth is very similar than https://github.com/BetterCloud/vault-java-driver/blob/master/src/main/java/com/bettercloud/vault/api/Auth.java#L898 loginByGCP, but will need additional parameter "path", which fortunately already in the model.

Basically it will have an interface like

public AuthResponse loginByKubeJwt(final String path, final String role, final String jwt) throws VaultException

and the builder pattern will allow modify the uri based on path parameter if it's not "/v1/auth/gcp/login"

I can create a PR for that, please let me know either way, thanks a lot.

steve-perkins commented 5 years ago

Does PR #171 resolve this? If so, then it will hopefully be going up to Maven Central tomorrow.

zzhu2 commented 5 years ago

yes this is related to PR #171 and I noticed you have merged the PR for the exactly same problem. thank you, I will give it a try after it's available in Maven Central.

steve-perkins commented 5 years ago

FYI... I have a StackOverflow question open, to resolve the build issues that have prevented this latest version from going out. If anyone has any insights on this, that would be great:

https://stackoverflow.com/questions/56655050/how-to-setup-a-intellij-gradle-project-with-targetcompatibility-1-8-and-sourcec

steve-perkins commented 5 years ago

I have resolved the build issues relating to Java 8 / 9+ compatibility, and updated the documentation for a 4.1.0 release. There are just some flaky integration tests standing between here and that publication.

zzhu2 commented 5 years ago

Kudos! Thanks so much!

steve-perkins commented 5 years ago

Finally resolved all of the integration test issues. A "4.1.0" release has just been tagged here on GitHub, and a binary artifact published to Maven Central. It usually takes a few hours to become accessible.