There appears to be a broken assumption in the unauthenticated token unwrapping flow.
MWR: (in Scala):
val vaultAddress = "http://localhost:8200"
val wrappingToken = "s.whatever" // obtain from wrapping endpoint or agent
val config = new VaultConfig()
.address(vaultAddress)
.token(token)
.openTimeout(5)
.readTimeout(60)
.build()
val vault = new Vault(config)
val authResponse = vault.auth().unwrap()
val unwrappedToken = authResponse.getAuthClientToken
This follows exactly the client flow listed in the Javadoc to AuthResponse.unwrap().
Expected result: unwrappedToken is a string, which can be used to authenticate further Vault instances.
Actual result:
Exception in thread "main" com.bettercloud.vault.VaultException: java.lang.UnsupportedOperationException: Not an object: null
at com.bettercloud.vault.api.Auth.unwrap(Auth.java:1406)
at com.bettercloud.vault.api.Auth.unwrap(Auth.java:1327)
...
Caused by: java.lang.UnsupportedOperationException: Not an object: null
at com.bettercloud.vault.json.JsonValue.asObject(JsonValue.java:145)
at com.bettercloud.vault.response.AuthResponse.<init>(AuthResponse.java:40)
at com.bettercloud.vault.api.Auth.unwrap(Auth.java:1390)
due to trying to extract an auth property out of the following REST response body:
There appears to be a broken assumption in the unauthenticated token unwrapping flow.
MWR: (in Scala):
This follows exactly the client flow listed in the Javadoc to
AuthResponse.unwrap()
.Expected result:
unwrappedToken
is a string, which can be used to authenticate further Vault instances.Actual result:
due to trying to extract an
auth
property out of the following REST response body: