BetterCloud / vault-java-driver

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

Incorrect Lease Duration #209

Open david-streamlio opened 4 years ago

david-streamlio commented 4 years ago

I have created an appRole with the following configuration with a token_ttl of 60 seconds and a token_max_ttl of 8 hours.

{ "request_id": "a45220cb-a8ef-e1f1-c9ed-a4df38189d1b", "lease_id": "", "renewable": false, "lease_duration": 0, "data": { "bind_secret_id": true, "local_secret_ids": false, "secret_id_bound_cidrs": null, "secret_id_num_uses": 0, "secret_id_ttl": 0, "token_bound_cidrs": [], "token_explicit_max_ttl": 0, "token_max_ttl": 28800, "token_no_default_policy": false, "token_num_uses": 0, "token_period": 259200, "token_policies": [ "producer-policy" ], "token_ttl": 60, "token_type": "default" }, "wrap_info": null, "warnings": null, "auth": null }

When I call auth().loginByAppRole( "role id", "secret id"); I am returned an AuthResponse object that has an authLeaseDuration of 28800 instead of 60 as expected. Shouldn't the client token returned have the default TTL and NOT the max TTL?

I believe this is a bug