Browse Source

Cleanup some push certificate related javadoc

Change-Id: I319ee4e99462598bf6a934b1efc7939bc4b057a5
stable-4.0
Shawn Pearce 10 years ago
parent
commit
8cf14cfdad
  1. 51
      org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificate.java
  2. 16
      org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateParser.java

51
org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificate.java

@ -49,55 +49,33 @@ package org.eclipse.jgit.transport;
* @since 4.0 * @since 4.0
*/ */
public class PushCertificate { public class PushCertificate {
/** The tuple "name <email>" as presented in the push certificate. */
/** The tuple "name <email>" as presented in the push certificate */
String pusher; String pusher;
/** The remote URL the signed push goes to */ /** The remote URL the signed push goes to. */
String pushee; String pushee;
/** What we think about the returned signed nonce */ /** What we think about the returned signed nonce. */
NonceStatus nonceStatus; NonceStatus nonceStatus;
/** /** Verification result of the nonce returned during push. */
*
*
*/
public enum NonceStatus { public enum NonceStatus {
/** /** Nonce was not expected, yet client sent one anyway. */
*
*/
UNSOLICITED, UNSOLICITED,
/** /** Nonce is invalid and did not match server's expectations. */
*
*/
BAD, BAD,
/** /** Nonce is required, but was not sent by client. */
*
*/
MISSING, MISSING,
/** /** Received nonce is valid. */
*
*/
OK, OK,
/** /** Received nonce is valid and within the accepted slop window. */
*
*/
SLOP SLOP
} }
/**
*
*/
String commandList; String commandList;
/**
*
*/
String signature; String signature;
/** /**
*
* @return the signature, consisting of the lines received between the lines * @return the signature, consisting of the lines received between the lines
* '----BEGIN GPG SIGNATURE-----\n' and the '----END GPG * '----BEGIN GPG SIGNATURE-----\n' and the '----END GPG
* SIGNATURE-----\n' * SIGNATURE-----\n'
@ -115,22 +93,19 @@ public class PushCertificate {
} }
/** /**
* @return the pushedCertPusher * @return the tuple "name &lt;email&gt;" as presented by the client in the
* push certificate.
*/ */
public String getPusher() { public String getPusher() {
return pusher; return pusher;
} }
/** /** @return URL of the repository the push was originally sent to. */
* @return the pushedCertPushee
*/
public String getPushee() { public String getPushee() {
return pushee; return pushee;
} }
/** /** @return verification status of the nonce embedded in the certificate. */
* @return the pushCertNonceStatus
*/
public NonceStatus getNonceStatus() { public NonceStatus getNonceStatus() {
return nonceStatus; return nonceStatus;
} }

16
org.eclipse.jgit/src/org/eclipse/jgit/transport/PushCertificateParser.java

@ -130,18 +130,20 @@ public class PushCertificateParser extends PushCertificate {
/** /**
* Receive a list of commands from the input encapsulated in a push * Receive a list of commands from the input encapsulated in a push
* certificate. This method doesn't deal with the first line "push-cert \NUL * certificate. This method doesn't parse the first line "push-cert \NUL
* <capabilities>", but assumes the first line including the capabilities * &lt;capabilities&gt;", but assumes the first line including the
* has already been dealt with. * capabilities has already been handled by the caller.
* *
* @param pckIn * @param pckIn
* where we take the push certificate header from. * where we take the push certificate header from.
* @param stateless * @param stateless
* If this server is run as a stateless server, such that it * affects nonce verification. When {@code stateless = true} the
* cannot store the sent push certificate and needs to validate * {@code NonceGenerator} will allow for some time skew caused by
* what the client sends back. * clients disconnected and reconnecting in the stateless smart
* * HTTP protocol.
* @throws IOException * @throws IOException
* if the certificate from the client is badly malformed or the
* client disconnects before sending the entire certificate.
*/ */
public void receiveHeader(PacketLineIn pckIn, boolean stateless) public void receiveHeader(PacketLineIn pckIn, boolean stateless)
throws IOException { throws IOException {

Loading…
Cancel
Save