mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-26 08:21:23 +00:00
83 lines
4.2 KiB
HTML
83 lines
4.2 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>GHVerification.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">GitHub API for Java</a> > <a href="index.source.html" class="el_package">org.kohsuke.github</a> > <span class="el_source">GHVerification.java</span></div><h1>GHVerification.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
|
|
|
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
|
|
|
/**
|
|
* The commit/tag can be signed by user. This object holds the verification status. Whether the Commit/Tag is signed or
|
|
* not.
|
|
*
|
|
* @see <a href="https://developer.github.com/v3/git/tags/#signature-verification-object">tags signature
|
|
* verificatiion</a>
|
|
* @see <a href="https://developer.github.com/v3/git/commits/#signature-verification-object">commits signature
|
|
* verificatiion</a>
|
|
*
|
|
* @author Sourabh Sarvotham Parkala
|
|
*/
|
|
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
|
|
justification = "JSON API")
|
|
<span class="fc" id="L18">public class GHVerification {</span>
|
|
private String signature, payload;
|
|
private boolean verified;
|
|
private Reason reason;
|
|
|
|
/**
|
|
* Indicates whether GitHub considers the signature in this commit to be verified.
|
|
*
|
|
* @return true if the signature is valid else returns false.
|
|
*/
|
|
public boolean isVerified() {
|
|
<span class="fc" id="L29"> return verified;</span>
|
|
}
|
|
|
|
/**
|
|
* Gets reason for verification value.
|
|
*
|
|
* @return return reason of type {@link Reason}, such as "valid" or "unsigned". The possible values can be found in
|
|
* {@link Reason}}
|
|
*/
|
|
public Reason getReason() {
|
|
<span class="fc" id="L39"> return reason;</span>
|
|
}
|
|
|
|
/**
|
|
* Gets signature used for the verification.
|
|
*
|
|
* @return null if not signed else encoded signature.
|
|
*/
|
|
public String getSignature() {
|
|
<span class="fc" id="L48"> return signature;</span>
|
|
}
|
|
|
|
/**
|
|
* Gets the payload that was signed.
|
|
*
|
|
* @return null if not signed else encoded signature.
|
|
*/
|
|
public String getPayload() {
|
|
<span class="fc" id="L57"> return payload;</span>
|
|
}
|
|
|
|
/**
|
|
* The possible values for reason in verification object from github.
|
|
*
|
|
* @see <a href="https://developer.github.com/v3/repos/commits/#signature-verification-object">List of possible
|
|
* reason values</a>
|
|
* @author Sourabh Sarvotham Parkala
|
|
*/
|
|
<span class="fc" id="L67"> public enum Reason {</span>
|
|
<span class="fc" id="L68"> EXPIRED_KEY,</span>
|
|
<span class="fc" id="L69"> NOT_SIGNING_KEY,</span>
|
|
<span class="fc" id="L70"> GPGVERIFY_ERROR,</span>
|
|
<span class="fc" id="L71"> GPGVERIFY_UNAVAILABLE,</span>
|
|
<span class="fc" id="L72"> UNSIGNED,</span>
|
|
<span class="fc" id="L73"> UNKNOWN_SIGNATURE_TYPE,</span>
|
|
<span class="fc" id="L74"> NO_USER,</span>
|
|
<span class="fc" id="L75"> UNVERIFIED_EMAIL,</span>
|
|
<span class="fc" id="L76"> BAD_EMAIL,</span>
|
|
<span class="fc" id="L77"> UNKNOWN_KEY,</span>
|
|
<span class="fc" id="L78"> MALFORMED_SIGNATURE,</span>
|
|
<span class="fc" id="L79"> INVALID,</span>
|
|
<span class="fc" id="L80"> VALID</span>
|
|
}
|
|
}
|
|
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.7.202105040129</span></div></body></html> |