From 463ac4e8f70ce206cdb800369d0db50b27d4710d Mon Sep 17 00:00:00 2001 From: Chris McCarroll-Gilbert Date: Thu, 6 Jan 2022 09:40:13 -0700 Subject: [PATCH 1/3] add string rendering constant password value to hashmap for authentication props --- .../plugins/aws/S3ResourceModelSource.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java b/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java index f95dcd7..f995436 100644 --- a/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java +++ b/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java @@ -39,9 +39,9 @@ import com.dtolabs.rundeck.plugins.ServiceNameConstants; import com.dtolabs.rundeck.plugins.util.DescriptionBuilder; -@Plugin(name = "aws-s3-source", service = ServiceNameConstants.ResourceModelSource) +@Plugin(name = "aws-s3-source-chris", service = ServiceNameConstants.ResourceModelSource) public class S3ResourceModelSource implements ResourceModelSourceFactory,Describable { - public static final String PROVIDER_NAME = "aws-s3-source"; + public static final String PROVIDER_NAME = "aws-s3-source-chris"; private Framework framework; @@ -88,29 +88,32 @@ public class S3ResourceModelSource implements ResourceModelSourceFactory,Describ "json" )); - final static Map renderingOptionsAuthentication = getRenderOpt("Credentials",false); - final static Map renderingOptionsConnection = getRenderOpt("Connection",false); - final static Map renderingOptionsResource = getRenderOpt("Resource",false); + final static Map renderingOptionsAuthentication = getRenderOpt("Credentials",false, true); + final static Map renderingOptionsConnection = getRenderOpt("Connection",false, false); + final static Map renderingOptionsResource = getRenderOpt("Resource",false, false); - protected static Map getRenderOpt(String value, boolean secondary) { + protected static Map getRenderOpt(String value, boolean secondary, boolean password) { Map ret = new HashMap<>(); ret.put(StringRenderingConstants.GROUP_NAME,value); if(secondary){ ret.put(StringRenderingConstants.GROUPING,"secondary"); } + if(password){ + ret.put("displayType",StringRenderingConstants.DisplayType.PASSWORD); + } return ret; } static Description DESC = DescriptionBuilder.builder() .name(PROVIDER_NAME) - .title("AWS S3 remote model source") + .title("AWS S3 remote model source - TEST") .description("Obtain nodes information from a file located in a S3 bucket") - .property(PropertyUtil.string(KEY, "AWS Access Key", "AWS Access Key.", false, + .property(PropertyUtil.string(KEY, "AWS Access Key", "AWS Access Key. - TEST", false, null,null,null, renderingOptionsAuthentication)) - .property(PropertyUtil.string(SECRET, "AWS Secret Key", "AWS Secret Key.", false, + .property(PropertyUtil.string(SECRET, "AWS Secret Key", "AWS Secret Key. - TEST", false, null,null,null, renderingOptionsAuthentication)) - .property(PropertyUtil.string(CREDENTIALFILE, "AWS Credentials File", "Path to a AWSCredentials.properties file " + + .property(PropertyUtil.string(CREDENTIALFILE, "AWS Credentials File - TEST", "Path to a AWSCredentials.properties file " + "containing 'accessKey' and 'secretKey'.", false, null,null,null, renderingOptionsAuthentication)) From 72f0c9afa28c236026a1c4f8c667d2248f98c0f1 Mon Sep 17 00:00:00 2001 From: Chris McCarroll-Gilbert Date: Thu, 6 Jan 2022 09:54:18 -0700 Subject: [PATCH 2/3] remove test additions --- .../com/rundeck/plugins/aws/S3ResourceModelSource.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java b/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java index f995436..62e4b1b 100644 --- a/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java +++ b/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java @@ -39,9 +39,9 @@ import com.dtolabs.rundeck.plugins.ServiceNameConstants; import com.dtolabs.rundeck.plugins.util.DescriptionBuilder; -@Plugin(name = "aws-s3-source-chris", service = ServiceNameConstants.ResourceModelSource) +@Plugin(name = "aws-s3-source", service = ServiceNameConstants.ResourceModelSource) public class S3ResourceModelSource implements ResourceModelSourceFactory,Describable { - public static final String PROVIDER_NAME = "aws-s3-source-chris"; + public static final String PROVIDER_NAME = "aws-s3-source"; private Framework framework; @@ -107,11 +107,11 @@ protected static Map getRenderOpt(String value, boolean secondar static Description DESC = DescriptionBuilder.builder() .name(PROVIDER_NAME) - .title("AWS S3 remote model source - TEST") + .title("AWS S3 remote model source") .description("Obtain nodes information from a file located in a S3 bucket") - .property(PropertyUtil.string(KEY, "AWS Access Key", "AWS Access Key. - TEST", false, + .property(PropertyUtil.string(KEY, "AWS Access Key", "AWS Access Key.", false, null,null,null, renderingOptionsAuthentication)) - .property(PropertyUtil.string(SECRET, "AWS Secret Key", "AWS Secret Key. - TEST", false, + .property(PropertyUtil.string(SECRET, "AWS Secret Key", "AWS Secret Key.", false, null,null,null, renderingOptionsAuthentication)) .property(PropertyUtil.string(CREDENTIALFILE, "AWS Credentials File - TEST", "Path to a AWSCredentials.properties file " + "containing 'accessKey' and 'secretKey'.", false, From 845d9e7bca9254e1e681197e9f1b941e8fb2799b Mon Sep 17 00:00:00 2001 From: Chris McCarroll-Gilbert Date: Thu, 6 Jan 2022 09:55:12 -0700 Subject: [PATCH 3/3] remove test additions --- .../java/com/rundeck/plugins/aws/S3ResourceModelSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java b/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java index 62e4b1b..ce5cd84 100644 --- a/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java +++ b/src/main/java/com/rundeck/plugins/aws/S3ResourceModelSource.java @@ -113,7 +113,7 @@ protected static Map getRenderOpt(String value, boolean secondar null,null,null, renderingOptionsAuthentication)) .property(PropertyUtil.string(SECRET, "AWS Secret Key", "AWS Secret Key.", false, null,null,null, renderingOptionsAuthentication)) - .property(PropertyUtil.string(CREDENTIALFILE, "AWS Credentials File - TEST", "Path to a AWSCredentials.properties file " + + .property(PropertyUtil.string(CREDENTIALFILE, "AWS Credentials File", "Path to a AWSCredentials.properties file " + "containing 'accessKey' and 'secretKey'.", false, null,null,null, renderingOptionsAuthentication))