Skip to content

Commit

Permalink
refining solution
Browse files Browse the repository at this point in the history
  • Loading branch information
jsboak committed May 24, 2024
1 parent 5b105b2 commit 966510e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 0 additions & 2 deletions src/main/java/edu/ohio/ais/rundeck/HttpDescription.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ public Description getDescription() {
.defaultValue("false")
.renderingOption(StringRenderingConstants.GROUP_NAME,"Print")
.build())
.mapping("proxyIP","project.plugin.WorkflowNodeStep.HttpWorkflowNodeStepPlugin.proxyIP")

.build();
}
}
18 changes: 8 additions & 10 deletions src/main/java/edu/ohio/ais/rundeck/HttpWorkflowNodeStepPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.*;

@Plugin(name = HttpWorkflowNodeStepPlugin.SERVICE_PROVIDER_NAME, service = ServiceNameConstants.WorkflowNodeStep)
public class HttpWorkflowNodeStepPlugin implements NodeStepPlugin, Describable, ProxySecretBundleCreator, DescriptionBuilder.Collaborator {
public class HttpWorkflowNodeStepPlugin implements NodeStepPlugin, Describable, ProxySecretBundleCreator {
public static final String SERVICE_PROVIDER_NAME = "edu.ohio.ais.rundeck.HttpWorkflowNodeStepPlugin";

/**
Expand Down Expand Up @@ -68,9 +68,11 @@ public Description getDescription() {
public void executeNodeStep(PluginStepContext context, Map<String, Object> configuration, INodeEntry entry) throws NodeStepException {
PluginLogger log = context.getLogger();

System.out.println("pre-resolver proxyIp: " + configuration.get("proxyIP"));
// propertyResolver("proxySettings", configuration, context);
propertyResolver("proxyIP", configuration, context);
Description description = new HttpDescription(SERVICE_PROVIDER_NAME, "HTTP Request Node Step", "Performs an HTTP request with or without authentication (per node)").getDescription();
description.getProperties().forEach(prop->
propertyResolver(prop.getName(), configuration, context)
);
// propertyResolver("proxyIP", configuration, context);
// propertyResolver("proxyPort", configuration, context);

System.out.println("post-resolver proxyIp: " + configuration.get("proxyIP"));
Expand Down Expand Up @@ -167,7 +169,7 @@ public List<String> listSecretsPathWorkflowNodeStep(ExecutionContext context, IN

void propertyResolver(String property, Map<String,Object> Configuration, PluginStepContext context) {

String projectPrefix = "project.plugin.WorkflowNodeStep." + "HttpWorkflowNodeStepPlugin" + ".";
String projectPrefix = "project.plugin.WorkflowNodeStep." + SERVICE_PROVIDER_NAME + ".";
String frameworkPrefix = "framework.plugin.WorkflowNodeStep" + SERVICE_PROVIDER_NAME + ".";

Map<String,String> projectProperties = context.getFramework().getFrameworkProjectMgr().getFrameworkProject(context.getFrameworkProject()).getProperties();
Expand All @@ -182,11 +184,7 @@ void propertyResolver(String property, Map<String,Object> Configuration, PluginS
Configuration.put(property, frameworkProperties.getProperty(frameworkPrefix + property));

}
System.out.println("resolver: " + Configuration.get(property));
System.out.println("resolver: " + property + Configuration.get(property));
}

@Override
public void buildWith(DescriptionBuilder descriptionBuilder) {
descriptionBuilder.mapping("proxyIP", "project.plugin.WorkflowNodeStep.HTTPRequest.proxyIP");
}
}

0 comments on commit 966510e

Please sign in to comment.