"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/src/main/java/hudson/model/User.java" between
jenkins-jenkins-2.280.tar.gz and jenkins-jenkins-2.281.tar.gz

About: Jenkins is a automation server (written in Java) which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software (for e.g. as Continuous Integration and Continuous Delivery server). Weekly release.

User.java  (jenkins-jenkins-2.280):User.java  (jenkins-jenkins-2.281)
skipping to change at line 364 skipping to change at line 364
/** /**
* Creates an {@link Authentication} object that represents this user. * Creates an {@link Authentication} object that represents this user.
* <p> * <p>
* This method checks with {@link SecurityRealm} if the user is a valid user that can login to the security realm. * This method checks with {@link SecurityRealm} if the user is a valid user that can login to the security realm.
* If {@link SecurityRealm} is a kind that does not support querying informa tion about other users, this will * If {@link SecurityRealm} is a kind that does not support querying informa tion about other users, this will
* use {@link LastGrantedAuthoritiesProperty} to pick up the granted authori ties as of the last time the user has * use {@link LastGrantedAuthoritiesProperty} to pick up the granted authori ties as of the last time the user has
* logged in. * logged in.
* *
* @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}. * @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}.
* @since TODO * @since 2.266
*/ */
public @NonNull Authentication impersonate2() throws UsernameNotFoundExcepti on { public @NonNull Authentication impersonate2() throws UsernameNotFoundExcepti on {
return this.impersonate(this.getUserDetailsForImpersonation2()); return this.impersonate(this.getUserDetailsForImpersonation2());
} }
/** /**
* @deprecated use {@link #impersonate2} * @deprecated use {@link #impersonate2}
* @since 1.419 * @since 1.419
*/ */
@Deprecated @Deprecated
skipping to change at line 391 skipping to change at line 391
} }
/** /**
* This method checks with {@link SecurityRealm} if the user is a valid user that can login to the security realm. * This method checks with {@link SecurityRealm} if the user is a valid user that can login to the security realm.
* If {@link SecurityRealm} is a kind that does not support querying informa tion about other users, this will * If {@link SecurityRealm} is a kind that does not support querying informa tion about other users, this will
* use {@link LastGrantedAuthoritiesProperty} to pick up the granted authori ties as of the last time the user has * use {@link LastGrantedAuthoritiesProperty} to pick up the granted authori ties as of the last time the user has
* logged in. * logged in.
* *
* @return userDetails for the user, in case he's not found but seems legiti mate, we provide a userDetails with minimum access * @return userDetails for the user, in case he's not found but seems legiti mate, we provide a userDetails with minimum access
* @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}. * @throws UsernameNotFoundException If this user is not a valid user in the backend {@link SecurityRealm}.
* @since TODO * @since 2.266
*/ */
public @NonNull UserDetails getUserDetailsForImpersonation2() throws Usernam eNotFoundException { public @NonNull UserDetails getUserDetailsForImpersonation2() throws Usernam eNotFoundException {
ImpersonatingUserDetailsService2 userDetailsService = new ImpersonatingU serDetailsService2( ImpersonatingUserDetailsService2 userDetailsService = new ImpersonatingU serDetailsService2(
Jenkins.get().getSecurityRealm().getSecurityComponents().userDet ails2 Jenkins.get().getSecurityRealm().getSecurityComponents().userDet ails2
); );
try { try {
UserDetails userDetails = userDetailsService.loadUserByUsername(id); UserDetails userDetails = userDetailsService.loadUserByUsername(id);
LOGGER.log(Level.FINE, "Impersonation of the user {0} was a success" , id); LOGGER.log(Level.FINE, "Impersonation of the user {0} was a success" , id);
return userDetails; return userDetails;
skipping to change at line 598 skipping to change at line 598
public static @CheckForNull User current() { public static @CheckForNull User current() {
return get2(Jenkins.getAuthentication2()); return get2(Jenkins.getAuthentication2());
} }
/** /**
* Gets the {@link User} object representing the supplied {@link Authenticat ion} or * Gets the {@link User} object representing the supplied {@link Authenticat ion} or
* {@code null} if the supplied {@link Authentication} is either anonymous o r {@code null} * {@code null} if the supplied {@link Authentication} is either anonymous o r {@code null}
* *
* @param a the supplied {@link Authentication} . * @param a the supplied {@link Authentication} .
* @return a {@link User} object for the supplied {@link Authentication} or {@code null} * @return a {@link User} object for the supplied {@link Authentication} or {@code null}
* @since TODO * @since 2.266
*/ */
public static @CheckForNull User get2(@CheckForNull Authentication a) { public static @CheckForNull User get2(@CheckForNull Authentication a) {
if (a == null || a instanceof AnonymousAuthenticationToken) if (a == null || a instanceof AnonymousAuthenticationToken)
return null; return null;
// Since we already know this is a name, we can just call getOrCreateByI d with the name directly. // Since we already know this is a name, we can just call getOrCreateByI d with the name directly.
return getById(a.getName(), true); return getById(a.getName(), true);
} }
/** /**
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)