Package org.eclipse.jgit.transport
Class HttpAuthMethod
java.lang.Object
org.eclipse.jgit.transport.HttpAuthMethod
- Direct Known Subclasses:
HttpAuthMethod.Basic
,HttpAuthMethod.Digest
,HttpAuthMethod.Negotiate
,HttpAuthMethod.None
Support class to populate user authentication data on a connection.
Instances of an HttpAuthMethod are not thread-safe, as some implementations may need to maintain per-connection state information.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Performs HTTP basic authentication (plaintext username/password).private static class
Performs HTTP digest authentication.private static class
private static class
Performs no user authentication.static enum
Enum listing the http authentication method types supported by jgit. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
(package private) static final String
protected final HttpAuthMethod.Type
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor for HttpAuthMethod. -
Method Summary
Modifier and TypeMethodDescription(package private) abstract void
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
Update connection properties based on this authentication method.getType()
Gives the method type associated to this http auth method(package private) static HttpAuthMethod
scanResponse
(HttpConnection conn, Collection<HttpAuthMethod.Type> ignoreTypes) Handle an authentication failure and possibly return a new response.
-
Field Details
-
EMPTY_STRING
- See Also:
-
SCHEMA_NAME_SEPARATOR
- See Also:
-
type
-
-
Constructor Details
-
HttpAuthMethod
Constructor for HttpAuthMethod.- Parameters:
type
- authentication method type
-
-
Method Details
-
scanResponse
static HttpAuthMethod scanResponse(HttpConnection conn, Collection<HttpAuthMethod.Type> ignoreTypes) Handle an authentication failure and possibly return a new response.- Parameters:
conn
- the connection that failed.ignoreTypes
- authentication types to be ignored.- Returns:
- new authentication method to try.
-
authorize
Update this method with the credentials from the URIish.- Parameters:
uri
- the URI used to create the connection.credentialsProvider
- the credentials provider, or null. If provided,credentials in the URI
are ignored.- Returns:
- true if the authentication method is able to provide authorization for the given URI
-
authorize
Update this method with the given username and password pair.- Parameters:
user
-pass
-
-
configureRequest
Update connection properties based on this authentication method.- Parameters:
conn
-- Throws:
IOException
-
getType
Gives the method type associated to this http auth method- Returns:
- the method type
-