Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transit uris #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/src/main/scala/com/banno/vault/transit/Transit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ final class TransitClient[F[_]](client: Client[F], vaultUri: Uri, token: String,
/* The URIs we use here are those from the transit documentation.
* the v1 prefix is specified in https://www.vaultproject.io/api/overview
*/
private val encryptUri: Uri = vaultUri / "v1" / "transit" / "encrypt" / key.name
private val decryptUri: Uri = vaultUri / "v1" / "transit" / "decrypt" / key.name
private val readKeyUri: Uri = vaultUri / "v1" / "transit" / "keys" / key.name

private val encryptUri: Uri = vaultUri.withPath(s"/v1/transit/encrypt/${key.name}")
private val decryptUri: Uri = vaultUri.withPath(s"/v1/transit/decrypt/${key.name}")
private val readKeyUri: Uri = vaultUri.withPath(s"/v1/transit/keys/${key.name}")

private val tokenHeaders: Headers = Headers.of(Header("X-Vault-Token", token))

Expand Down