Browse Source

SEC-991: Removed deprecated getAttributes() method from LdapUserDetails interface

3.0.x
Luke Taylor 18 years ago
parent
commit
b031124f61
  1. 12
      core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java
  2. 12
      core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java

12
core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetails.java

@ -17,9 +17,6 @@ package org.springframework.security.userdetails.ldap; @@ -17,9 +17,6 @@ package org.springframework.security.userdetails.ldap;
import org.springframework.security.userdetails.UserDetails;
import javax.naming.directory.Attributes;
/**
* Captures the information for a user's LDAP entry.
*
@ -29,15 +26,6 @@ import javax.naming.directory.Attributes; @@ -29,15 +26,6 @@ import javax.naming.directory.Attributes;
public interface LdapUserDetails extends UserDetails {
//~ Methods ========================================================================================================
/**
* The attributes for the user's entry in the directory (or a subset of them, depending on what was
* retrieved from the directory).
*
* @deprecated Map additional attributes to user properties in a custom object rather than accessing them here.
* @return the user's attributes, or an empty array if none were obtained, never null.
*/
Attributes getAttributes();
/**
* The DN of the entry for this user's account.
*

12
core/src/main/java/org/springframework/security/userdetails/ldap/LdapUserDetailsImpl.java

@ -47,7 +47,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails { @@ -47,7 +47,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
//~ Instance fields ================================================================================================
private Attributes attributes = new BasicAttributes();
private String dn;
private String password;
private String username;
@ -63,10 +62,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails { @@ -63,10 +62,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
//~ Methods ========================================================================================================
public Attributes getAttributes() {
return attributes;
}
public GrantedAuthority[] getAuthorities() {
return authorities;
}
@ -123,7 +118,7 @@ public class LdapUserDetailsImpl implements LdapUserDetails { @@ -123,7 +118,7 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
sb.append("Not granted any authorities");
}
return sb.toString();
return sb.toString();
}
//~ Inner Classes ==================================================================================================
@ -143,7 +138,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails { @@ -143,7 +138,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
public Essence(LdapUserDetails copyMe) {
setDn(copyMe.getDn());
setAttributes(copyMe.getAttributes());
setUsername(copyMe.getUsername());
setPassword(copyMe.getPassword());
setEnabled(copyMe.isEnabled());
@ -202,10 +196,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails { @@ -202,10 +196,6 @@ public class LdapUserDetailsImpl implements LdapUserDetails {
instance.accountNonLocked = accountNonLocked;
}
public void setAttributes(Attributes attributes) {
instance.attributes = attributes;
}
public void setAuthorities(GrantedAuthority[] authorities) {
mutableAuthorities = new ArrayList(Arrays.asList(authorities));
}

Loading…
Cancel
Save