mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-13 15:50:09 +00:00
170 lines
6.0 KiB
HTML
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> > <a href="index.source.html" class="el_package">org.kohsuke.github</a> > <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 <a href="http://developer.github.com/v3/oauth/#create-a-new-authorization">API documentation</a>
|
|
*/
|
|
<span class="fc" id="L16">public class GHAuthorization extends GHObject {</span>
|
|
public static final String USER = "user";
|
|
public static final String USER_EMAIL = "user:email";
|
|
public static final String USER_FOLLOW = "user:follow";
|
|
public static final String PUBLIC_REPO = "public_repo";
|
|
public static final String REPO = "repo";
|
|
public static final String REPO_STATUS = "repo:status";
|
|
public static final String DELETE_REPO = "delete_repo";
|
|
public static final String NOTIFICATIONS = "notifications";
|
|
public static final String GIST = "gist";
|
|
public static final String READ_HOOK = "read:repo_hook";
|
|
public static final String WRITE_HOOK = "write:repo_hook";
|
|
public static final String AMIN_HOOK = "admin:repo_hook";
|
|
public static final String READ_ORG = "read:org";
|
|
public static final String WRITE_ORG = "write:org";
|
|
public static final String ADMIN_ORG = "admin:org";
|
|
public static final String READ_KEY = "read:public_key";
|
|
public static final String WRITE_KEY = "write:public_key";
|
|
public static final String ADMIN_KEY = "admin:public_key";
|
|
|
|
private List<String> 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<String> 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 = "NM_CONFUSING", justification = "It's a part of the library API, cannot be changed")
|
|
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 = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD" },
|
|
justification = "JSON API")
|
|
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> |