Skip to content

Commit

Permalink
feat: use ExecutionContext instead of token revoke context in custom …
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Jan 12, 2022
1 parent 848f1ca commit e1ba0b4
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.jans.as.server.service.external;

import io.jans.as.server.service.external.context.RevokeTokenContext;
import io.jans.as.server.model.common.ExecutionContext;
import io.jans.model.custom.script.CustomScriptType;
import io.jans.model.custom.script.conf.CustomScriptConfiguration;
import io.jans.model.custom.script.type.revoke.RevokeTokenType;
Expand All @@ -22,7 +22,7 @@ public ExternalRevokeTokenService() {
super(CustomScriptType.REVOKE_TOKEN);
}

public boolean revokeToken(CustomScriptConfiguration script, RevokeTokenContext context) {
public boolean revokeToken(CustomScriptConfiguration script, ExecutionContext context) {
try {
log.trace("Executing python 'revokeToken' method, context: {}", context);
context.setScript(script);
Expand All @@ -38,12 +38,10 @@ public boolean revokeToken(CustomScriptConfiguration script, RevokeTokenContext
return false;
}

public boolean revokeTokenMethods(RevokeTokenContext context) {
public boolean revokeTokenMethods(ExecutionContext context) {
for (CustomScriptConfiguration script : this.customScriptConfigurations) {
if (script.getExternalType().getApiVersion() > 1) {
if (!revokeToken(script, context)) {
return false;
}
if (script.getExternalType().getApiVersion() > 1 && !revokeToken(script, context)) {
return false;
}
}
return true;
Expand Down

0 comments on commit e1ba0b4

Please sign in to comment.