Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JENKINS-21331: include teams as groups
duplicate: JENKINS-28575 Conflicts: src/main/java/org/jenkinsci/plugins/GithubAuthenticationToken.java src/main/java/org/jenkinsci/plugins/GithubSecurityRealm.java
- Loading branch information
Showing
5 changed files
with
177 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 7 additions & 65 deletions
72
src/main/java/org/jenkinsci/plugins/GithubOAuthUserDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,23 @@ | ||
/** | ||
* | ||
* | ||
*/ | ||
package org.jenkinsci.plugins; | ||
|
||
import org.acegisecurity.GrantedAuthority; | ||
import org.acegisecurity.userdetails.User; | ||
import org.acegisecurity.userdetails.UserDetails; | ||
import org.kohsuke.github.GHUser; | ||
|
||
/** | ||
* @author Mike | ||
* | ||
*/ | ||
public class GithubOAuthUserDetails implements UserDetails { | ||
|
||
private final GHUser user; | ||
|
||
/** | ||
* | ||
*/ | ||
public GithubOAuthUserDetails(GHUser user) { | ||
this.user = user; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.acegisecurity.userdetails.UserDetails#getAuthorities() | ||
*/ | ||
@Override | ||
public GrantedAuthority[] getAuthorities() { | ||
return new GrantedAuthority [] {}; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.acegisecurity.userdetails.UserDetails#getPassword() | ||
*/ | ||
@Override | ||
public String getPassword() { | ||
return null; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.acegisecurity.userdetails.UserDetails#getUsername() | ||
*/ | ||
@Override | ||
public String getUsername() { | ||
return user.getLogin(); | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.acegisecurity.userdetails.UserDetails#isAccountNonExpired() | ||
*/ | ||
@Override | ||
public boolean isAccountNonExpired() { | ||
return true; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.acegisecurity.userdetails.UserDetails#isAccountNonLocked() | ||
*/ | ||
@Override | ||
public boolean isAccountNonLocked() { | ||
return true; | ||
} | ||
public class GithubOAuthUserDetails extends User implements UserDetails { | ||
|
||
/* (non-Javadoc) | ||
* @see org.acegisecurity.userdetails.UserDetails#isCredentialsNonExpired() | ||
*/ | ||
@Override | ||
public boolean isCredentialsNonExpired() { | ||
return true; | ||
} | ||
private static final long serialVersionUID = 1L; | ||
|
||
/* (non-Javadoc) | ||
* @see org.acegisecurity.userdetails.UserDetails#isEnabled() | ||
*/ | ||
@Override | ||
public boolean isEnabled() { | ||
return true; | ||
} | ||
public GithubOAuthUserDetails(GHUser user, GrantedAuthority[] authorities) { | ||
super(user.getLogin(), "", true, true, true, true, authorities); | ||
} | ||
|
||
} |
Oops, something went wrong.