@@ -75,15 +75,38 @@ private GitHub(String login, String oauthAccessToken, String password) throws IO
75
75
}
76
76
77
77
/**
78
+ * Creates a client API root object.
79
+ *
80
+ * <p>
81
+ * Several different combinations of the login/oauthAccessToken/password parameters are allowed
82
+ * to represent different ways of authentication.
83
+ *
84
+ * <dl>
85
+ * <dt>Loging anonymously
86
+ * <dd>Leave all three parameters null and you will be making HTTP requests without any authentication.
87
+ *
88
+ * <dt>Log in with password
89
+ * <dd>Specify the login and password, then leave oauthAccessToken null.
90
+ * This will use the HTTP BASIC auth with the GitHub API.
91
+ *
92
+ * <dt>Log in with OAuth token
93
+ * <dd>Specify oauthAccessToken, and optionally specify the login. Leave password null.
94
+ * This will send OAuth token to the GitHub API. If the login parameter is null,
95
+ * The constructor makes an API call to figure out the user name that owns the token.
96
+ * </dl>
78
97
*
79
98
* @param apiUrl
80
99
* The URL of GitHub (or GitHub enterprise) API endpoint, such as "https://api.github.com" or
81
100
* "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <tt>/api/v3</tt> in the URL.
82
101
* For historical reasons, this parameter still accepts the bare domain name, but that's considered deprecated.
83
102
* Password is also considered deprecated as it is no longer required for api usage.
84
103
* @param login
85
- * The use ID on GitHub. Can be omitted if the OAuth token is provided, but specifying this would
86
- * save one API call.
104
+ * The use ID on GitHub that you are logging in as. Can be omitted if the OAuth token is
105
+ * provided or if logging in anonymously. Specifying this would save one API call.
106
+ * @param oauthAccessToken
107
+ * Secret OAuth token.
108
+ * @param password
109
+ * User's password. Always used in conjunction with the {@code login} parameter
87
110
*/
88
111
private GitHub (String apiUrl , String login , String oauthAccessToken , String password ) throws IOException {
89
112
if (apiUrl .endsWith ("/" )) apiUrl = apiUrl .substring (0 , apiUrl .length ()-1 ); // normalize
0 commit comments