Skip to content

Commit 6cc2e53

Browse files
chandrasekhar1996craman
andauthored
update cookie settings in java client (#2930)
Signed-off-by: craman <chandrasekhar.raman@yahooinc.com> Co-authored-by: craman <chandrasekhar.raman@yahooinc.com>
1 parent e33ed01 commit 6cc2e53

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

clients/java/msd/src/main/java/com/yahoo/athenz/msd/MSDRDLGeneratedClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ public void addCredentials(final String header, final String token) {
137137
CookieStore cookieStore = new BasicCookieStore();
138138
BasicClientCookie cookie = new BasicClientCookie(header.substring(7), token);
139139
cookie.setPath(baseUrl);
140+
cookie.setHttpOnly(true);
141+
cookie.setSecure(true);
140142
cookieStore.addCookie(cookie);
141143
httpContext.setAttribute(HttpClientContext.COOKIE_STORE, cookieStore);
142144
credsHeader = null;

clients/java/zms/src/main/java/com/yahoo/athenz/zms/ZMSRDLGeneratedClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ public void addCredentials(final String header, final String token) {
137137
CookieStore cookieStore = new BasicCookieStore();
138138
BasicClientCookie cookie = new BasicClientCookie(header.substring(7), token);
139139
cookie.setPath(baseUrl);
140+
cookie.setHttpOnly(true);
141+
cookie.setSecure(true);
140142
cookieStore.addCookie(cookie);
141143
httpContext.setAttribute(HttpClientContext.COOKIE_STORE, cookieStore);
142144
credsHeader = null;

clients/java/zts/src/main/java/com/yahoo/athenz/zts/ZTSRDLGeneratedClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ public void addCredentials(final String header, final String token) {
137137
CookieStore cookieStore = new BasicCookieStore();
138138
BasicClientCookie cookie = new BasicClientCookie(header.substring(7), token);
139139
cookie.setPath(baseUrl);
140+
cookie.setHttpOnly(true);
141+
cookie.setSecure(true);
140142
cookieStore.addCookie(cookie);
141143
httpContext.setAttribute(HttpClientContext.COOKIE_STORE, cookieStore);
142144
credsHeader = null;

rdl/rdl-gen-athenz-java-client/javaclient.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ public class {{cName}}Client {
252252
CookieStore cookieStore = new BasicCookieStore();
253253
BasicClientCookie cookie = new BasicClientCookie(header.substring(7), token);
254254
cookie.setPath(baseUrl);
255+
cookie.setHttpOnly(true);
256+
cookie.setSecure(true);
255257
cookieStore.addCookie(cookie);
256258
httpContext.setAttribute(HttpClientContext.COOKIE_STORE, cookieStore);
257259
credsHeader = null;

0 commit comments

Comments
 (0)