@@ -381,6 +381,7 @@ public AuthResponse createToken(final TokenRequest tokenRequest, final String to
381381 .url (url )
382382 .header ("X-Vault-Token" , config .getToken ())
383383 .header ("X-Vault-Namespace" , this .nameSpace )
384+ .header ("X-Vault-Request" , "true" )
384385 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
385386 .connectTimeoutSeconds (config .getOpenTimeout ())
386387 .readTimeoutSeconds (config .getReadTimeout ())
@@ -528,6 +529,7 @@ public AuthResponse loginByAppRole(final String path, final String roleId,
528529 final RestResponse restResponse = new Rest ()//NOPMD
529530 .url (config .getAddress () + "/v1/auth/" + path + "/login" )
530531 .header ("X-Vault-Namespace" , this .nameSpace )
532+ .header ("X-Vault-Request" , "true" )
531533 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
532534 .connectTimeoutSeconds (config .getOpenTimeout ())
533535 .readTimeoutSeconds (config .getReadTimeout ())
@@ -604,6 +606,7 @@ public AuthResponse loginByUserPass(final String username, final String password
604606 final RestResponse restResponse = new Rest ()//NOPMD
605607 .url (config .getAddress () + "/v1/auth/" + mount + "/login/" + username )
606608 .header ("X-Vault-Namespace" , this .nameSpace )
609+ .header ("X-Vault-Request" , "true" )
607610 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
608611 .connectTimeoutSeconds (config .getOpenTimeout ())
609612 .readTimeoutSeconds (config .getReadTimeout ())
@@ -723,6 +726,7 @@ public AuthResponse loginByAwsEc2(final String role, final String identity,
723726 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
724727 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
725728 .header ("X-Vault-Namespace" , this .nameSpace )
729+ .header ("X-Vault-Request" , "true" )
726730 .connectTimeoutSeconds (config .getOpenTimeout ())
727731 .readTimeoutSeconds (config .getReadTimeout ())
728732 .sslVerification (config .getSslConfig ().isVerify ())
@@ -789,6 +793,7 @@ public AuthResponse loginByAwsEc2(final String role, final String pkcs7, final S
789793 final RestResponse restResponse = new Rest ()//NOPMD
790794 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
791795 .header ("X-Vault-Namespace" , this .nameSpace )
796+ .header ("X-Vault-Request" , "true" )
792797 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
793798 .connectTimeoutSeconds (config .getOpenTimeout ())
794799 .readTimeoutSeconds (config .getReadTimeout ())
@@ -864,6 +869,7 @@ public AuthResponse loginByAwsIam(final String role, final String iamRequestUrl,
864869 final RestResponse restResponse = new Rest ()//NOPMD
865870 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
866871 .header ("X-Vault-Namespace" , this .nameSpace )
872+ .header ("X-Vault-Request" , "true" )
867873 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
868874 .connectTimeoutSeconds (config .getOpenTimeout ())
869875 .readTimeoutSeconds (config .getReadTimeout ())
@@ -936,6 +942,7 @@ public AuthResponse loginByGithub(final String githubToken, final String githubA
936942 final RestResponse restResponse = new Rest ()//NOPMD
937943 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
938944 .header ("X-Vault-Namespace" , this .nameSpace )
945+ .header ("X-Vault-Request" , "true" )
939946 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
940947 .connectTimeoutSeconds (config .getOpenTimeout ())
941948 .readTimeoutSeconds (config .getReadTimeout ())
@@ -988,6 +995,7 @@ public AuthResponse loginByJwt(final String provider, final String role, final S
988995 final RestResponse restResponse = new Rest ()
989996 .url (config .getAddress () + "/v1/auth/" + provider + "/login" )
990997 .header ("X-Vault-Namespace" , this .nameSpace )
998+ .header ("X-Vault-Request" , "true" )
991999 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
9921000 .connectTimeoutSeconds (config .getOpenTimeout ())
9931001 .readTimeoutSeconds (config .getReadTimeout ())
@@ -1119,6 +1127,7 @@ public AuthResponse loginByCert(final String certAuthMount) throws VaultExceptio
11191127 final RestResponse restResponse = new Rest ()//NOPMD
11201128 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
11211129 .header ("X-Vault-Namespace" , this .nameSpace )
1130+ .header ("X-Vault-Request" , "true" )
11221131 .connectTimeoutSeconds (config .getOpenTimeout ())
11231132 .readTimeoutSeconds (config .getReadTimeout ())
11241133 .sslVerification (config .getSslConfig ().isVerify ())
@@ -1191,6 +1200,7 @@ public AuthResponse renewSelf(final long increment, final String tokenAuthMount)
11911200 .url (config .getAddress () + "/v1/auth/" + mount + "/renew-self" )
11921201 .header ("X-Vault-Token" , config .getToken ())
11931202 .header ("X-Vault-Namespace" , this .nameSpace )
1203+ .header ("X-Vault-Request" , "true" )
11941204 .body (increment < 0 ? null : requestJson .getBytes (StandardCharsets .UTF_8 ))
11951205 .connectTimeoutSeconds (config .getOpenTimeout ())
11961206 .readTimeoutSeconds (config .getReadTimeout ())
@@ -1246,6 +1256,7 @@ public LookupResponse lookupSelf(final String tokenAuthMount) throws VaultExcept
12461256 .url (config .getAddress () + "/v1/auth/" + mount + "/lookup-self" )
12471257 .header ("X-Vault-Token" , config .getToken ())
12481258 .header ("X-Vault-Namespace" , this .nameSpace )
1259+ .header ("X-Vault-Request" , "true" )
12491260 .connectTimeoutSeconds (config .getOpenTimeout ())
12501261 .readTimeoutSeconds (config .getReadTimeout ())
12511262 .sslVerification (config .getSslConfig ().isVerify ())
@@ -1294,6 +1305,7 @@ public LogicalResponse lookupWrap() throws VaultException {
12941305 .url (config .getAddress () + "/v1/sys/wrapping/lookup" )
12951306 .header ("X-Vault-Token" , config .getToken ())
12961307 .header ("X-Vault-Namespace" , this .nameSpace )
1308+ .header ("X-Vault-Request" , "true" )
12971309 .connectTimeoutSeconds (config .getOpenTimeout ())
12981310 .readTimeoutSeconds (config .getReadTimeout ())
12991311 .sslVerification (config .getSslConfig ().isVerify ())
@@ -1343,6 +1355,7 @@ public void revokeSelf(final String tokenAuthMount) throws VaultException {
13431355 .url (config .getAddress () + "/v1/auth/" + mount + "/revoke-self" )
13441356 .header ("X-Vault-Token" , config .getToken ())
13451357 .header ("X-Vault-Namespace" , this .nameSpace )
1358+ .header ("X-Vault-Request" , "true" )
13461359 .connectTimeoutSeconds (config .getOpenTimeout ())
13471360 .readTimeoutSeconds (config .getReadTimeout ())
13481361 .sslVerification (config .getSslConfig ().isVerify ())
@@ -1454,6 +1467,7 @@ public UnwrapResponse unwrap(final String wrappedToken) throws VaultException {
14541467 .url (url )
14551468 .header ("X-Vault-Token" , config .getToken ())
14561469 .header ("X-Vault-Namespace" , this .nameSpace )
1470+ .header ("X-Vault-Request" , "true" )
14571471 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
14581472 .connectTimeoutSeconds (config .getOpenTimeout ())
14591473 .readTimeoutSeconds (config .getReadTimeout ())
@@ -1549,6 +1563,7 @@ public WrapResponse wrap(final JsonObject jsonObject, int ttlInSec) throws Vault
15491563 .header ("X-Vault-Token" , config .getToken ())
15501564 .header ("X-Vault-Wrap-TTL" , Integer .toString (ttlInSec ))
15511565 .header ("X-Vault-Namespace" , this .nameSpace )
1566+ .header ("X-Vault-Request" , "true" )
15521567 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
15531568 .connectTimeoutSeconds (config .getOpenTimeout ())
15541569 .readTimeoutSeconds (config .getReadTimeout ())
0 commit comments