Files
github-api/jacoco/org.kohsuke.github/GHAuthorization.java.html
2021-06-02 11:09:28 -07:00

170 lines
6.0 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>GHAuthorization.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> &gt; <a href="index.source.html" class="el_package">org.kohsuke.github</a> &gt; <span class="el_source">GHAuthorization.java</span></div><h1>GHAuthorization.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.net.URL;
import java.util.Collection;
import java.util.List;
/**
* Generated OAuth token
*
* @author janinko
* @see GitHub#createToken(Collection, String, String) GitHub#createToken(Collection, String, String)
* @see &lt;a href=&quot;http://developer.github.com/v3/oauth/#create-a-new-authorization&quot;&gt;API documentation&lt;/a&gt;
*/
<span class="fc" id="L16">public class GHAuthorization extends GHObject {</span>
public static final String USER = &quot;user&quot;;
public static final String USER_EMAIL = &quot;user:email&quot;;
public static final String USER_FOLLOW = &quot;user:follow&quot;;
public static final String PUBLIC_REPO = &quot;public_repo&quot;;
public static final String REPO = &quot;repo&quot;;
public static final String REPO_STATUS = &quot;repo:status&quot;;
public static final String DELETE_REPO = &quot;delete_repo&quot;;
public static final String NOTIFICATIONS = &quot;notifications&quot;;
public static final String GIST = &quot;gist&quot;;
public static final String READ_HOOK = &quot;read:repo_hook&quot;;
public static final String WRITE_HOOK = &quot;write:repo_hook&quot;;
public static final String AMIN_HOOK = &quot;admin:repo_hook&quot;;
public static final String READ_ORG = &quot;read:org&quot;;
public static final String WRITE_ORG = &quot;write:org&quot;;
public static final String ADMIN_ORG = &quot;admin:org&quot;;
public static final String READ_KEY = &quot;read:public_key&quot;;
public static final String WRITE_KEY = &quot;write:public_key&quot;;
public static final String ADMIN_KEY = &quot;admin:public_key&quot;;
private List&lt;String&gt; scopes;
private String token;
private String token_last_eight;
private String hashed_token;
private App app;
private String note;
private String note_url;
private String fingerprint;
// TODO add some user class for https://developer.github.com/v3/oauth_authorizations/#check-an-authorization ?
// private GHUser user;
/**
* Gets root.
*
* @return the root
*/
public GitHub getRoot() {
<span class="nc" id="L53"> return root;</span>
}
/**
* Gets scopes.
*
* @return the scopes
*/
public List&lt;String&gt; getScopes() {
<span class="fc" id="L62"> return scopes;</span>
}
/**
* Gets token.
*
* @return the token
*/
public String getToken() {
<span class="fc" id="L71"> return token;</span>
}
/**
* Gets token last eight.
*
* @return the token last eight
*/
public String getTokenLastEight() {
<span class="fc" id="L80"> return token_last_eight;</span>
}
/**
* Gets hashed token.
*
* @return the hashed token
*/
public String getHashedToken() {
<span class="fc" id="L89"> return hashed_token;</span>
}
/**
* Gets app url.
*
* @return the app url
*/
public URL getAppUrl() {
<span class="fc" id="L98"> return GitHubClient.parseURL(app.url);</span>
}
/**
* Gets app name.
*
* @return the app name
*/
public String getAppName() {
<span class="fc" id="L107"> return app.name;</span>
}
/**
* Gets api url.
*
* @return the api url
* @deprecated use {@link #getUrl()}
*/
@Deprecated
@SuppressFBWarnings(value = &quot;NM_CONFUSING&quot;, justification = &quot;It's a part of the library API, cannot be changed&quot;)
public URL getApiURL() {
<span class="nc" id="L119"> return getUrl();</span>
}
/**
* @deprecated This object has no HTML URL.
*/
@Override
public URL getHtmlUrl() {
<span class="fc" id="L127"> return null;</span>
}
/**
* Gets note.
*
* @return the note
*/
public String getNote() {
<span class="fc" id="L136"> return note;</span>
}
/**
* Gets note url.
*
* @return the note url
*/
public URL getNoteUrl() {
<span class="fc" id="L145"> return GitHubClient.parseURL(note_url);</span>
}
/**
* Gets fingerprint.
*
* @return the fingerprint
*/
public String getFingerprint() {
<span class="fc" id="L154"> return fingerprint;</span>
}
GHAuthorization wrap(GitHub root) {
<span class="fc" id="L158"> this.root = root;</span>
<span class="fc" id="L159"> return this;</span>
}
@SuppressFBWarnings(value = { &quot;UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD&quot;, &quot;UWF_UNWRITTEN_FIELD&quot; },
justification = &quot;JSON API&quot;)
private static class App {
private String url;
private String name;
// private String client_id; not yet used
}
}
</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>