Skip to content

Commit

Permalink
fix: remove jans-auth-common dependency #1459
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomer2001 committed May 26, 2022
1 parent d155a9d commit 75f4fb5
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
4 changes: 0 additions & 4 deletions jans-scim/service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@
<groupId>io.jans</groupId>
<artifactId>jans-auth-client</artifactId>
</dependency>
<dependency>
<groupId>io.jans</groupId>
<artifactId>jans-auth-common</artifactId>
</dependency>

<!-- Weld -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text.
*
* Copyright (c) 2020, Janssen Project
*/

package io.jans.scim.service;

import io.jans.model.SimpleCustomProperty;
import io.jans.model.custom.script.CustomScriptType;
import io.jans.model.custom.script.conf.CustomScriptConfiguration;
import io.jans.model.custom.script.type.id.IdGeneratorType;
import io.jans.service.custom.script.ExternalScriptService;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Named;
import java.util.Map;

/**
* @author gasmyr on 9/17/20.
*/
@ApplicationScoped
@Named("externalIdGeneratorService")
public class ExternalIdGeneratorService extends ExternalScriptService {

private static final long serialVersionUID = 1727751544454591273L;

public ExternalIdGeneratorService() {
super(CustomScriptType.ID_GENERATOR);
}

public String executeExternalGenerateIdMethod(CustomScriptConfiguration customScriptConfiguration, String appId, String idType, String idPrefix) {
try {
log.debug("Executing python 'generateId' method");
IdGeneratorType externalType = (IdGeneratorType) customScriptConfiguration.getExternalType();
Map<String, SimpleCustomProperty> configurationAttributes = customScriptConfiguration.getConfigurationAttributes();
return externalType.generateId(appId, idType, idPrefix, configurationAttributes);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
saveScriptError(customScriptConfiguration.getCustomScript(), ex);
}

return null;
}

public String executeExternalDefaultGenerateIdMethod(String appId, String idType, String idPrefix) {
return executeExternalGenerateIdMethod(this.defaultExternalCustomScript, appId, idType, idPrefix);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

package io.jans.scim.service;

import io.jans.as.common.service.common.ExternalIdGeneratorService;
import io.jans.as.model.common.IdType;
import io.jans.orm.PersistenceEntryManager;
import io.jans.orm.exception.EntryPersistenceException;
Expand All @@ -17,6 +16,7 @@
import io.jans.scim.model.GluuCustomPerson;
import io.jans.scim.model.GluuGroup;
import io.jans.scim.model.GluuGroupVisibility;
import io.jans.scim.service.ExternalIdGeneratorService;
import io.jans.scim.util.OxTrustConstants;
import io.jans.util.ArrayHelper;
import io.jans.util.StringHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

package io.jans.scim.service;

import io.jans.as.common.service.common.ExternalIdGeneratorService;
import io.jans.as.model.common.IdType;
import io.jans.model.GluuAttribute;
import io.jans.orm.PersistenceEntryManager;
Expand All @@ -20,6 +19,7 @@
import io.jans.scim.model.GluuCustomAttribute;
import io.jans.scim.model.GluuCustomPerson;
import io.jans.scim.model.User;
import io.jans.scim.service.ExternalIdGeneratorService;
import io.jans.scim.util.OxTrustConstants;
import io.jans.util.ArrayHelper;
import io.jans.util.OxConstants;
Expand Down

0 comments on commit 75f4fb5

Please sign in to comment.