├── README.md
├── .travis.yml
├── .github
├── ISSUE_TEMPLATE
│ └── config.yml
└── workflows
│ └── pr-builder.yml
├── codecov.yml
├── .gitignore
├── issue_template.md
├── components
├── org.wso2.carbon.identity.conditional.auth.functions.common
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── identity
│ │ └── conditional
│ │ └── auth
│ │ └── functions
│ │ └── common
│ │ ├── model
│ │ ├── JsUtils.java
│ │ ├── graaljs
│ │ │ └── JsGraalUtils.java
│ │ ├── nashorn
│ │ │ └── JsNashornUtils.java
│ │ ├── openjdk
│ │ │ └── nashorn
│ │ │ │ └── JsOpenJdkNashornUtils.java
│ │ └── JsUtilsProvider.java
│ │ ├── auth
│ │ ├── Credentials.java
│ │ ├── AuthenticationManager.java
│ │ ├── AuthenticationFactory.java
│ │ ├── BasicAuthenticationManager.java
│ │ ├── BasicUserPrincipal.java
│ │ └── UsernamePasswordCredentials.java
│ │ └── internal
│ │ ├── FunctionsDataHolder.java
│ │ └── FunctionsServiceComponent.java
├── org.wso2.carbon.identity.conditional.auth.functions.elk
│ └── src
│ │ ├── main
│ │ ├── resources
│ │ │ └── queries
│ │ │ │ └── risk_profile_query.json
│ │ └── java
│ │ │ └── org
│ │ │ └── wso2
│ │ │ └── carbon
│ │ │ └── identity
│ │ │ └── conditional
│ │ │ └── auth
│ │ │ └── functions
│ │ │ └── elk
│ │ │ ├── CallElasticFunction.java
│ │ │ └── internal
│ │ │ └── ElasticFunctionsServiceHolder.java
│ │ └── test
│ │ └── resources
│ │ └── testng.xml
├── org.wso2.carbon.identity.conditional.auth.functions.jwt.decode
│ └── src
│ │ ├── test
│ │ └── resources
│ │ │ └── testng.xml
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── identity
│ │ └── conditional
│ │ └── auth
│ │ └── functions
│ │ └── jwt
│ │ └── decode
│ │ ├── JwtDecode.java
│ │ └── internal
│ │ └── JwtDecodeServiceHolder.java
├── org.wso2.carbon.identity.conditional.auth.functions.choreo
│ └── src
│ │ ├── test
│ │ └── resources
│ │ │ ├── org
│ │ │ └── wso2
│ │ │ │ └── carbon
│ │ │ │ └── identity
│ │ │ │ └── conditional
│ │ │ │ └── auth
│ │ │ │ └── functions
│ │ │ │ └── choreo
│ │ │ │ └── choreo-payload.json
│ │ │ └── testng.xml
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── identity
│ │ └── conditional
│ │ └── auth
│ │ └── functions
│ │ └── choreo
│ │ ├── cache
│ │ └── ChoreoAccessTokenCache.java
│ │ ├── CallChoreoFunction.java
│ │ └── listener
│ │ └── ChoreoAxis2ConfigurationContextObserver.java
├── org.wso2.carbon.identity.conditional.auth.functions.http
│ └── src
│ │ ├── test
│ │ └── resources
│ │ │ ├── org
│ │ │ └── wso2
│ │ │ │ └── carbon
│ │ │ │ └── identity
│ │ │ │ └── conditional
│ │ │ │ └── auth
│ │ │ │ └── functions
│ │ │ │ └── http
│ │ │ │ ├── http-get-response.json
│ │ │ │ └── http-post-payload.json
│ │ │ └── testng.xml
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── identity
│ │ └── conditional
│ │ └── auth
│ │ └── functions
│ │ └── http
│ │ ├── HTTPGetFunction.java
│ │ ├── util
│ │ ├── AuthConfig.java
│ │ ├── HTTPConstants.java
│ │ ├── AuthConfigModel.java
│ │ ├── BearerAuthConfig.java
│ │ ├── ApiKeyAuthConfig.java
│ │ ├── BasicAuthConfig.java
│ │ └── HttpUtil.java
│ │ ├── HTTPPostFunction.java
│ │ ├── GetCookieFunction.java
│ │ ├── cache
│ │ └── APIAccessTokenCache.java
│ │ ├── SetCookieFunction.java
│ │ └── internal
│ │ └── HTTPFunctionsServiceHolder.java
├── org.wso2.carbon.identity.conditional.auth.functions.analytics
│ └── src
│ │ ├── test
│ │ └── resources
│ │ │ ├── org
│ │ │ └── wso2
│ │ │ │ └── carbon
│ │ │ │ └── identity
│ │ │ │ └── conditional
│ │ │ │ └── auth
│ │ │ │ └── functions
│ │ │ │ └── analytics
│ │ │ │ └── analytics-payload.json
│ │ │ └── testng.xml
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── identity
│ │ └── conditional
│ │ └── auth
│ │ └── functions
│ │ └── analytics
│ │ ├── PublishToAnalyticsFunction.java
│ │ ├── CallAnalyticsFunction.java
│ │ ├── listener
│ │ └── AnalyticsAxis2ConfigurationContextObserver.java
│ │ └── internal
│ │ └── AnalyticsFunctionsServiceHolder.java
├── org.wso2.carbon.identity.conditional.auth.functions.utils
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── org
│ │ │ └── wso2
│ │ │ └── carbon
│ │ │ └── identity
│ │ │ └── conditional
│ │ │ └── auth
│ │ │ └── functions
│ │ │ └── utils
│ │ │ ├── GetMaskedValueFunction.java
│ │ │ ├── FilterAuthenticatorsFunction.java
│ │ │ ├── GetMaskedValueFunctionImpl.java
│ │ │ ├── ResolveMultiAttributeLoginIdentifierFunction.java
│ │ │ ├── internal
│ │ │ └── UtilsFunctionServiceHolder.java
│ │ │ ├── ResolveMultiAttributeLoginIdentifierFunctionImpl.java
│ │ │ └── FilterAuthenticatorsFunctionImpl.java
│ │ └── test
│ │ └── resources
│ │ ├── testng.xml
│ │ ├── dbscripts
│ │ └── h2.sql
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── identity
│ │ └── conditional
│ │ └── auth
│ │ └── functions
│ │ └── utils
│ │ └── get-masked-value-sp.xml
├── org.wso2.carbon.identity.conditional.auth.functions.user
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── org
│ │ │ └── wso2
│ │ │ └── carbon
│ │ │ └── identity
│ │ │ └── conditional
│ │ │ └── auth
│ │ │ └── functions
│ │ │ └── user
│ │ │ ├── PromptIdentifierFunction.java
│ │ │ ├── exception
│ │ │ ├── UserSessionRetrievalException.java
│ │ │ └── UserSessionTerminationException.java
│ │ │ ├── MicrosoftEmailVerificationFunction.java
│ │ │ ├── RemoveAssociatedLocalUserFunction.java
│ │ │ ├── GetAssociatedLocalUserFunction.java
│ │ │ ├── UpdateUserPasswordFunction.java
│ │ │ ├── model
│ │ │ ├── JsUserAgent.java
│ │ │ ├── JsApplication.java
│ │ │ ├── JsUserSession.java
│ │ │ ├── JsWrapperFactory.java
│ │ │ ├── JsWrapperBaseFactory.java
│ │ │ ├── JsGraalWrapperFactory.java
│ │ │ ├── nashorn
│ │ │ │ ├── JsNashornApplication.java
│ │ │ │ └── JsNashornUserAgent.java
│ │ │ ├── openjdk
│ │ │ │ └── nashorn
│ │ │ │ │ ├── JsOpenJdkNashornApplication.java
│ │ │ │ │ └── JsOpenJdkNashornUserAgent.java
│ │ │ ├── JsOpenJdkNashornWrapperFactory.java
│ │ │ └── graaljs
│ │ │ │ └── JsGraalApplication.java
│ │ │ ├── GetUserSessionsFunction.java
│ │ │ ├── CheckSessionExistenceFunction.java
│ │ │ ├── GetAuthenticatedApplicationsFunction.java
│ │ │ ├── GetAuthenticatedApplicationsV2Function.java
│ │ │ ├── TerminateUserSession.java
│ │ │ ├── AssignUserRolesV2Function.java
│ │ │ ├── RemoveUserRolesV2Function.java
│ │ │ ├── AssignUserRolesFunction.java
│ │ │ ├── RemoveUserRolesFunction.java
│ │ │ ├── IsMemberOfAnyOfGroupsFunction.java
│ │ │ ├── HasAnyOfTheRolesV2Function.java
│ │ │ ├── HasRoleFunction.java
│ │ │ ├── HasAnyOfTheRolesFunction.java
│ │ │ ├── SetAccountAssociationToLocalUser.java
│ │ │ ├── IsAnyOfTheRolesAssignedToUserFunction.java
│ │ │ └── GetAuthenticatedApplicationsV2FunctionImpl.java
│ │ └── test
│ │ └── resources
│ │ └── dbscripts
│ │ └── h2.sql
├── org.wso2.carbon.identity.conditional.auth.functions.test.utils
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── identity
│ │ └── conditional
│ │ └── auth
│ │ └── functions
│ │ └── test
│ │ └── utils
│ │ ├── api
│ │ └── SubjectCallback.java
│ │ └── sequence
│ │ ├── ResponseValidator.java
│ │ └── JsTestException.java
├── org.wso2.carbon.identity.conditional.auth.functions.session
│ └── src
│ │ ├── test
│ │ ├── resources
│ │ │ └── testng.xml
│ │ └── java
│ │ │ └── org
│ │ │ └── wso2
│ │ │ └── carbon
│ │ │ └── identity
│ │ │ └── conditional
│ │ │ └── auth
│ │ │ └── functions
│ │ │ └── session
│ │ │ └── test
│ │ │ ├── TestUtils.java
│ │ │ └── SessionModelTest.java
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── identity
│ │ └── conditional
│ │ └── auth
│ │ └── functions
│ │ └── session
│ │ ├── exception
│ │ └── SessionValidationException.java
│ │ ├── function
│ │ ├── ExecuteActionFunction.java
│ │ ├── GetUserSessionDataFunction.java
│ │ └── IsWithinSessionLimitFunction.java
│ │ └── model
│ │ └── Session.java
├── org.wso2.carbon.identity.conditional.auth.functions.user.store
│ └── src
│ │ └── main
│ │ └── java
│ │ └── org
│ │ └── wso2
│ │ └── carbon
│ │ └── identity
│ │ └── conditional
│ │ └── auth
│ │ └── functions
│ │ └── user
│ │ └── store
│ │ ├── GetUserWithClaimValues.java
│ │ ├── GetUserWithClaimValuesV2Function.java
│ │ ├── GetUserWithClaimValuesV2FunctionImpl.java
│ │ ├── GetUsersWithClaimValuesFunctionImpl.java
│ │ ├── internal
│ │ └── UserStoreFunctionsServiceHolder.java
│ │ └── GetUsersWithClaimValuesFunction.java
└── org.wso2.carbon.identity.conditional.auth.functions.notification
│ └── src
│ ├── test
│ └── resources
│ │ ├── testng.xml
│ │ └── dbscripts
│ │ └── h2.sql
│ └── main
│ └── java
│ └── org
│ └── wso2
│ └── carbon
│ └── identity
│ └── conditional
│ └── auth
│ └── functions
│ └── notification
│ ├── SendEmailFunction.java
│ └── internal
│ └── NotificationFunctionServiceHolder.java
└── pull_request_template.md
/README.md:
--------------------------------------------------------------------------------
1 | # identity-conditional-auth-functions
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - openjdk8
4 | cache:
5 | directories:
6 | - .autoconf
7 | - $HOME/.m2
8 | script: mvn clean install
9 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Report an issue
4 | url: https://github.com/wso2/product-is/issues/new/choose
5 | about: Issue creation for this component is done in the product-is repo. Click "Open" to continue.
6 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | codecov:
2 | require_ci_to_pass: yes
3 | notify:
4 | wait_for_ci: yes
5 | max_report_age: false
6 |
7 | coverage:
8 | status:
9 | project: off
10 | patch: off
11 |
12 | flag_management:
13 | default_rules:
14 | carryforward: true
15 | individual_flags:
16 | - name: unit
17 | statuses:
18 | - type: project
19 | target: auto
20 | threshold: null
21 | - type: patch
22 | target: 80%
23 | threshold: 40%
24 |
25 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 | .classpath
3 | .settings
4 | .project
5 | *.iml
6 | *.iws
7 | *.ipr
8 | .idea
9 | .DS_Store
10 |
11 | # Mobile Tools for Java (J2ME)
12 | .mtj.tmp/
13 |
14 | # Package Files #
15 | *.jar
16 | *.war
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 |
23 | # Log file
24 | *.log
25 |
26 | # BlueJ files
27 | *.ctxt
28 |
29 |
30 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
31 | hs_err_pid*
32 |
33 | # Ignore everything in this directory
34 | target
--------------------------------------------------------------------------------
/issue_template.md:
--------------------------------------------------------------------------------
1 | **Description:**
2 |
3 |
4 | **Suggested Labels:**
5 |
6 |
7 | **Suggested Assignees:**
8 |
9 |
10 | **Affected Product Version:**
11 |
12 | **OS, DB, other environment details and versions:**
13 |
14 | **Steps to reproduce:**
15 |
16 |
17 | **Related Issues:**
18 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.common/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/common/model/JsUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
3 | *
4 | * WSO2 LLC. licenses this file to you under the Apache License,
5 | * Version 2.0 (the "License"); you may not use this file except
6 | * in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing,
12 | * software distributed under the License is distributed on an
13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | * KIND, either express or implied. See the License for the
15 | * specific language governing permissions and limitations
16 | * under the License.
17 | */
18 |
19 | package org.wso2.carbon.identity.conditional.auth.functions.common.model;
20 |
21 | public interface JsUtils {
22 |
23 | boolean isArray(Object obj);
24 | }
25 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.elk/src/main/resources/queries/risk_profile_query.json:
--------------------------------------------------------------------------------
1 | {
2 | "query": {
3 | "bool": {
4 | "must": [
5 | {
6 | "match": {
7 | "username.keyword": "[ES_QUERY_PARAM_USERNAME]"
8 | }
9 | }
10 | ],
11 | "filter": [
12 | {
13 | "range": {
14 | "@timestamp": {
15 | "gte": "now-[ES_QUERY_PARAM_DURATION]"
16 | }
17 | }
18 | }
19 | ]
20 | }
21 | },
22 | "aggs": {
23 | "risk_score": {
24 | "scripted_metric": {
25 | "init_script": "state.sum = [];",
26 | "map_script": "[ES_QUERY_PARAM_LOGIC]",
27 | "combine_script": "int sum = 0; for (t in state.sum) { sum += t } return sum",
28 | "reduce_script": "int sum = 0; for (a in states) { sum += a } return sum > [ES_QUERY_PARAM_THRESHOLD] ? 1 : 0"
29 | }
30 | }
31 | }
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.jwt.decode/src/test/resources/testng.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.choreo/src/test/resources/org/wso2/carbon/identity/conditional/auth/functions/choreo/choreo-payload.json:
--------------------------------------------------------------------------------
1 | {
2 | "stringKey": "stringValue",
3 | "numberKey": 123,
4 | "booleanKey": true,
5 | "arrayKey": [
6 | "arrayString",
7 | 456,
8 | false,
9 | {
10 | "nestedObjectInArrayKey": "nestedObjectValue",
11 | "nestedArrayInArrayKey": ["nestedArrayValue1", "nestedArrayValue2"]
12 | }
13 | ],
14 | "objectKey": {
15 | "objectStringKey": "objectStringValue",
16 | "objectNumberKey": 789,
17 | "objectBooleanKey": false,
18 | "nestedObjectKey": {
19 | "nestedObjectStringKey": "nestedObjectStringValue",
20 | "nestedObjectArrayKey": [
21 | "nestedArrayValue1",
22 | 101112,
23 | true
24 | ]
25 | },
26 | "arrayOfObjectsKey": [
27 | {
28 | "arrayOfObjectsStringKey": "arrayOfObjectsStringValue1",
29 | "arrayOfObjectsNumberKey": 131415,
30 | "arrayOfObjectsBooleanKey": true
31 | },
32 | {
33 | "arrayOfObjectsStringKey": "arrayOfObjectsStringValue2",
34 | "arrayOfObjectsNumberKey": 161718,
35 | "arrayOfObjectsBooleanKey": false
36 | }
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/resources/org/wso2/carbon/identity/conditional/auth/functions/http/http-get-response.json:
--------------------------------------------------------------------------------
1 | {
2 | "stringKey": "stringValue",
3 | "numberKey": 123,
4 | "booleanKey": true,
5 | "arrayKey": [
6 | "arrayString",
7 | 456,
8 | false,
9 | {
10 | "nestedObjectInArrayKey": "nestedObjectValue",
11 | "nestedArrayInArrayKey": ["nestedArrayValue1", "nestedArrayValue2"]
12 | }
13 | ],
14 | "objectKey": {
15 | "objectStringKey": "objectStringValue",
16 | "objectNumberKey": 789,
17 | "objectBooleanKey": false,
18 | "nestedObjectKey": {
19 | "nestedObjectStringKey": "nestedObjectStringValue",
20 | "nestedObjectArrayKey": [
21 | "nestedArrayValue1",
22 | 101112,
23 | true
24 | ]
25 | },
26 | "arrayOfObjectsKey": [
27 | {
28 | "arrayOfObjectsStringKey": "arrayOfObjectsStringValue1",
29 | "arrayOfObjectsNumberKey": 131415,
30 | "arrayOfObjectsBooleanKey": true
31 | },
32 | {
33 | "arrayOfObjectsStringKey": "arrayOfObjectsStringValue2",
34 | "arrayOfObjectsNumberKey": 161718,
35 | "arrayOfObjectsBooleanKey": false
36 | }
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.http/src/test/resources/org/wso2/carbon/identity/conditional/auth/functions/http/http-post-payload.json:
--------------------------------------------------------------------------------
1 | {
2 | "stringKey": "stringValue",
3 | "numberKey": 123,
4 | "booleanKey": true,
5 | "arrayKey": [
6 | "arrayString",
7 | 456,
8 | false,
9 | {
10 | "nestedObjectInArrayKey": "nestedObjectValue",
11 | "nestedArrayInArrayKey": ["nestedArrayValue1", "nestedArrayValue2"]
12 | }
13 | ],
14 | "objectKey": {
15 | "objectStringKey": "objectStringValue",
16 | "objectNumberKey": 789,
17 | "objectBooleanKey": false,
18 | "nestedObjectKey": {
19 | "nestedObjectStringKey": "nestedObjectStringValue",
20 | "nestedObjectArrayKey": [
21 | "nestedArrayValue1",
22 | 101112,
23 | true
24 | ]
25 | },
26 | "arrayOfObjectsKey": [
27 | {
28 | "arrayOfObjectsStringKey": "arrayOfObjectsStringValue1",
29 | "arrayOfObjectsNumberKey": 131415,
30 | "arrayOfObjectsBooleanKey": true
31 | },
32 | {
33 | "arrayOfObjectsStringKey": "arrayOfObjectsStringValue2",
34 | "arrayOfObjectsNumberKey": 161718,
35 | "arrayOfObjectsBooleanKey": false
36 | }
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.analytics/src/test/resources/org/wso2/carbon/identity/conditional/auth/functions/analytics/analytics-payload.json:
--------------------------------------------------------------------------------
1 | {
2 | "stringKey": "stringValue",
3 | "numberKey": 123,
4 | "booleanKey": true,
5 | "arrayKey": [
6 | "arrayString",
7 | 456,
8 | false,
9 | {
10 | "nestedObjectInArrayKey": "nestedObjectValue",
11 | "nestedArrayInArrayKey": ["nestedArrayValue1", "nestedArrayValue2"]
12 | }
13 | ],
14 | "objectKey": {
15 | "objectStringKey": "objectStringValue",
16 | "objectNumberKey": 789,
17 | "objectBooleanKey": false,
18 | "nestedObjectKey": {
19 | "nestedObjectStringKey": "nestedObjectStringValue",
20 | "nestedObjectArrayKey": [
21 | "nestedArrayValue1",
22 | 101112,
23 | true
24 | ]
25 | },
26 | "arrayOfObjectsKey": [
27 | {
28 | "arrayOfObjectsStringKey": "arrayOfObjectsStringValue1",
29 | "arrayOfObjectsNumberKey": 131415,
30 | "arrayOfObjectsBooleanKey": true
31 | },
32 | {
33 | "arrayOfObjectsStringKey": "arrayOfObjectsStringValue2",
34 | "arrayOfObjectsNumberKey": 161718,
35 | "arrayOfObjectsBooleanKey": false
36 | }
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.common/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/common/model/graaljs/JsGraalUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
3 | *
4 | * WSO2 LLC. licenses this file to you under the Apache License,
5 | * Version 2.0 (the "License"); you may not use this file except
6 | * in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing,
12 | * software distributed under the License is distributed on an
13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | * KIND, either express or implied. See the License for the
15 | * specific language governing permissions and limitations
16 | * under the License.
17 | */
18 |
19 | package org.wso2.carbon.identity.conditional.auth.functions.common.model.graaljs;
20 |
21 | import org.wso2.carbon.identity.conditional.auth.functions.common.model.JsUtils;
22 |
23 | import java.util.List;
24 |
25 | public class JsGraalUtils implements JsUtils {
26 |
27 | @Override
28 | public boolean isArray(Object obj) {
29 |
30 | return obj instanceof List;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com).
3 | *
4 | * WSO2 LLC. licenses this file to you under the Apache License,
5 | * Version 2.0 (the "License"); you may not use this file except
6 | * in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing,
12 | * software distributed under the License is distributed on an
13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | * KIND, either express or implied. See the License for the
15 | * specific language governing permissions and limitations
16 | * under the License.
17 | */
18 |
19 | package org.wso2.carbon.identity.conditional.auth.functions.utils;
20 |
21 | /**
22 | * Function to mask the given value.
23 | */
24 | @FunctionalInterface
25 | public interface GetMaskedValueFunction {
26 |
27 | /**
28 | * Masks the given value.
29 | *
30 | * @param value The value to be masked.
31 | * @return The masked value.
32 | */
33 | String getMaskedValue(String value);
34 | }
35 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/PromptIdentifierFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
3 | *
4 | * WSO2 Inc. licenses this file to you under the Apache License,
5 | * Version 2.0 (the "License"); you may not use this file except
6 | * in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing,
12 | * software distributed under the License is distributed on an
13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | * KIND, either express or implied. See the License for the
15 | * specific language governing permissions and limitations
16 | * under the License.
17 | */
18 |
19 | package org.wso2.carbon.identity.conditional.auth.functions.user;
20 |
21 | /**
22 | * Function to prompt for user identifier.
23 | */
24 | @FunctionalInterface
25 | public interface PromptIdentifierFunction {
26 |
27 | /**
28 | * Prompt for user identifier.
29 | *
30 | * @param step step number
31 | * @param parameters parameters
32 | */
33 | void promptIdentifier(int step, Object... parameters);
34 | }
35 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/exception/UserSessionRetrievalException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
3 | *
4 | * WSO2 Inc. licenses this file to you under the Apache License,
5 | * Version 2.0 (the "License"); you may not use this file except
6 | * in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing,
12 | * software distributed under the License is distributed on an
13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | * KIND, either express or implied. See the License for the
15 | * specific language governing permissions and limitations
16 | * under the License.
17 | */
18 |
19 | package org.wso2.carbon.identity.conditional.auth.functions.user.exception;
20 |
21 | import org.wso2.carbon.identity.base.IdentityException;
22 |
23 | /**
24 | * Exception occurred while retrieving user sessions.
25 | */
26 | public class UserSessionRetrievalException extends IdentityException {
27 |
28 | public UserSessionRetrievalException(String message, Throwable cause) {
29 |
30 | super(message, cause);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.user/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/user/exception/UserSessionTerminationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
3 | *
4 | * WSO2 Inc. licenses this file to you under the Apache License,
5 | * Version 2.0 (the "License"); you may not use this file except
6 | * in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing,
12 | * software distributed under the License is distributed on an
13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | * KIND, either express or implied. See the License for the
15 | * specific language governing permissions and limitations
16 | * under the License.
17 | */
18 |
19 | package org.wso2.carbon.identity.conditional.auth.functions.user.exception;
20 |
21 | import org.wso2.carbon.identity.base.IdentityException;
22 |
23 | /**
24 | * Exception occurred while terminating user sessions.
25 | */
26 | public class UserSessionTerminationException extends IdentityException {
27 |
28 | public UserSessionTerminationException(String message, Throwable cause) {
29 |
30 | super(message, cause);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.test.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/test/utils/api/SubjectCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
3 | *
4 | * WSO2 Inc. licenses this file to you under the Apache License,
5 | * Version 2.0 (the "License"); you may not use this file except
6 | * in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing,
12 | * software distributed under the License is distributed on an
13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | * KIND, either express or implied. See the License for the
15 | * specific language governing permissions and limitations
16 | * under the License.
17 | */
18 |
19 | package org.wso2.carbon.identity.conditional.auth.functions.test.utils.api;
20 |
21 | import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext;
22 | import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
23 |
24 | import java.io.Serializable;
25 |
26 | public interface SubjectCallback extends Serializable {
27 |
28 | AuthenticatedUser getAuthenticatedUser(AuthenticationContext context);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/FilterAuthenticatorsFunction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com).
3 | *
4 | * WSO2 LLC. licenses this file to you under the Apache License,
5 | * Version 2.0 (the "License"); you may not use this file except
6 | * in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing,
12 | * software distributed under the License is distributed on an
13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | * KIND, either express or implied. See the License for the
15 | * specific language governing permissions and limitations
16 | * under the License.
17 | */
18 |
19 | package org.wso2.carbon.identity.conditional.auth.functions.utils;
20 |
21 | import java.util.List;
22 | import java.util.Map;
23 |
24 | /**
25 | * Function to exclude a defined authenticator from the provided options list.
26 | */
27 | @FunctionalInterface
28 | public interface FilterAuthenticatorsFunction {
29 |
30 | Map> filterAuthenticators(List