From ffb442e1d9592a9a39553aa27680d51816d8a284 Mon Sep 17 00:00:00 2001 From: Sean Lin Date: Wed, 27 Jun 2018 14:05:35 -0700 Subject: [PATCH] =?UTF-8?q?*=20Highlander=20doesn't=20require=20token=20re?= =?UTF-8?q?fresh=20at=20SDB=20creation=20etc.=20Howev=E2=80=A6=20(#168)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Highlander doesn't require token refresh at SDB creation etc. However it still sends the X-refresh-token=true header and some client that depend on Vault client (Go client) still acknowledge the header and refresh the token. This behavior cause inconvenience when a user is logged into dashboard at the same time. --- gradle.properties | 2 +- .../com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV1.java | 2 +- .../com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV2.java | 2 +- .../com/nike/cerberus/endpoints/sdb/DeleteSafeDepositBox.java | 2 +- .../com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV1.java | 2 +- .../com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV2.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2148ebb24..92e0ddf5c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,6 @@ # limitations under the License. # -version=3.18.0 +version=3.18.1 groupId=com.nike.cerberus artifactId=cms diff --git a/src/main/java/com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV1.java b/src/main/java/com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV1.java index 881e6aff8..34ff39369 100644 --- a/src/main/java/com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV1.java +++ b/src/main/java/com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV1.java @@ -93,7 +93,7 @@ private ResponseInfo> createSafeDepositBox(final RequestInfo return ResponseInfo.newBuilder(map) .withHeaders(new DefaultHttpHeaders() .set(LOCATION, location) - .set(HEADER_X_REFRESH_TOKEN, Boolean.TRUE.toString())) + .set(HEADER_X_REFRESH_TOKEN, Boolean.FALSE.toString())) .withHttpStatusCode(HttpResponseStatus.CREATED.code()) .build(); } diff --git a/src/main/java/com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV2.java b/src/main/java/com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV2.java index a69b621a1..abf0818f2 100644 --- a/src/main/java/com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV2.java +++ b/src/main/java/com/nike/cerberus/endpoints/sdb/CreateSafeDepositBoxV2.java @@ -87,7 +87,7 @@ private ResponseInfo createSafeDepositBox(final RequestInfo deleteSafeDepositBox(final RequestInfo request) safeDepositBoxService.deleteSafeDepositBox(authPrincipal, sdbId); return ResponseInfo.newBuilder().withHttpStatusCode(HttpResponseStatus.OK.code()) - .withHeaders(new DefaultHttpHeaders().set(HEADER_X_REFRESH_TOKEN, Boolean.TRUE.toString())) + .withHeaders(new DefaultHttpHeaders().set(HEADER_X_REFRESH_TOKEN, Boolean.FALSE.toString())) .build(); } diff --git a/src/main/java/com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV1.java b/src/main/java/com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV1.java index 3c984bbab..a6c57f0d2 100644 --- a/src/main/java/com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV1.java +++ b/src/main/java/com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV1.java @@ -82,7 +82,7 @@ private ResponseInfo updateSafeDepositBox(final RequestInfonewBuilder().withHttpStatusCode(HttpResponseStatus.NO_CONTENT.code()) - .withHeaders(new DefaultHttpHeaders().set(HEADER_X_REFRESH_TOKEN, Boolean.TRUE.toString())) + .withHeaders(new DefaultHttpHeaders().set(HEADER_X_REFRESH_TOKEN, Boolean.FALSE.toString())) .build(); } diff --git a/src/main/java/com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV2.java b/src/main/java/com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV2.java index 515661ecb..279d450ce 100644 --- a/src/main/java/com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV2.java +++ b/src/main/java/com/nike/cerberus/endpoints/sdb/UpdateSafeDepositBoxV2.java @@ -81,7 +81,7 @@ private ResponseInfo updateSafeDepositBox(final RequestInfo