You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by me...@apache.org on 2016/03/24 05:07:45 UTC

[6/9] mesos git commit: Added Doxygen docs for basic HTTP authenticator.

Added Doxygen docs for basic HTTP authenticator.

The structure of the module parameters for the basic HTTP authenticator
has changed, so Doxygen comments were added to the module's header file
to provide an example.

Review: https://reviews.apache.org/r/44703/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a1482ac0
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a1482ac0
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a1482ac0

Branch: refs/heads/master
Commit: a1482ac04407fb653b7ba4af1ca5ed51df83cb03
Parents: 8e51b37
Author: Greg Mann <gr...@mesosphere.io>
Authored: Wed Mar 23 02:27:43 2016 -0700
Committer: Adam B <ad...@mesosphere.io>
Committed: Wed Mar 23 21:07:23 2016 -0700

----------------------------------------------------------------------
 .../http/basic_authenticator_factory.hpp        | 51 ++++++++++++++++++++
 1 file changed, 51 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a1482ac0/include/mesos/authentication/http/basic_authenticator_factory.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/authentication/http/basic_authenticator_factory.hpp b/include/mesos/authentication/http/basic_authenticator_factory.hpp
index 95c653b..e90cd01 100644
--- a/include/mesos/authentication/http/basic_authenticator_factory.hpp
+++ b/include/mesos/authentication/http/basic_authenticator_factory.hpp
@@ -34,13 +34,64 @@ class BasicAuthenticatorFactory {
 public:
   ~BasicAuthenticatorFactory() {}
 
+  /**
+   * Creates a basic HTTP authenticator from module parameters. Two keys may be
+   * specified in the parameters: `authentication_realm` (required) and
+   * `credentials` (optional). Credentials must be provided as a string which
+   * represents a JSON array, similar to the format of the `--credentials`
+   * command-line flag.
+   *
+   * Example parameters as JSON:
+   * {
+   *   "parameters": [
+   *     {
+   *       "key": "authentication_realm",
+   *       "value": "tatooine"
+   *     },
+   *     {
+   *       "key": "credentials",
+   *       "value": "[
+   *         {
+   *           \"principal\": \"luke\",
+   *           \"secret\": \"skywalker\"
+   *         }
+   *       ]"
+   *     }
+   *   ]
+   * }
+   *
+   * @param parameters The input parameters. This object may contain two keys:
+   *     `authentication_realm` (required) and `credentials` (optional).
+   * @return A `Try` containing a new authenticator if successful, or an
+   *     `Error` if unsuccessful.
+   */
   static Try<process::http::authentication::Authenticator*> create(
       const Parameters& parameters);
 
+  /**
+   * Creates a basic HTTP authenticator for the specified realm, initialized
+   * with the provided credentials.
+   *
+   * @param realm The authentication realm associated with this authenticator.
+   * @param credentials The credentials that this authenticator will use to
+   *     evaluate authentication requests.
+   * @return A `Try` containing a new authenticator if successful, or an
+   *     `Error` if unsuccessful.
+   */
   static Try<process::http::authentication::Authenticator*> create(
       const std::string& realm,
       const Credentials& credentials);
 
+  /**
+   * Creates a basic HTTP authenticator for the specified realm, initialized
+   * with the provided credentials.
+   *
+   * @param realm The authentication realm associated with this authenticator.
+   * @param credentials The credentials that this authenticator will use to
+   *     evaluate authentication requests.
+   * @return A `Try` containing a new authenticator if successful, or an
+   *     `Error` if unsuccessful.
+   */
   static Try<process::http::authentication::Authenticator*> create(
       const std::string& realm,
       const hashmap<std::string, std::string>& credentials);