Merge branch 'stable-3.4'
* stable-3.4:
Prepare post 3.4 RC3 builds
JGit v3.4.0.201406041058-rc3
blame: Un-break isFile check in tree walk
Prepare post 3.4.0 RC2 builds
JGit v3.4.0.201405281120-rc2
Fix authentication type names broken by 0b5441a8
Update Luna target platform to Orbit release R20140525021250
Change-Id: I344f1bbb8939bda01d524ec1a3218aa32bcc62f5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
commit
f449f6b1c9
|
@ -30,7 +30,7 @@
|
|||
<unit id="org.eclipse.jetty.util.source" version="7.6.14.v20131031"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="slicer" includeSource="true" type="InstallableUnit">
|
||||
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/S20140428023358/repository/"/>
|
||||
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20140525021250/repository/"/>
|
||||
<unit id="org.apache.ant.source" version="1.9.2.v201404171502"/>
|
||||
<unit id="org.apache.ant" version="1.9.2.v201404171502"/>
|
||||
<unit id="org.apache.commons.compress" version="1.6.0.v201310281400"/>
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
import static org.eclipse.jgit.lib.Constants.OBJ_BLOB;
|
||||
import static org.eclipse.jgit.lib.FileMode.TYPE_FILE;
|
||||
import static org.eclipse.jgit.lib.FileMode.TYPE_MASK;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
@ -955,7 +956,7 @@ private boolean find(RevCommit commit, PathFilter path) throws IOException {
|
|||
}
|
||||
|
||||
private static final boolean isFile(int rawMode) {
|
||||
return (rawMode & TYPE_FILE) == TYPE_FILE;
|
||||
return (rawMode & TYPE_MASK) == TYPE_FILE;
|
||||
}
|
||||
|
||||
private DiffEntry findRename(RevCommit parent, RevCommit commit,
|
||||
|
|
|
@ -85,24 +85,44 @@ public enum Type {
|
|||
public HttpAuthMethod method(String hdr) {
|
||||
return None.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSchemeName() {
|
||||
return "None"; //$NON-NLS-1$
|
||||
}
|
||||
},
|
||||
BASIC {
|
||||
@Override
|
||||
public HttpAuthMethod method(String hdr) {
|
||||
return new Basic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSchemeName() {
|
||||
return "Basic"; //$NON-NLS-1$
|
||||
}
|
||||
},
|
||||
DIGEST {
|
||||
@Override
|
||||
public HttpAuthMethod method(String hdr) {
|
||||
return new Digest(hdr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSchemeName() {
|
||||
return "Digest"; //$NON-NLS-1$
|
||||
}
|
||||
},
|
||||
NEGOTIATE {
|
||||
@Override
|
||||
public HttpAuthMethod method(String hdr) {
|
||||
return new Negotiate(hdr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSchemeName() {
|
||||
return "Negotiate"; //$NON-NLS-1$
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Creates a HttpAuthMethod instance configured with the provided HTTP
|
||||
|
@ -112,6 +132,13 @@ public HttpAuthMethod method(String hdr) {
|
|||
* @return a configured HttpAuthMethod instance
|
||||
*/
|
||||
public abstract HttpAuthMethod method(String hdr);
|
||||
|
||||
/**
|
||||
* @return the name of the authentication scheme in the form to be used
|
||||
* in HTTP authentication headers as specified in RFC2617 and
|
||||
* RFC4559
|
||||
*/
|
||||
public abstract String getSchemeName();
|
||||
}
|
||||
|
||||
static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||
|
@ -270,7 +297,7 @@ void authorize(final String username, final String password) {
|
|||
void configureRequest(final HttpConnection conn) throws IOException {
|
||||
String ident = user + ":" + pass; //$NON-NLS-1$
|
||||
String enc = Base64.encodeBytes(ident.getBytes("UTF-8")); //$NON-NLS-1$
|
||||
conn.setRequestProperty(HDR_AUTHORIZATION, type.name()
|
||||
conn.setRequestProperty(HDR_AUTHORIZATION, type.getSchemeName()
|
||||
+ " " + enc); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
@ -357,7 +384,7 @@ void configureRequest(final HttpConnection conn) throws IOException {
|
|||
v.append(e.getValue());
|
||||
v.append('"');
|
||||
}
|
||||
conn.setRequestProperty(HDR_AUTHORIZATION, type.name()
|
||||
conn.setRequestProperty(HDR_AUTHORIZATION, type.getSchemeName()
|
||||
+ " " + v); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
@ -514,7 +541,7 @@ void configureRequest(HttpConnection conn) throws IOException {
|
|||
byte[] token = context.initSecContext(prevToken, 0,
|
||||
prevToken.length);
|
||||
|
||||
conn.setRequestProperty(HDR_AUTHORIZATION, getType().name()
|
||||
conn.setRequestProperty(HDR_AUTHORIZATION, getType().getSchemeName()
|
||||
+ " " + Base64.encodeBytes(token)); //$NON-NLS-1$
|
||||
} catch (GSSException e) {
|
||||
IOException ioe = new IOException();
|
||||
|
|
Loading…
Reference in New Issue