janstenpickle / scala-vault Goto Github PK
View Code? Open in Web Editor NEWHashicorp Vault Scala Libraries
License: MIT License
Hashicorp Vault Scala Libraries
License: MIT License
Add docs for mounts and policies
Currently core only supports data stored in secrets, should support cubbyhole too
Hi,
We have Vault setup with Consul. Is there a way we can query the Vault leader from your scala-vault plugin? Thanks.
Thanks,
Govind
Hello.
I use scala-vault 0.4.1 and it doesn't work with vault 0.10.4.
My code:
val config = VaultConfig(WSClient(new URL("http://localhost:8200")), "root")
val secrets = Secrets(config, "secret")
val response1 = secrets.set("some_secret", "some_key", "some_value")
println(response1.attemptRun)
val response = secrets.getAll("some_secret")
println(response.attemptRun)
Results:
Ok(Fail(Received failure response from server: 404
{"request_id":"4b8b8334-1f9e-8b5e-5970-58f632831756","lease_id":"","renewable":false,"lease_duration":0,"data":null,"wrap_info":null,"warnings":["Invalid path for a versioned K/V secrets engine. See the API docs for the appropriate API endpoints to use. If using the Vault CLI, use 'vault kv put' for this operation."],"auth":null}))
Ok(Fail(Received failure response from server: 404
{"request_id":"2f22cc0f-3ec1-7f24-0d01-e9b74b57b74b","lease_id":"","renewable":false,"lease_duration":0,"data":null,"wrap_info":null,"warnings":["Invalid path for a versioned K/V secrets engine. See the API docs for the appropriate API endpoints to use. If using the Vault CLI, use 'vault kv get' for this operation."],"auth":null}))
With vault 0.6.2 everything works correctly.
I did some debug with simple ruby application (vault doesn't show API calls) and looks like API has been changed:
When I'll try to create secret with official client i get:
127.0.0.1 - - [09/Aug/2018:09:07:25 +0200] "GET /v1/sys/internal/ui/mounts/secret/hello HTTP/1.1" 404 526 0.0095
127.0.0.1 - - [09/Aug/2018:09:07:26 +0200] "PUT /v1/secret/hello HTTP/1.1" 404 483 0.0010
127.0.0.1 - - [09/Aug/2018:09:07:25 CEST] "GET /v1/sys/internal/ui/mounts/secret/hello HTTP/1.1" 404 526
- -> /v1/sys/internal/ui/mounts/secret/hello
127.0.0.1 - - [09/Aug/2018:09:07:25 CEST] "PUT /v1/secret/hello HTTP/1.1" 404 483
- -> /v1/secret/hello
With scala-vault:
127.0.0.1 - - [09/Aug/2018:09:08:22 +0200] "POST /v1/secret/some_secret HTTP/1.1" 404 490 0.0286
127.0.0.1 - - [09/Aug/2018:09:08:22 CEST] "POST /v1/secret/some_secret HTTP/1.1" 404 490
- -> /v1/secret/some_secret
Apologies because I'm probably just being an idiot since I'm new to scala/java, but I can't seem to get this to work.
My project/plugins.sbt is this:
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
and this is my build.sbt:
scalaVersion := "2.11.8"
resolvers += Resolver.bintrayRepo("janstenpickle", "maven")
libraryDependencies += "janstenpickle.vault" %% "vault-core" % "0.4.0"
libraryDependencies += "janstenpickle.vault" %% "vault-auth" % "0.4.0"
libraryDependencies += "janstenpickle.vault" %% "vault-manage" % "0.4.0"
when I try to run sbt console
I get
sbt.ResolveException: unresolved dependency: org.uscala#uscala-result_2.11;0.5.1: not found
unresolved dependency: org.uscala#uscala-result-async_2.11;0.5.1: not found
When I go to https://bintray.com/albertpastrana/maven/uscala-result/0.5.1 to try to figure out what's going on, it says "scalas 2.12.1" Does that mean uscala-result needs scala version 2.12, but scala-vault needs 2.11?
May I know if there will be support for it ? Thanks !
As of Vault 0.6.1, App ID is deprecated in favor of AppRole
Could you update the code accordingly?
Depends on #2
Implement this as per https://www.hashicorp.com/blog/vault-cubbyhole-principles.html
Seeing as the auth
module is designed to support userpass
authentication and the manage
module can be used to enable or disable the userpass
backend it would make sense to include some code for managing users.
Hi,
We're trying to use VaultConfig to connect to a vault server running on docker. Vault is reporting "tls: unsupported SSLv2 handshake received" - this suggests netty 3.1.0 is trying sslv2hello. Has anyone seen this before?
There is another possibility and that is that the root ca cert is not available. Other java clients report this however, so there is a difference.
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.