Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Thumimku committed Dec 11, 2024
1 parent f30c591 commit 2b04eef
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,6 @@ public String getCookieValue(JsServletRequest request, Object... params) {
try {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext()
.getTenantDomain();
// For getCookie, setCookie functionalities tenant shouldn't use its tenanted keystore.
// Hence, below code will create a keystore for this context if not exists.
HTTPFunctionsServiceHolder.getInstance().getIdentityKeyStoreGenerator()
.generateKeyStoreIfNotExists(tenantDomain, KEY_STORE_CONTEXT);
boolean isValid = IdentityUtil.validateSignatureFromTenant(valueString, signature,
tenantDomain, KEY_STORE_CONTEXT);
if (!isValid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ public String getCookieValue(JsServletRequest request, Object... params) {
try {
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext()
.getTenantDomain();
// For getCookie, setCookie functionalities tenant shouldn't use its tenanted keystore.
// Hence, below code will create a keystore for this context if not exists.
HTTPFunctionsServiceHolder.getInstance().getIdentityKeyStoreGenerator()
.generateKeyStoreIfNotExists(tenantDomain, KEY_STORE_CONTEXT);
boolean isValid = IdentityUtil.validateSignatureFromTenant(valueString, signature,
tenantDomain, KEY_STORE_CONTEXT);
if (!isValid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void setCookie(JsServletResponse response, String name, Object... params)
// For getCookie, setCookie functionalities tenant shouldn't use its tenanted keystore.
// Hence, below code will create a keystore for this context if not exists.
HTTPFunctionsServiceHolder.getInstance().getIdentityKeyStoreGenerator()
.generateKeyStoreIfNotExists(tenantDomain, KEY_STORE_CONTEXT);
.generateKeyStore(tenantDomain, KEY_STORE_CONTEXT);
signature = Base64.encode(IdentityUtil.signWithTenantKey(value, tenantDomain, KEY_STORE_CONTEXT));
} catch (Exception e) {
log.error("Error occurred when signing the cookie value.", e);
Expand Down

0 comments on commit 2b04eef

Please sign in to comment.