-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new functional interfaces for modified functions
- Loading branch information
1 parent
43a6b9a
commit 001e009
Showing
17 changed files
with
179 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...rbon/identity/conditional/auth/functions/user/store/GetUserWithClaimValuesV2Function.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
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.JsAuthenticationContext; | ||
import org.wso2.carbon.identity.application.authentication.framework.exception.FrameworkException; | ||
|
||
import java.util.Map; | ||
|
||
@FunctionalInterface | ||
public interface GetUserWithClaimValuesV2Function { | ||
|
||
JsAuthenticatedUser getUniqueUserWithClaimValues(Map<String, String> claimMap, | ||
JsAuthenticationContext authenticationContext, | ||
String... parameters) throws FrameworkException; | ||
} |
41 changes: 41 additions & 0 deletions
41
.../identity/conditional/auth/functions/user/store/GetUserWithClaimValuesV2FunctionImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.identity.conditional.auth.functions.user.store; | ||
|
||
import org.graalvm.polyglot.HostAccess; | ||
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.exception.FrameworkException; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Implementation of GetUserWithClaimValuesV2Function. This will return a user given a set of claim values. | ||
*/ | ||
public class GetUserWithClaimValuesV2FunctionImpl implements GetUserWithClaimValuesV2Function { | ||
|
||
@Override | ||
@HostAccess.Export | ||
public JsAuthenticatedUser getUniqueUserWithClaimValues(Map<String, String> claimMap, | ||
JsAuthenticationContext authenticationContext, | ||
String... parameters) throws FrameworkException { | ||
|
||
return new UserStoreFunctions().getUniqueUserWithClaimValues(claimMap, authenticationContext, parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...rbon/identity/conditional/auth/functions/user/GetAuthenticatedApplicationsV2Function.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.identity.conditional.auth.functions.user; | ||
|
||
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext; | ||
import org.wso2.carbon.identity.conditional.auth.functions.user.model.JsApplication; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Function definition for retrieving authenticated applications. | ||
*/ | ||
@FunctionalInterface | ||
public interface GetAuthenticatedApplicationsV2Function { | ||
|
||
/** | ||
* Retrieve the already authenticated applications for a given session. | ||
* | ||
* @param context context object. | ||
* @return List of already authenticated applications of the given session. | ||
*/ | ||
List<JsApplication> getAuthenticatedApplications(JsAuthenticationContext context); | ||
} |
43 changes: 43 additions & 0 deletions
43
.../identity/conditional/auth/functions/user/GetAuthenticatedApplicationsV2FunctionImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.identity.conditional.auth.functions.user; | ||
|
||
import org.graalvm.polyglot.HostAccess; | ||
import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.JsAuthenticationContext; | ||
import org.wso2.carbon.identity.conditional.auth.functions.user.model.JsApplication; | ||
import org.wso2.carbon.identity.conditional.auth.functions.user.model.JsWrapperFactoryProvider; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* Function for retrieving javascript authenticated applications for a given session. | ||
*/ | ||
public class GetAuthenticatedApplicationsV2FunctionImpl implements GetAuthenticatedApplicationsV2Function { | ||
|
||
@Override | ||
@HostAccess.Export | ||
public List<JsApplication> getAuthenticatedApplications(JsAuthenticationContext context) { | ||
|
||
return new GetAuthenticatedAppsFuncImp().getAuthenticatedApplications(context) | ||
.stream() | ||
.map(app -> JsWrapperFactoryProvider.getInstance().getWrapperFactory().createJsApplication(app)) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.