diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2020-12-02 23:07:01 +0100 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-01-14 16:23:45 +0100 |
commit | 58f4e6e7f8d0f897c99fa1de5970928a826c5eb8 (patch) | |
tree | 93906422672e0d88378bf26dc0451f94f191c556 /org.eclipse.jgit.pgm/src/org/eclipse | |
parent | 471ad49546eec8850dd7d00b8fc2b8b50e4a9446 (diff) | |
download | jgit-58f4e6e7f8d0f897c99fa1de5970928a826c5eb8.tar.gz jgit-58f4e6e7f8d0f897c99fa1de5970928a826c5eb8.zip |
TransportHttp: support preemptive Basic authentication
If the caller knows already HTTP Basic authentication will be needed
and if it also already has the username and password, preemptive
authentication is a little bit more efficient since it avoids the
initial 401 response.
Add a setPreemptiveBasicAuthentication(username, password) method
to TransportHttp. Client code could call this for instance in a
TransportConfigCallback. The method throws an IllegalStateException
if it is called after an HTTP request has already been made.
Additionally, a URI can include userinfo. Although it is not
recommended to put passwords in URIs, JGit's URIish and also the
Java URL and URI classes still allow it. The underlying HTTP
connection may omit these fields though. If present, take these
fields as additional source for preemptive Basic authentication if
setPreemptiveBasicAuthentication() has not been called.
No preemptive authentication will be done if the connection is
redirected to a different host.
Add tests.
Bug: 541327
Change-Id: Id00b975e56a15b532de96f7bbce48106d992a22b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse')
0 files changed, 0 insertions, 0 deletions