public class GithubAuthenticationToken
extends org.acegisecurity.providers.AbstractAuthenticationToken
| Modifier and Type | Field and Description |
|---|---|
static TimeUnit |
CACHE_EXPIRY |
| Constructor and Description |
|---|
GithubAuthenticationToken(String accessToken,
String githubServer) |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCaches()
Necessary for testing
|
String |
getAccessToken()
Gets the OAuth access token, so that it can be persisted and used elsewhere.
|
org.acegisecurity.GrantedAuthority[] |
getAuthorities() |
Object |
getCredentials() |
org.kohsuke.github.GitHub |
getGitHub() |
String |
getGithubServer()
Gets the Github server used for this token
|
org.acegisecurity.GrantedAuthority[] |
getGrantedAuthorities(org.kohsuke.github.GHUser user) |
org.kohsuke.github.GHMyself |
getMyself()
Returns the GHMyself object from this instance.
|
String |
getPrincipal()
Returns the login name in GitHub.
|
GithubOAuthUserDetails |
getUserDetails(String username) |
boolean |
hasOrganizationPermission(String candidateName,
String organization)
For some reason I can't get the github api to tell me for the current
user the groups to which he belongs.
|
boolean |
hasRepositoryPermission(String repositoryName) |
boolean |
isPublicRepository(String repositoryName) |
Set<String> |
listToNames(Collection<org.kohsuke.github.GHRepository> respositories) |
org.kohsuke.github.GHOrganization |
loadOrganization(String organization) |
org.kohsuke.github.GHRepository |
loadRepository(String repositoryName) |
org.kohsuke.github.GHTeam |
loadTeam(String organization,
String team) |
org.kohsuke.github.GHUser |
loadUser(String username) |
Set<String> |
myRepositories() |
equals, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toStringpublic static final TimeUnit CACHE_EXPIRY
public GithubAuthenticationToken(String accessToken, String githubServer) throws IOException
IOExceptionpublic static void clearCaches()
public String getAccessToken()
public String getGithubServer()
public org.kohsuke.github.GitHub getGitHub()
throws IOException
IOExceptionpublic org.acegisecurity.GrantedAuthority[] getAuthorities()
getAuthorities in interface org.acegisecurity.AuthenticationgetAuthorities in class org.acegisecurity.providers.AbstractAuthenticationTokenpublic Object getCredentials()
public String getPrincipal()
public org.kohsuke.github.GHMyself getMyself()
throws IOException
IOExceptionpublic boolean hasOrganizationPermission(String candidateName, String organization)
candidateName - name of the candidateorganization - name of the organizationpublic boolean hasRepositoryPermission(String repositoryName)
public Set<String> listToNames(Collection<org.kohsuke.github.GHRepository> respositories) throws IOException
IOExceptionpublic boolean isPublicRepository(String repositoryName)
public org.kohsuke.github.GHUser loadUser(String username) throws IOException
IOExceptionpublic org.kohsuke.github.GHOrganization loadOrganization(String organization)
public org.kohsuke.github.GHRepository loadRepository(String repositoryName)
public GithubOAuthUserDetails getUserDetails(String username) throws IOException
IOExceptionpublic org.acegisecurity.GrantedAuthority[] getGrantedAuthorities(org.kohsuke.github.GHUser user)
Copyright © 2016–2017. All rights reserved.