Skip to content

Commit

Permalink
Revert JsBaseObjects usage
Browse files Browse the repository at this point in the history
  • Loading branch information
shanggeeth committed Feb 29, 2024
1 parent 93564ae commit 43a6b9a
Show file tree
Hide file tree
Showing 49 changed files with 100 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.wso2.carbon.identity.conditional.auth.functions.analytics;

import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;

import java.util.Map;

Expand All @@ -35,5 +35,5 @@ public interface PublishToAnalyticsFunction {
* @param payloadData payload data.
*/
void publishToAnalytics(Map<String, String> metadata, Map<String, Object> payloadData,
JsBaseAuthenticationContext context);
JsAuthenticationContext context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
import org.graalvm.polyglot.HostAccess;
import org.json.simple.JSONObject;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException;
import org.wso2.carbon.identity.conditional.auth.functions.common.utils.CommonUtils;
import org.wso2.carbon.identity.event.IdentityEventException;
Expand All @@ -52,7 +52,7 @@ public class PublishToAnalyticsFunctionImpl extends AbstractAnalyticsFunction im
@Override
@HostAccess.Export
public void publishToAnalytics(Map<String, String> metadata, Map<String, Object> payloadData,
JsBaseAuthenticationContext context) {
JsAuthenticationContext context) {

/*
* Here, we need to clone the parameters since, even though we're accessing the parameters as Map objects,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import org.wso2.carbon.core.util.CryptoException;
import org.wso2.carbon.core.util.CryptoUtil;
import org.wso2.carbon.core.util.SignatureUtil;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseServletRequest;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseServletResponse;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsServletRequest;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsServletResponse;
import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants;
import org.wso2.carbon.identity.conditional.auth.functions.http.util.HTTPConstants;

Expand All @@ -53,7 +53,7 @@ public class CookieFunctionImpl implements SetCookieFunction, GetCookieFunction

@Override
@Deprecated
public void setCookie(JsBaseServletResponse response, String name, Object... params) {
public void setCookie(JsServletResponse response, String name, Object... params) {

Map<String, Object> properties = null;
if (params.length == 0 || params.length > 2) {
Expand Down Expand Up @@ -124,7 +124,7 @@ public void setCookie(JsBaseServletResponse response, String name, Object... par

@Override
@Deprecated
public String getCookieValue(JsBaseServletRequest request, Object... params) {
public String getCookieValue(JsServletRequest request, Object... params) {

Map<String, Object> properties = null;
if (params.length == 0 || params.length > 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.wso2.carbon.identity.conditional.auth.functions.http;

import org.graalvm.polyglot.HostAccess;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseServletRequest;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsServletRequest;

import java.util.Map;

Expand All @@ -38,6 +38,6 @@ public interface GetCookieFunction {
* @return cookieValue
*/
@HostAccess.Export
String getCookieValue(JsBaseServletRequest request, Object... params);
String getCookieValue(JsServletRequest request, Object... params);

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.wso2.carbon.core.util.CryptoException;
import org.wso2.carbon.core.util.CryptoUtil;
import org.wso2.carbon.core.util.SignatureUtil;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseServletRequest;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsServletRequest;
import org.wso2.carbon.identity.conditional.auth.functions.http.util.HTTPConstants;

import java.nio.charset.StandardCharsets;
Expand All @@ -48,7 +48,7 @@ public class GetCookieFunctionImpl implements GetCookieFunction {

@Override
@HostAccess.Export
public String getCookieValue(JsBaseServletRequest request, Object... params) {
public String getCookieValue(JsServletRequest request, Object... params) {

Map<String, Object> properties = null;
if (params.length == 0 || params.length > 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.wso2.carbon.identity.conditional.auth.functions.http;

import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseServletResponse;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsServletResponse;

import java.util.Map;

Expand All @@ -37,5 +37,5 @@ public interface SetCookieFunction {
* @param params value of the cookie mandatory and optional parameter of cookie with two additional parameters
* encrypt and sign.
*/
void setCookie(JsBaseServletResponse response, String name, Object... params);
void setCookie(JsServletResponse response, String name, Object... params);
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.wso2.carbon.core.util.CryptoException;
import org.wso2.carbon.core.util.CryptoUtil;
import org.wso2.carbon.core.util.SignatureUtil;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseServletResponse;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsServletResponse;
import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants;
import org.wso2.carbon.identity.conditional.auth.functions.http.util.HTTPConstants;

Expand All @@ -47,7 +47,7 @@ public class SetCookieFunctionImpl implements SetCookieFunction {

@Override
@HostAccess.Export
public void setCookie(JsBaseServletResponse response, String name, Object... params) {
public void setCookie(JsServletResponse response, String name, Object... params) {

Map<String, Object> properties = null;
if (params.length == 0 || params.length > 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.wso2.carbon.identity.conditional.auth.functions.notification;

import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticatedUser;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticatedUser;

import java.util.Map;

Expand All @@ -33,6 +33,6 @@ public interface SendEmailFunction {
* @return <code>true</code> if the email is successfully queued to be sent. <code>false</code> If the mail
* couldn't be queued due to any error.
*/
boolean sendMail(JsBaseAuthenticatedUser user, String templateId, Map<String, String> paramMap);
boolean sendMail(JsAuthenticatedUser user, String templateId, Map<String, String> paramMap);

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.graalvm.polyglot.HostAccess;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticatedUser;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticatedUser;
import org.wso2.carbon.identity.conditional.auth.functions.notification.internal.NotificationFunctionServiceHolder;
import org.wso2.carbon.identity.event.IdentityEventConstants;
import org.wso2.carbon.identity.event.IdentityEventException;
Expand All @@ -42,7 +42,7 @@ public class SendEmailFunctionImpl implements SendEmailFunction {

@Override
@HostAccess.Export
public boolean sendMail(JsBaseAuthenticatedUser user, String templateId, Map<String, String> paramMap) {
public boolean sendMail(JsAuthenticatedUser user, String templateId, Map<String, String> paramMap) {

String eventName = IdentityEventConstants.Event.TRIGGER_NOTIFICATION;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.wso2.carbon.identity.conditional.auth.functions.session.function;

import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;

import java.util.Map;

Expand All @@ -35,5 +35,5 @@ public interface ExecuteActionFunction {
* @param map parameter map
* @return boolean value indicating the success or failure state of process
*/
boolean execute(JsBaseAuthenticationContext context, Map<String, String> map);
boolean execute(JsAuthenticationContext context, Map<String, String> map);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
import org.wso2.carbon.identity.conditional.auth.functions.session.exception.SessionValidationException;
Expand Down Expand Up @@ -48,7 +48,7 @@ public class GetSessionDataFunction implements GetUserSessionDataFunction {
* @throws FrameworkException
*/
@Override
public Map<String, Session> getData(JsBaseAuthenticationContext context, Map<String, String> map) throws
public Map<String, Session> getData(JsAuthenticationContext context, Map<String, String> map) throws
FrameworkException {

Map<String, Session> sessionMap = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.wso2.carbon.identity.conditional.auth.functions.session.function;

import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException;
import org.wso2.carbon.identity.conditional.auth.functions.session.model.Session;

Expand All @@ -38,6 +38,6 @@ public interface GetUserSessionDataFunction {
* @return Map of sessionID and sessions
* @throws FrameworkException
*/
Map<String, Session> getData(JsBaseAuthenticationContext context, Map<String, String> map) throws
Map<String, Session> getData(JsAuthenticationContext context, Map<String, String> map) throws
FrameworkException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.wso2.carbon.identity.conditional.auth.functions.session.function;

import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException;

import java.util.Map;
Expand All @@ -37,6 +37,6 @@ public interface IsWithinSessionLimitFunction {
* @return boolean value indicating the validation success/failure
* @throws FrameworkException when exception occurred in session retrieving method
*/
boolean validate(JsBaseAuthenticationContext context, Map<String, String> map)
boolean validate(JsAuthenticationContext context, Map<String, String> map)
throws FrameworkException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.json.JSONObject;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
import org.wso2.carbon.identity.conditional.auth.functions.session.util.SessionValidationConstants;
Expand Down Expand Up @@ -61,7 +61,7 @@ public class IsWithinSessionLimitFunctionImpl implements IsWithinSessionLimitFun
* @throws FrameworkException when exception occurred in session retrieving method
*/
@Override
public boolean validate(JsBaseAuthenticationContext context, Map<String, String> map)
public boolean validate(JsAuthenticationContext context, Map<String, String> map)
throws FrameworkException {

boolean state = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.graalvm.polyglot.HostAccess;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.services.SessionManagementService;
import org.wso2.carbon.identity.conditional.auth.functions.session.util.SessionValidationConstants;
import org.wso2.carbon.utils.xml.StringUtils;
Expand All @@ -42,7 +41,7 @@ public class KillSessionFunction implements ExecuteActionFunction {
* @return boolean value indicating the success or failure state of process
*/
@Override
public boolean execute(JsBaseAuthenticationContext context, Map<String, String> map) {
public boolean execute(JsAuthenticationContext context, Map<String, String> map) {

String sessionId = map.get(SessionValidationConstants.TERMINATION_SESSION_ID);
SessionManagementService sessionManagementService = new SessionManagementService();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.wso2.carbon.identity.conditional.auth.functions.user.store;

import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticatedUser;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsWrapperFactoryProvider;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticatedUser;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
import org.wso2.carbon.identity.conditional.auth.functions.user.store.internal.UserStoreFunctionsServiceHolder;
Expand All @@ -52,7 +50,7 @@ public class UserStoreFunctions implements GetUserWithClaimValues {
public JsAuthenticatedUser getUniqueUserWithClaimValues(Map<String, String> claimMap, Object... parameters)
throws FrameworkException {

JsBaseAuthenticationContext authenticationContext = null;
JsAuthenticationContext authenticationContext = null;
String tenantDomain = null;
String profile = "default";
if (claimMap == null || parameters == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.wso2.carbon.identity.conditional.auth.functions.user;

import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticatedUser;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticatedUser;

import java.util.List;

Expand All @@ -36,5 +36,5 @@ public interface AssignUserRolesFunction {
* @param assigningRoles Roles to be assigned.
* @return <code>true</code> If the role assigning is successfully completed. <code>false</code> for any other case.
*/
boolean assignUserRoles(JsBaseAuthenticatedUser user, List<String> assigningRoles);
boolean assignUserRoles(JsAuthenticatedUser user, List<String> assigningRoles);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.graalvm.polyglot.HostAccess;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticatedUser;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticatedUser;
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException;
import org.wso2.carbon.user.core.UserRealm;
import org.wso2.carbon.user.core.UserStoreException;
Expand All @@ -46,7 +46,7 @@ public class AssignUserRolesFunctionImpl implements AssignUserRolesFunction {
*/
@Override
@HostAccess.Export
public boolean assignUserRoles(JsBaseAuthenticatedUser user, List<String> assigningRoles) {
public boolean assignUserRoles(JsAuthenticatedUser user, List<String> assigningRoles) {

if (user == null) {
LOG.error("User is not defined");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.wso2.carbon.identity.conditional.auth.functions.user;

import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;

import java.util.List;

Expand All @@ -36,5 +36,5 @@ public interface AssignUserRolesV2Function {
* @param roleListToAssign Roles to be assigned.
* @return <code>true</code> If the role assigning is successfully completed. <code>false</code> for any other case.
*/
boolean assignUserRolesV2(JsBaseAuthenticationContext context, List<String> roleListToAssign);
boolean assignUserRolesV2(JsAuthenticationContext context, List<String> roleListToAssign);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.graalvm.polyglot.HostAccess;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext;
import org.wso2.carbon.identity.application.authentication.framework.exception.UserIdNotFoundException;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
import org.wso2.carbon.identity.application.common.IdentityApplicationManagementException;
Expand All @@ -48,7 +48,7 @@ public class AssignUserRolesV2FunctionImpl implements AssignUserRolesV2Function

@Override
@HostAccess.Export
public boolean assignUserRolesV2(JsBaseAuthenticationContext context, List<String> roleListToAssign) {
public boolean assignUserRolesV2(JsAuthenticationContext context, List<String> roleListToAssign) {

if (roleListToAssign == null || roleListToAssign.isEmpty()) {
return false;
Expand Down
Loading

0 comments on commit 43a6b9a

Please sign in to comment.