AutoApprovalExecutor
Description
Autoapproves a registry based on a rule. The events that can be used are: APPROVAL_START.
- Job Class: edu.kit.scc.webreg.event.AutoApprovalExecutor
- Single node: No
- Usage: events
Properties
Key | Value type | Default | Description |
---|---|---|---|
rule_name | String | The name of the rule in the format <package-name>:<rule-name>:<version> . |
Values in bold are required.
Example rule
This rule insterts an UnauthorizedUser object in the drools environment, for users, that are not from dr-evil IDP. If such an object is found, the user will stay in the approval process. If there is no such object, which means user is from dr-evil IDP, the registry will be approved automatically.
package edu.kit.scc.webreg.drools.autoappr
import edu.kit.scc.webreg.entity.SamlUserEntity;
import edu.kit.scc.webreg.drools.UnauthorizedUser;
global org.slf4j.Logger logger;
rule "specific IDP is set"
when
$user : SamlUserEntity( idp.entityId != "https://idp.dr-evil.org/idp/shibboleth" )
then
logger.info( "User {} is not from dr-evil corp. Stays in approval process. ", $user.getId() );
insert( new UnauthorizedUser($user, "idp-wrong") );
end