diff --git a/pom.xml b/pom.xml index ed8d465..27db322 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,19 @@ https://oss.sonatype.org/content/repositories/snapshots + + + + snapshots-repo + https://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + + GitHub Issues @@ -48,7 +61,7 @@ HttpRequestLibrary UTF-8 1.6.5 - 0.0.1 + 0.0.2-SNAPSHOT diff --git a/src/main/java/com/github/hi_fi/httprequestlibrary/keywords/Session.java b/src/main/java/com/github/hi_fi/httprequestlibrary/keywords/Session.java index 7cc91ca..50d9042 100644 --- a/src/main/java/com/github/hi_fi/httprequestlibrary/keywords/Session.java +++ b/src/main/java/com/github/hi_fi/httprequestlibrary/keywords/Session.java @@ -17,48 +17,60 @@ @RobotKeywords public class Session { - @RobotKeyword("Create a HTTP session to a server\n\n" - + "``url`` Base url of the server\n\n" - + "``alias`` Robot Framework alias to identify the session\n\n" - + "``headers`` Dictionary of default headers\n\n" - + "``auth`` List of username & password for HTTP Basic Auth\n\n" - + "``timeout`` Connection timeout\n\n" - + "\n\n" - + "``proxies`` Dictionary that contains proxy urls for HTTP and HTTPS communication\n\n" - + "``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided.\n\n" - + "``debug`` Enable http verbosity option more information.\n\n") - @ArgumentNames({ "alias", "url", "headers={}", "cookies=None", "auth=None", "timeout=None", "proxies=None", - "verify=False", "debug=False" }) - public void createSession(String alias, String url, String... params) { - RestClient rc = new RestClient(); - Map headers = Robot.getParamsValue(params, 0, new HashMap()); - String verify = Robot.getParamsValue(params, 5, "False"); - RobotLogger.setDebugToAll(Boolean.parseBoolean(Robot.getParamsValue(params, 6, "False"))); - Authentication auth = Authentication - .getAuthentication(Robot.getParamsValue(params, 2, (List) new ArrayList())); - rc.createSession(alias, url, headers, auth, verify); - } + @RobotKeyword("Create a HTTP session to a server\n\n" + + "``url`` Base url of the server\n\n" + + "``alias`` Robot Framework alias to identify the session\n\n" + + "``headers`` Dictionary of default headers\n\n" + + "``auth`` List of username & password for HTTP Basic Auth\n\n" + + "``timeout`` Connection timeout\n\n" + + "\n\n" + + "``proxies`` Dictionary that contains proxy urls for HTTP and HTTPS communication\n\n" + + "``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided. A java keystore may be defined and required a password .jks.\n\n" + + "``debug`` Enable http verbosity option more information.\n\n" + + "``keypass`` the keystore password to use.\n\n" + + "``verifyhostname`` verify the host name.\n\n" + + "``selfsigned`` allow self signed server certificates.\n\n") + @ArgumentNames({ "alias", "url", "headers={}", "cookies=None", "auth=None", "timeout=None", "proxies=None", + "verify=False", "debug=False", "keypass=None", "verifyhostname=True", "selfsigned=False" }) + public void createSession(String alias, String url, String... params) { + RestClient rc = new RestClient(); + Map headers = Robot.getParamsValue(params, 0, new HashMap()); + String verify = Robot.getParamsValue(params, 5, "False"); + RobotLogger.setDebugToAll(Boolean.parseBoolean(Robot.getParamsValue(params, 6, "False"))); + Authentication auth = Authentication + .getAuthentication(Robot.getParamsValue(params, 2, (List) new ArrayList())); + String password = Robot.getParamsValue(params, 7, ""); + boolean verifyHost = Boolean.parseBoolean(Robot.getParamsValue(params, 8, "True").toLowerCase()); + boolean selfSigned = Boolean.parseBoolean(Robot.getParamsValue(params, 9, "False").toLowerCase()); + rc.createSession(alias, url, headers, auth, verify, password, verifyHost, selfSigned); + } - @RobotKeyword("Create a HTTP session to a server\n\n" - + "``url`` Base url of the server\n\n" - + "``alias`` Robot Framework alias to identify the session\n\n" - + "``headers`` Dictionary of default headers\n\n" - + "``auth`` List of username & password for HTTP Digest Auth\n\n" - + "``timeout`` Connection timeout\n\n" - + "\n\n" - + "``proxies`` Dictionary that contains proxy urls for HTTP and HTTPS communication\n\n" - + "``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided.\n\n" - + "``debug`` Enable http verbosity option more information.\n\n") - @ArgumentNames({ "alias", "url", "headers={}", "cookies=None", "auth=None", "timeout=None", "proxies=None", - "verify=False", "debug=False" }) - public void createDigestSession(String alias, String url, String... params) { - RestClient rc = new RestClient(); - Map headers = Robot.getParamsValue(params, 0, new HashMap()); - String verify = Robot.getParamsValue(params, 5, "False"); - RobotLogger.setDebugToAll(Boolean.parseBoolean(Robot.getParamsValue(params, 6, "False"))); - Authentication auth = Authentication.getAuthentication( - Robot.getParamsValue(params, 2, (List) new ArrayList()), Authentication.Type.DIGEST); - rc.createSession(alias, url, headers, auth, verify); - } + @RobotKeyword("Create a HTTP session to a server\n\n" + + "``url`` Base url of the server\n\n" + + "``alias`` Robot Framework alias to identify the session\n\n" + + "``headers`` Dictionary of default headers\n\n" + + "``auth`` List of username & password for HTTP Digest Auth\n\n" + + "``timeout`` Connection timeout\n\n" + + "\n\n" + + "``proxies`` Dictionary that contains proxy urls for HTTP and HTTPS communication\n\n" + + "``verify`` Whether the SSL cert will be verified. A CA_BUNDLE path can also be provided. A java keystore may be defined and required a password .jks.\n\n" + + "``debug`` Enable http verbosity option more information.\n\n" + + "``keypass`` the keystore password to use.\n\n" + + "``verifyhostname`` verify the host name.\n\n" + + "``selfsigned`` allow self signed server certificates.\n\n" ) + @ArgumentNames({ "alias", "url", "headers={}", "cookies=None", "auth=None", "timeout=None", "proxies=None", + "verify=False", "debug=False", "keypass=None", "verifyhostname=True", "selfsigned=False" }) + public void createDigestSession(String alias, String url, String... params) { + RestClient rc = new RestClient(); + Map headers = Robot.getParamsValue(params, 0, new HashMap()); + String verify = Robot.getParamsValue(params, 5, "False"); + RobotLogger.setDebugToAll(Boolean.parseBoolean(Robot.getParamsValue(params, 6, "False"))); + Authentication auth = Authentication.getAuthentication( + Robot.getParamsValue(params, 2, (List) new ArrayList()), Authentication.Type.DIGEST); + String password = Robot.getParamsValue(params, 7, ""); + boolean verifyHost = Boolean.parseBoolean(Robot.getParamsValue(params, 8, "True").toLowerCase()); + boolean selfSigned = Boolean.parseBoolean(Robot.getParamsValue(params, 9, "False").toLowerCase()); + rc.createSession(alias, url, headers, auth, verify, password, verifyHost, selfSigned); + } }