abstract class HttpAuthMethod
extends java.lang.Object
Instances of an HttpAuthMethod are not thread-safe, as some implementations may need to maintain per-connection state information.
| Modifier and Type | Class and Description |
|---|---|
private static class |
HttpAuthMethod.Basic
Performs HTTP basic authentication (plaintext username/password).
|
private static class |
HttpAuthMethod.Digest
Performs HTTP digest authentication.
|
private static class |
HttpAuthMethod.Negotiate |
private static class |
HttpAuthMethod.None
Performs no user authentication.
|
static class |
HttpAuthMethod.Type
Enum listing the http authentication method types supported by jgit.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) static java.lang.String |
EMPTY_STRING |
(package private) static java.lang.String |
SCHEMA_NAME_SEPARATOR |
protected HttpAuthMethod.Type |
type |
| Modifier | Constructor and Description |
|---|---|
protected |
HttpAuthMethod(HttpAuthMethod.Type type)
Constructor for HttpAuthMethod.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) abstract void |
authorize(java.lang.String user,
java.lang.String pass)
Update this method with the given username and password pair.
|
(package private) boolean |
authorize(URIish uri,
CredentialsProvider credentialsProvider)
Update this method with the credentials from the URIish.
|
(package private) abstract void |
configureRequest(HttpConnection conn)
Update connection properties based on this authentication method.
|
HttpAuthMethod.Type |
getType()
Gives the method type associated to this http auth method
|
(package private) static HttpAuthMethod |
scanResponse(HttpConnection conn,
java.util.Collection<HttpAuthMethod.Type> ignoreTypes)
Handle an authentication failure and possibly return a new response.
|
static final java.lang.String EMPTY_STRING
static final java.lang.String SCHEMA_NAME_SEPARATOR
protected final HttpAuthMethod.Type type
protected HttpAuthMethod(HttpAuthMethod.Type type)
type - authentication method typestatic HttpAuthMethod scanResponse(HttpConnection conn, java.util.Collection<HttpAuthMethod.Type> ignoreTypes)
conn - the connection that failed.ignoreTypes - authentication types to be ignored.boolean authorize(URIish uri, CredentialsProvider credentialsProvider)
uri - the URI used to create the connection.credentialsProvider - the credentials provider, or null. If provided,
credentials in the URI are ignored.abstract void authorize(java.lang.String user,
java.lang.String pass)
user - pass - abstract void configureRequest(HttpConnection conn) throws java.io.IOException
conn - java.io.IOExceptionpublic HttpAuthMethod.Type getType()