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
abstract class HttpAuthMethod extends java.lang.ObjectSupport 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 Classes Modifier and Type Class Description private static classHttpAuthMethod.BasicPerforms HTTP basic authentication (plaintext username/password).private static classHttpAuthMethod.DigestPerforms HTTP digest authentication.private static classHttpAuthMethod.Negotiateprivate static classHttpAuthMethod.NonePerforms no user authentication.static classHttpAuthMethod.TypeEnum listing the http authentication method types supported by jgit.
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringEMPTY_STRING(package private) static java.lang.StringSCHEMA_NAME_SEPARATORprotected HttpAuthMethod.Typetype
-
Constructor Summary
Constructors Modifier Constructor Description protectedHttpAuthMethod(HttpAuthMethod.Type type)Constructor for HttpAuthMethod.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract voidauthorize(java.lang.String user, java.lang.String pass)Update this method with the given username and password pair.(package private) booleanauthorize(URIish uri, CredentialsProvider credentialsProvider)Update this method with the credentials from the URIish.(package private) abstract voidconfigureRequest(HttpConnection conn)Update connection properties based on this authentication method.HttpAuthMethod.TypegetType()Gives the method type associated to this http auth method(package private) static HttpAuthMethodscanResponse(HttpConnection conn, java.util.Collection<HttpAuthMethod.Type> ignoreTypes)Handle an authentication failure and possibly return a new response.
-
-
-
Field Detail
-
EMPTY_STRING
static final java.lang.String EMPTY_STRING
- See Also:
- Constant Field Values
-
SCHEMA_NAME_SEPARATOR
static final java.lang.String SCHEMA_NAME_SEPARATOR
- See Also:
- Constant Field Values
-
type
protected final HttpAuthMethod.Type type
-
-
Constructor Detail
-
HttpAuthMethod
protected HttpAuthMethod(HttpAuthMethod.Type type)
Constructor for HttpAuthMethod.- Parameters:
type- authentication method type
-
-
Method Detail
-
scanResponse
static HttpAuthMethod scanResponse(HttpConnection conn, java.util.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
boolean authorize(URIish uri, CredentialsProvider credentialsProvider)
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 URIare ignored.- Returns:
- true if the authentication method is able to provide authorization for the given URI
-
authorize
abstract void authorize(java.lang.String user, java.lang.String pass)Update this method with the given username and password pair.- Parameters:
user-pass-
-
configureRequest
abstract void configureRequest(HttpConnection conn) throws java.io.IOException
Update connection properties based on this authentication method.- Parameters:
conn-- Throws:
java.io.IOException
-
getType
public HttpAuthMethod.Type getType()
Gives the method type associated to this http auth method- Returns:
- the method type
-
-