Skip to content

Commit

Permalink
fix(config-api): fixed start-up issue due to scope objectclass case (#…
Browse files Browse the repository at this point in the history
…3697)

* fix(config-api): fixed startup issue due to scope objectclass case

* fix(config-api): renamed swagger file name in plugin
  • Loading branch information
pujavs committed Jan 25, 2023
1 parent 5ba6c35 commit eac6440
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 30 deletions.
22 changes: 13 additions & 9 deletions jans-config-api/docs/jans-config-api-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7316,6 +7316,10 @@ components:
type: array
items:
type: string
libs:
type: array
items:
type: string
flowsError:
type: object
additionalProperties:
Expand Down Expand Up @@ -7520,19 +7524,19 @@ components:
$ref: '#/components/schemas/AttributeValidation'
tooltip:
type: string
adminCanEdit:
whitePagesCanView:
type: boolean
userCanEdit:
type: boolean
adminCanView:
type: boolean
userCanAccess:
type: boolean
adminCanAccess:
type: boolean
userCanView:
type: boolean
adminCanAccess:
adminCanEdit:
type: boolean
whitePagesCanView:
adminCanView:
type: boolean
baseDn:
type: string
Expand Down Expand Up @@ -8900,10 +8904,10 @@ components:
type: array
items:
type: object
displayValue:
type: string
value:
type: object
displayValue:
type: string
LocalizedString:
type: object
properties:
Expand Down Expand Up @@ -9117,13 +9121,13 @@ components:
type: boolean
internal:
type: boolean
locationPath:
type: string
locationType:
type: string
enum:
- ldap
- file
locationPath:
type: string
baseDn:
type: string
ScriptError:
Expand Down
4 changes: 2 additions & 2 deletions jans-config-api/plugins/docs/user-mgt-plugin-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -794,10 +794,10 @@ components:
type: array
items:
type: object
displayValue:
type: string
value:
type: object
displayValue:
type: string
CustomUser:
type: object
properties:
Expand Down
2 changes: 1 addition & 1 deletion jans-config-api/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
<execution>
<configuration>
<alwaysResolveAppPath>true</alwaysResolveAppPath>
<outputFileName>jans-config-api-swagger-auto</outputFileName>
<outputFileName>jans-config-api-swagger</outputFileName>
<contextId>${project.artifactId}</contextId>
<prettyPrint>true</prettyPrint>
<resourcePackages>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public Response isPluginDeployed(

List<PluginConf> plugins = getPluginNames();
Boolean deployed = false;
logger.debug("All plugins:{} ", plugins);
logger.info("All plugins:{} ", plugins);
if (StringUtils.isNotBlank(pluginName) && !plugins.isEmpty()) {
Optional<PluginConf> pluginNameOptional = plugins.stream()
.filter(plugin -> pluginName.equalsIgnoreCase(plugin.getName())).findAny();
Expand All @@ -86,32 +86,34 @@ public Response isPluginDeployed(
deployed = true;
}
}
logger.debug("deployed:{} ", deployed);
logger.info("deployed:{} ", deployed);
return Response.ok(deployed).build();
}

private List<PluginConf> getPluginNames() {

List<PluginConf> plugins = this.authUtil.getPluginConf();
logger.debug("Config plugins:{} ", plugins);
logger.info("Config plugins:{} ", plugins);
List<PluginConf> pluginInfo = new ArrayList<>();
for (PluginConf pluginConf : plugins) {
logger.debug("pluginConf:{} ", pluginConf);
if (StringUtils.isNotBlank(pluginConf.getClassName())) {
try {
logger.debug("pluginConf.getClassName():{} ", pluginConf.getClassName());
Class.forName(pluginConf.getClassName());
PluginConf conf = new PluginConf();
conf.setName(pluginConf.getName());
conf.setDescription(pluginConf.getDescription());
pluginInfo.add(conf);
} catch (ClassNotFoundException ex) {
logger.error("'{}' plugin not deployed", pluginConf.getName());
if (plugins != null && !plugins.isEmpty()) {
for (PluginConf pluginConf : plugins) {
logger.debug("pluginConf:{} ", pluginConf);
if (StringUtils.isNotBlank(pluginConf.getClassName())) {
try {
logger.debug("pluginConf.getClassName():{} ", pluginConf.getClassName());
Class.forName(pluginConf.getClassName());
PluginConf conf = new PluginConf();
conf.setName(pluginConf.getName());
conf.setDescription(pluginConf.getDescription());
pluginInfo.add(conf);
} catch (ClassNotFoundException ex) {
logger.error("'{}' plugin not deployed", pluginConf.getName());
}
}
}

}
}
logger.debug("pluginInfo:{} ", pluginInfo);
logger.info("pluginInfo:{} ", pluginInfo);
return pluginInfo;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def generate_configuration(self):
display_name = 'Config API scope {}'.format(scope['name'])
description = 'Config API {} scope {}'.format(scope_level, scope['name'])
ldif_dict = {
'objectclass': ['top', 'jansScope'],
'objectClass': ['top', 'jansScope'],
'description': [description],
'displayName': [display_name],
'inum': [scope['inum']],
Expand Down

0 comments on commit eac6440

Please sign in to comment.