@@ -346,6 +346,7 @@ public AuthResponse createToken(final TokenRequest tokenRequest, final String to
346346 .url (url )
347347 .header ("X-Vault-Token" , config .getToken ())
348348 .header ("X-Vault-Namespace" , this .nameSpace )
349+ .header ("X-Vault-Request" , "true" )
349350 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
350351 .connectTimeoutSeconds (config .getOpenTimeout ())
351352 .readTimeoutSeconds (config .getReadTimeout ())
@@ -414,6 +415,7 @@ public AuthResponse loginByAppID(final String path, final String appId, final St
414415 final RestResponse restResponse = new Rest ()//NOPMD
415416 .url (config .getAddress () + "/v1/auth/" + path )
416417 .optionalHeader ("X-Vault-Namespace" , this .nameSpace )
418+ .header ("X-Vault-Request" , "true" )
417419 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
418420 .connectTimeoutSeconds (config .getOpenTimeout ())
419421 .readTimeoutSeconds (config .getReadTimeout ())
@@ -510,6 +512,7 @@ public AuthResponse loginByAppRole(final String path, final String roleId, final
510512 final RestResponse restResponse = new Rest ()//NOPMD
511513 .url (config .getAddress () + "/v1/auth/" + path + "/login" )
512514 .header ("X-Vault-Namespace" , this .nameSpace )
515+ .header ("X-Vault-Request" , "true" )
513516 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
514517 .connectTimeoutSeconds (config .getOpenTimeout ())
515518 .readTimeoutSeconds (config .getReadTimeout ())
@@ -595,6 +598,7 @@ public AuthResponse loginByUserPass(final String username, final String password
595598 final RestResponse restResponse = new Rest ()//NOPMD
596599 .url (config .getAddress () + "/v1/auth/" + mount + "/login/" + username )
597600 .header ("X-Vault-Namespace" , this .nameSpace )
601+ .header ("X-Vault-Request" , "true" )
598602 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
599603 .connectTimeoutSeconds (config .getOpenTimeout ())
600604 .readTimeoutSeconds (config .getReadTimeout ())
@@ -720,6 +724,7 @@ public AuthResponse loginByAwsEc2(final String role, final String identity, fina
720724 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
721725 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
722726 .header ("X-Vault-Namespace" , this .nameSpace )
727+ .header ("X-Vault-Request" , "true" )
723728 .connectTimeoutSeconds (config .getOpenTimeout ())
724729 .readTimeoutSeconds (config .getReadTimeout ())
725730 .sslVerification (config .getSslConfig ().isVerify ())
@@ -797,6 +802,7 @@ public AuthResponse loginByAwsEc2(final String role, final String pkcs7, final S
797802 final RestResponse restResponse = new Rest ()//NOPMD
798803 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
799804 .header ("X-Vault-Namespace" , this .nameSpace )
805+ .header ("X-Vault-Request" , "true" )
800806 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
801807 .connectTimeoutSeconds (config .getOpenTimeout ())
802808 .readTimeoutSeconds (config .getReadTimeout ())
@@ -878,6 +884,7 @@ public AuthResponse loginByAwsIam(final String role, final String iamRequestUrl,
878884 final RestResponse restResponse = new Rest ()//NOPMD
879885 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
880886 .header ("X-Vault-Namespace" , this .nameSpace )
887+ .header ("X-Vault-Request" , "true" )
881888 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
882889 .connectTimeoutSeconds (config .getOpenTimeout ())
883890 .readTimeoutSeconds (config .getReadTimeout ())
@@ -965,6 +972,7 @@ public AuthResponse loginByGithub(final String githubToken, final String githubA
965972 final RestResponse restResponse = new Rest ()//NOPMD
966973 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
967974 .header ("X-Vault-Namespace" , this .nameSpace )
975+ .header ("X-Vault-Request" , "true" )
968976 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
969977 .connectTimeoutSeconds (config .getOpenTimeout ())
970978 .readTimeoutSeconds (config .getReadTimeout ())
@@ -1031,6 +1039,7 @@ public AuthResponse loginByJwt(final String provider, final String role, final S
10311039 final RestResponse restResponse = new Rest ()
10321040 .url (config .getAddress () + "/v1/auth/" + provider + "/login" )
10331041 .header ("X-Vault-Namespace" , this .nameSpace )
1042+ .header ("X-Vault-Request" , "true" )
10341043 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
10351044 .connectTimeoutSeconds (config .getOpenTimeout ())
10361045 .readTimeoutSeconds (config .getReadTimeout ())
@@ -1173,6 +1182,7 @@ public AuthResponse loginByCert(final String certAuthMount) throws VaultExceptio
11731182 final RestResponse restResponse = new Rest ()//NOPMD
11741183 .url (config .getAddress () + "/v1/auth/" + mount + "/login" )
11751184 .header ("X-Vault-Namespace" , this .nameSpace )
1185+ .header ("X-Vault-Request" , "true" )
11761186 .connectTimeoutSeconds (config .getOpenTimeout ())
11771187 .readTimeoutSeconds (config .getReadTimeout ())
11781188 .sslVerification (config .getSslConfig ().isVerify ())
@@ -1256,6 +1266,7 @@ public AuthResponse renewSelf(final long increment, final String tokenAuthMount)
12561266 .url (config .getAddress () + "/v1/auth/" + mount + "/renew-self" )
12571267 .header ("X-Vault-Token" , config .getToken ())
12581268 .header ("X-Vault-Namespace" , this .nameSpace )
1269+ .header ("X-Vault-Request" , "true" )
12591270 .body (increment < 0 ? null : requestJson .getBytes (StandardCharsets .UTF_8 ))
12601271 .connectTimeoutSeconds (config .getOpenTimeout ())
12611272 .readTimeoutSeconds (config .getReadTimeout ())
@@ -1321,6 +1332,7 @@ public LookupResponse lookupSelf(final String tokenAuthMount) throws VaultExcept
13211332 .url (config .getAddress () + "/v1/auth/" + mount + "/lookup-self" )
13221333 .header ("X-Vault-Token" , config .getToken ())
13231334 .header ("X-Vault-Namespace" , this .nameSpace )
1335+ .header ("X-Vault-Request" , "true" )
13241336 .connectTimeoutSeconds (config .getOpenTimeout ())
13251337 .readTimeoutSeconds (config .getReadTimeout ())
13261338 .sslVerification (config .getSslConfig ().isVerify ())
@@ -1385,6 +1397,7 @@ public LogicalResponse lookupWrap() throws VaultException {
13851397 .url (config .getAddress () + "/v1/sys/wrapping/lookup" )
13861398 .header ("X-Vault-Token" , config .getToken ())
13871399 .header ("X-Vault-Namespace" , this .nameSpace )
1400+ .header ("X-Vault-Request" , "true" )
13881401 .connectTimeoutSeconds (config .getOpenTimeout ())
13891402 .readTimeoutSeconds (config .getReadTimeout ())
13901403 .sslVerification (config .getSslConfig ().isVerify ())
@@ -1447,6 +1460,7 @@ public void revokeSelf(final String tokenAuthMount) throws VaultException {
14471460 .url (config .getAddress () + "/v1/auth/" + mount + "/revoke-self" )
14481461 .header ("X-Vault-Token" , config .getToken ())
14491462 .header ("X-Vault-Namespace" , this .nameSpace )
1463+ .header ("X-Vault-Request" , "true" )
14501464 .connectTimeoutSeconds (config .getOpenTimeout ())
14511465 .readTimeoutSeconds (config .getReadTimeout ())
14521466 .sslVerification (config .getSslConfig ().isVerify ())
@@ -1550,6 +1564,7 @@ public AuthResponse unwrap(final String wrappedToken) throws VaultException {
15501564 .url (url )
15511565 .header ("X-Vault-Token" , config .getToken ())
15521566 .header ("X-Vault-Namespace" , this .nameSpace )
1567+ .header ("X-Vault-Request" , "true" )
15531568 .body (requestJson .getBytes (StandardCharsets .UTF_8 ))
15541569 .connectTimeoutSeconds (config .getOpenTimeout ())
15551570 .readTimeoutSeconds (config .getReadTimeout ())
0 commit comments