Apply code cleanup rules to projects
Apply automated cleanup rules to add `@Override` and `@Deprecated` annotations and to fix class references used with static methods. Issue gh-8945
This commit is contained in:
parent
8866fa6fb0
commit
9e08b51ed3
|
@ -156,10 +156,12 @@ public class AclEntryVoter extends AbstractAclVoter {
|
|||
this.sidRetrievalStrategy = sidRetrievalStrategy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(ConfigAttribute attribute) {
|
||||
return (attribute.getAttribute() != null) && attribute.getAttribute().equals(getProcessConfigAttribute());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int vote(Authentication authentication, MethodInvocation object, Collection<ConfigAttribute> attributes) {
|
||||
|
||||
for (ConfigAttribute attr : attributes) {
|
||||
|
|
|
@ -52,6 +52,7 @@ public class AclPermissionCacheOptimizer implements PermissionCacheOptimizer {
|
|||
this.aclService = aclService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cachePermissionsFor(Authentication authentication, Collection<?> objects) {
|
||||
if (objects.isEmpty()) {
|
||||
return;
|
||||
|
|
|
@ -70,6 +70,7 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
|
|||
* the ACL configuration. If the domain object is null, returns false (this can always
|
||||
* be overridden using a null check in the expression itself).
|
||||
*/
|
||||
@Override
|
||||
public boolean hasPermission(Authentication authentication, Object domainObject, Object permission) {
|
||||
if (domainObject == null) {
|
||||
return false;
|
||||
|
@ -80,6 +81,7 @@ public class AclPermissionEvaluator implements PermissionEvaluator {
|
|||
return checkPermission(authentication, objectIdentity, permission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType,
|
||||
Object permission) {
|
||||
ObjectIdentity objectIdentity = this.objectIdentityGenerator.createObjectIdentity(targetId, targetType);
|
||||
|
|
|
@ -109,6 +109,7 @@ public abstract class AbstractAclProvider implements AfterInvocationProvider {
|
|||
this.sidRetrievalStrategy = sidRetrievalStrategy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(ConfigAttribute attribute) {
|
||||
return this.processConfigAttribute.equals(attribute.getAttribute());
|
||||
}
|
||||
|
@ -119,6 +120,7 @@ public abstract class AbstractAclProvider implements AfterInvocationProvider {
|
|||
* @param clazz the secure object
|
||||
* @return always <code>true</code>
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(Class<?> clazz) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ public class AclEntryAfterInvocationCollectionFilteringProvider extends Abstract
|
|||
super(aclService, "AFTER_ACL_COLLECTION_READ", requirePermission);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object decide(Authentication authentication, Object object, Collection<ConfigAttribute> config,
|
||||
Object returnedObject) throws AccessDeniedException {
|
||||
|
|
|
@ -74,6 +74,7 @@ public class AclEntryAfterInvocationProvider extends AbstractAclProvider impleme
|
|||
super(aclService, processConfigAttribute, requirePermission);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object decide(Authentication authentication, Object object, Collection<ConfigAttribute> config,
|
||||
Object returnedObject) throws AccessDeniedException {
|
||||
|
||||
|
@ -111,6 +112,7 @@ public class AclEntryAfterInvocationProvider extends AbstractAclProvider impleme
|
|||
return returnedObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMessageSource(MessageSource messageSource) {
|
||||
this.messages = new MessageSourceAccessor(messageSource);
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ class ArrayFilterer<T> implements Filterer<T> {
|
|||
*
|
||||
* @see org.springframework.security.acls.afterinvocation.Filterer#getFilteredObject()
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public T[] getFilteredObject() {
|
||||
// Recreate an array of same type and filter the removed objects.
|
||||
|
@ -80,14 +81,17 @@ class ArrayFilterer<T> implements Filterer<T> {
|
|||
*
|
||||
* @see org.springframework.security.acls.afterinvocation.Filterer#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<T> iterator() {
|
||||
return new Iterator<T>() {
|
||||
private int index = 0;
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return this.index < ArrayFilterer.this.list.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T next() {
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
|
@ -95,6 +99,7 @@ class ArrayFilterer<T> implements Filterer<T> {
|
|||
return ArrayFilterer.this.list[this.index++];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@ -105,6 +110,7 @@ class ArrayFilterer<T> implements Filterer<T> {
|
|||
*
|
||||
* @see org.springframework.security.acls.afterinvocation.Filterer#remove(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void remove(T object) {
|
||||
this.removeList.add(object);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ class CollectionFilterer<T> implements Filterer<T> {
|
|||
*
|
||||
* @see org.springframework.security.acls.afterinvocation.Filterer#getFilteredObject()
|
||||
*/
|
||||
@Override
|
||||
public Object getFilteredObject() {
|
||||
// Now the Iterator has ended, remove Objects from Collection
|
||||
Iterator<T> removeIter = this.removeList.iterator();
|
||||
|
@ -77,6 +78,7 @@ class CollectionFilterer<T> implements Filterer<T> {
|
|||
*
|
||||
* @see org.springframework.security.acls.afterinvocation.Filterer#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<T> iterator() {
|
||||
return this.collection.iterator();
|
||||
}
|
||||
|
@ -85,6 +87,7 @@ class CollectionFilterer<T> implements Filterer<T> {
|
|||
*
|
||||
* @see org.springframework.security.acls.afterinvocation.Filterer#remove(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void remove(T object) {
|
||||
this.removeList.add(object);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ interface Filterer<T> extends Iterable<T> {
|
|||
* Returns an iterator over the filtered collection or array.
|
||||
* @return an Iterator
|
||||
*/
|
||||
@Override
|
||||
Iterator<T> iterator();
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,6 +50,7 @@ public abstract class AbstractPermission implements Permission {
|
|||
this.code = code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean equals(Object arg0) {
|
||||
if (arg0 == null) {
|
||||
return false;
|
||||
|
@ -64,18 +65,22 @@ public abstract class AbstractPermission implements Permission {
|
|||
return (this.mask == rhs.getMask());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getMask() {
|
||||
return this.mask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPattern() {
|
||||
return AclFormattingUtils.printBinary(this.mask, this.code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String toString() {
|
||||
return this.getClass().getSimpleName() + "[" + getPattern() + "=" + this.mask + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return this.mask;
|
||||
}
|
||||
|
|
|
@ -77,6 +77,7 @@ public class AclAuthorizationStrategyImpl implements AclAuthorizationStrategy {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void securityCheck(Acl acl, int changeType) {
|
||||
if ((SecurityContextHolder.getContext() == null)
|
||||
|| (SecurityContextHolder.getContext().getAuthentication() == null)
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.springframework.util.Assert;
|
|||
*/
|
||||
public class ConsoleAuditLogger implements AuditLogger {
|
||||
|
||||
@Override
|
||||
public void logIfNeeded(boolean granted, AccessControlEntry ace) {
|
||||
Assert.notNull(ace, "AccessControlEntry required");
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ public class CumulativePermission extends AbstractPermission {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPattern() {
|
||||
return this.pattern;
|
||||
}
|
||||
|
|
|
@ -113,6 +113,7 @@ public class DefaultPermissionFactory implements PermissionFactory {
|
|||
this.registeredPermissionsByName.put(permissionName, perm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Permission buildFromMask(int mask) {
|
||||
if (this.registeredPermissionsByInteger.containsKey(mask)) {
|
||||
// The requested mask has an exact match against a statically-defined
|
||||
|
@ -140,6 +141,7 @@ public class DefaultPermissionFactory implements PermissionFactory {
|
|||
return permission;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Permission buildFromName(String name) {
|
||||
Permission p = this.registeredPermissionsByName.get(name);
|
||||
|
||||
|
@ -150,6 +152,7 @@ public class DefaultPermissionFactory implements PermissionFactory {
|
|||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Permission> buildFromNames(List<String> names) {
|
||||
if ((names == null) || (names.size() == 0)) {
|
||||
return Collections.emptyList();
|
||||
|
|
|
@ -70,6 +70,7 @@ public class DefaultPermissionGrantingStrategy implements PermissionGrantingStra
|
|||
* @throws NotFoundException if an exact ACE for one of the permission bit masks and
|
||||
* SID combination could not be found
|
||||
*/
|
||||
@Override
|
||||
public boolean isGranted(Acl acl, List<Permission> permission, List<Sid> sids, boolean administrativeMode)
|
||||
throws NotFoundException {
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ public class EhCacheBasedAclCache implements AclCache {
|
|||
this.aclAuthorizationStrategy = aclAuthorizationStrategy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evictFromCache(Serializable pk) {
|
||||
Assert.notNull(pk, "Primary key (identifier) required");
|
||||
|
||||
|
@ -66,6 +67,7 @@ public class EhCacheBasedAclCache implements AclCache {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evictFromCache(ObjectIdentity objectIdentity) {
|
||||
Assert.notNull(objectIdentity, "ObjectIdentity required");
|
||||
|
||||
|
@ -77,6 +79,7 @@ public class EhCacheBasedAclCache implements AclCache {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableAcl getFromCache(ObjectIdentity objectIdentity) {
|
||||
Assert.notNull(objectIdentity, "ObjectIdentity required");
|
||||
|
||||
|
@ -95,6 +98,7 @@ public class EhCacheBasedAclCache implements AclCache {
|
|||
return initializeTransientFields((MutableAcl) element.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableAcl getFromCache(Serializable pk) {
|
||||
Assert.notNull(pk, "Primary key (identifier) required");
|
||||
|
||||
|
@ -113,6 +117,7 @@ public class EhCacheBasedAclCache implements AclCache {
|
|||
return initializeTransientFields((MutableAcl) element.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putInCache(MutableAcl acl) {
|
||||
Assert.notNull(acl, "Acl required");
|
||||
Assert.notNull(acl.getObjectIdentity(), "ObjectIdentity required");
|
||||
|
@ -147,6 +152,7 @@ public class EhCacheBasedAclCache implements AclCache {
|
|||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCache() {
|
||||
this.cache.removeAll();
|
||||
}
|
||||
|
|
|
@ -31,10 +31,12 @@ import org.springframework.security.acls.model.ObjectIdentityRetrievalStrategy;
|
|||
*/
|
||||
public class ObjectIdentityRetrievalStrategyImpl implements ObjectIdentityRetrievalStrategy, ObjectIdentityGenerator {
|
||||
|
||||
@Override
|
||||
public ObjectIdentity getObjectIdentity(Object domainObject) {
|
||||
return new ObjectIdentityImpl(domainObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectIdentity createObjectIdentity(Serializable id, String type) {
|
||||
return new ObjectIdentityImpl(type, id);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ public class SidRetrievalStrategyImpl implements SidRetrievalStrategy {
|
|||
this.roleHierarchy = roleHierarchy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Sid> getSids(Authentication authentication) {
|
||||
Collection<? extends GrantedAuthority> authorities = this.roleHierarchy
|
||||
.getReachableGrantedAuthorities(authentication.getAuthorities());
|
||||
|
|
|
@ -56,6 +56,7 @@ public class SpringCacheBasedAclCache implements AclCache {
|
|||
this.aclAuthorizationStrategy = aclAuthorizationStrategy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evictFromCache(Serializable pk) {
|
||||
Assert.notNull(pk, "Primary key (identifier) required");
|
||||
|
||||
|
@ -67,6 +68,7 @@ public class SpringCacheBasedAclCache implements AclCache {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void evictFromCache(ObjectIdentity objectIdentity) {
|
||||
Assert.notNull(objectIdentity, "ObjectIdentity required");
|
||||
|
||||
|
@ -78,16 +80,19 @@ public class SpringCacheBasedAclCache implements AclCache {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableAcl getFromCache(ObjectIdentity objectIdentity) {
|
||||
Assert.notNull(objectIdentity, "ObjectIdentity required");
|
||||
return getFromCache((Object) objectIdentity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableAcl getFromCache(Serializable pk) {
|
||||
Assert.notNull(pk, "Primary key (identifier) required");
|
||||
return getFromCache((Object) pk);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putInCache(MutableAcl acl) {
|
||||
Assert.notNull(acl, "Acl required");
|
||||
Assert.notNull(acl.getObjectIdentity(), "ObjectIdentity required");
|
||||
|
@ -123,6 +128,7 @@ public class SpringCacheBasedAclCache implements AclCache {
|
|||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCache() {
|
||||
this.cache.clear();
|
||||
}
|
||||
|
|
|
@ -264,6 +264,7 @@ public class BasicLookupStrategy implements LookupStrategy {
|
|||
* {@link NotFoundException}, as a chain of {@link LookupStrategy}s may be used to
|
||||
* automatically create entries if required)
|
||||
*/
|
||||
@Override
|
||||
public final Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids) {
|
||||
Assert.isTrue(this.batchSize >= 1, "BatchSize must be >= 1");
|
||||
Assert.notEmpty(objects, "Objects to lookup required");
|
||||
|
@ -543,6 +544,7 @@ public class BasicLookupStrategy implements LookupStrategy {
|
|||
* <tt>null</tt>)
|
||||
* @throws SQLException
|
||||
*/
|
||||
@Override
|
||||
public Set<Long> extractData(ResultSet rs) throws SQLException {
|
||||
Set<Long> parentIdsToLookup = new HashSet<>(); // Set of parent_id Longs
|
||||
|
||||
|
@ -652,6 +654,7 @@ public class BasicLookupStrategy implements LookupStrategy {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccessControlEntry> getEntries() {
|
||||
throw new UnsupportedOperationException("Stub only");
|
||||
}
|
||||
|
@ -660,27 +663,33 @@ public class BasicLookupStrategy implements LookupStrategy {
|
|||
return this.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectIdentity getObjectIdentity() {
|
||||
throw new UnsupportedOperationException("Stub only");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sid getOwner() {
|
||||
throw new UnsupportedOperationException("Stub only");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Acl getParentAcl() {
|
||||
throw new UnsupportedOperationException("Stub only");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEntriesInheriting() {
|
||||
throw new UnsupportedOperationException("Stub only");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGranted(List<Permission> permission, List<Sid> sids, boolean administrativeMode)
|
||||
throws NotFoundException, UnloadedSidException {
|
||||
throw new UnsupportedOperationException("Stub only");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSidLoaded(List<Sid> sids) {
|
||||
throw new UnsupportedOperationException("Stub only");
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ public class JdbcAclService implements AclService {
|
|||
this.aclClassIdUtils = new AclClassIdUtils();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity) {
|
||||
Object[] args = { parentIdentity.getIdentifier().toString(), parentIdentity.getType() };
|
||||
List<ObjectIdentity> objects = this.jdbcOperations.query(this.findChildrenSql, args, (rs, rowNum) -> {
|
||||
|
@ -106,6 +107,7 @@ public class JdbcAclService implements AclService {
|
|||
return objects;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Acl readAclById(ObjectIdentity object, List<Sid> sids) throws NotFoundException {
|
||||
Map<ObjectIdentity, Acl> map = readAclsById(Collections.singletonList(object), sids);
|
||||
Assert.isTrue(map.containsKey(object),
|
||||
|
@ -114,14 +116,17 @@ public class JdbcAclService implements AclService {
|
|||
return map.get(object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Acl readAclById(ObjectIdentity object) throws NotFoundException {
|
||||
return readAclById(object, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects) throws NotFoundException {
|
||||
return readAclsById(objects, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids)
|
||||
throws NotFoundException {
|
||||
Map<ObjectIdentity, Acl> result = this.lookupStrategy.readAclsById(objects, sids);
|
||||
|
|
|
@ -103,6 +103,7 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
|
|||
this.aclCache = aclCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableAcl createAcl(ObjectIdentity objectIdentity) throws AlreadyExistsException {
|
||||
Assert.notNull(objectIdentity, "Object Identity required");
|
||||
|
||||
|
@ -137,10 +138,12 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
|
|||
return;
|
||||
}
|
||||
this.jdbcOperations.batchUpdate(this.insertEntry, new BatchPreparedStatementSetter() {
|
||||
@Override
|
||||
public int getBatchSize() {
|
||||
return acl.getEntries().size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValues(PreparedStatement stmt, int i) throws SQLException {
|
||||
AccessControlEntry entry_ = acl.getEntries().get(i);
|
||||
Assert.isTrue(entry_ instanceof AccessControlEntryImpl, "Unknown ACE class");
|
||||
|
@ -256,6 +259,7 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAcl(ObjectIdentity objectIdentity, boolean deleteChildren) throws ChildrenExistException {
|
||||
Assert.notNull(objectIdentity, "Object Identity required");
|
||||
Assert.notNull(objectIdentity.getIdentifier(), "Object Identity doesn't provide an identifier");
|
||||
|
@ -338,6 +342,7 @@ public class JdbcMutableAclService extends JdbcAclService implements MutableAclS
|
|||
* dirty state checking, or more likely use ORM capabilities for create, update and
|
||||
* delete operations of {@link MutableAcl}.
|
||||
*/
|
||||
@Override
|
||||
public MutableAcl updateAcl(MutableAcl acl) throws NotFoundException {
|
||||
Assert.notNull(acl.getId(), "Object Identity doesn't provide an identifier");
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ public interface ObjectIdentity extends Serializable {
|
|||
* @return <tt>true</tt> if the objects are equal, <tt>false</tt> otherwise
|
||||
* @see Object#equals(Object)
|
||||
*/
|
||||
@Override
|
||||
boolean equals(Object obj);
|
||||
|
||||
/**
|
||||
|
@ -66,6 +67,7 @@ public interface ObjectIdentity extends Serializable {
|
|||
* @return a hash code representation of the <tt>ObjectIdentity</tt>
|
||||
* @see Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
int hashCode();
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ package org.springframework.security.acls.model;
|
|||
*/
|
||||
public interface OwnershipAcl extends MutableAcl {
|
||||
|
||||
@Override
|
||||
void setOwner(Sid newOwner);
|
||||
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ public interface Sid extends Serializable {
|
|||
* @param obj to be compared
|
||||
* @return <code>true</code> if the objects are equal, <code>false</code> otherwise
|
||||
*/
|
||||
@Override
|
||||
boolean equals(Object obj);
|
||||
|
||||
/**
|
||||
|
@ -45,6 +46,7 @@ public interface Sid extends Serializable {
|
|||
* contract.
|
||||
* @return a hash code representation of this object
|
||||
*/
|
||||
@Override
|
||||
int hashCode();
|
||||
|
||||
}
|
||||
|
|
|
@ -592,10 +592,12 @@ public class AclImplTests {
|
|||
|
||||
private class MockAclService implements MutableAclService {
|
||||
|
||||
@Override
|
||||
public MutableAcl createAcl(ObjectIdentity objectIdentity) throws AlreadyExistsException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAcl(ObjectIdentity objectIdentity, boolean deleteChildren) throws ChildrenExistException {
|
||||
}
|
||||
|
||||
|
@ -606,6 +608,7 @@ public class AclImplTests {
|
|||
* @see org.springframework.security.acls.MutableAclService#updateAcl(org.
|
||||
* springframework .security.acls.MutableAcl)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public MutableAcl updateAcl(MutableAcl acl) throws NotFoundException {
|
||||
List<AccessControlEntry> oldAces = acl.getEntries();
|
||||
|
@ -632,22 +635,27 @@ public class AclImplTests {
|
|||
return acl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ObjectIdentity> findChildren(ObjectIdentity parentIdentity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Acl readAclById(ObjectIdentity object) throws NotFoundException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Acl readAclById(ObjectIdentity object, List<Sid> sids) throws NotFoundException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects) throws NotFoundException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ObjectIdentity, Acl> readAclsById(List<ObjectIdentity> objects, List<Sid> sids)
|
||||
throws NotFoundException {
|
||||
return null;
|
||||
|
|
|
@ -67,6 +67,7 @@ public class BasicLookupStrategyWithAclClassTypeTests extends AbstractBasicLooku
|
|||
DATABASE_HELPER.getDataSource().destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Before
|
||||
public void initializeBeans() {
|
||||
super.initializeBeans();
|
||||
|
|
|
@ -392,8 +392,8 @@ public class JdbcMutableAclServiceTests extends AbstractTransactionalJUnit4Sprin
|
|||
|
||||
try {
|
||||
this.jdbcMutableAclService.setForeignKeysInDatabase(false); // switch on FK
|
||||
// checking in the
|
||||
// class, not database
|
||||
// checking in the
|
||||
// class, not database
|
||||
this.jdbcMutableAclService.deleteAcl(getTopParentOid(), false);
|
||||
fail("It should have thrown ChildrenExistException");
|
||||
}
|
||||
|
@ -401,7 +401,7 @@ public class JdbcMutableAclServiceTests extends AbstractTransactionalJUnit4Sprin
|
|||
}
|
||||
finally {
|
||||
this.jdbcMutableAclService.setForeignKeysInDatabase(true); // restore to the
|
||||
// default
|
||||
// default
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -173,6 +173,7 @@ interface SecuredInterface {
|
|||
class SecuredImpl implements SecuredInterface {
|
||||
|
||||
// Not really secured because AspectJ doesn't inherit annotations from interfaces
|
||||
@Override
|
||||
public void securedMethod() {
|
||||
}
|
||||
|
||||
|
@ -197,9 +198,11 @@ class SecuredImpl implements SecuredInterface {
|
|||
|
||||
class SecuredImplSubclass extends SecuredImpl {
|
||||
|
||||
@Override
|
||||
protected void protectedMethod() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publicCallsPrivate() {
|
||||
super.publicCallsPrivate();
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ public class ServiceProperties implements InitializingBean {
|
|||
|
||||
private String serviceParameter = DEFAULT_CAS_SERVICE_PARAMETER;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
Assert.hasLength(this.service, "service cannot be empty.");
|
||||
Assert.hasLength(this.artifactParameter, "artifactParameter cannot be empty.");
|
||||
|
|
|
@ -43,10 +43,12 @@ public final class CasAssertionAuthenticationToken extends AbstractAuthenticatio
|
|||
this.ticket = ticket;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getPrincipal() {
|
||||
return this.assertion.getPrincipal().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getCredentials() {
|
||||
return this.ticket;
|
||||
}
|
||||
|
|
|
@ -36,10 +36,12 @@ public class EhCacheBasedTicketCache implements StatelessTicketCache, Initializi
|
|||
|
||||
private Ehcache cache;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(this.cache, "cache mandatory");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CasAuthenticationToken getByTicketId(final String serviceTicket) {
|
||||
final Element element = this.cache.get(serviceTicket);
|
||||
|
||||
|
@ -54,6 +56,7 @@ public class EhCacheBasedTicketCache implements StatelessTicketCache, Initializi
|
|||
return this.cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putTicketInCache(final CasAuthenticationToken token) {
|
||||
final Element element = new Element(token.getCredentials().toString(), token);
|
||||
|
||||
|
@ -64,6 +67,7 @@ public class EhCacheBasedTicketCache implements StatelessTicketCache, Initializi
|
|||
this.cache.put(element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTicketFromCache(final CasAuthenticationToken token) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Cache remove: " + token.getCredentials().toString());
|
||||
|
@ -72,6 +76,7 @@ public class EhCacheBasedTicketCache implements StatelessTicketCache, Initializi
|
|||
this.removeTicketFromCache(token.getCredentials().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTicketFromCache(final String serviceTicket) {
|
||||
this.cache.remove(serviceTicket);
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ public final class NullStatelessTicketCache implements StatelessTicketCache {
|
|||
/**
|
||||
* @return null since we are not storing any tickets.
|
||||
*/
|
||||
@Override
|
||||
public CasAuthenticationToken getByTicketId(final String serviceTicket) {
|
||||
return null;
|
||||
}
|
||||
|
@ -38,6 +39,7 @@ public final class NullStatelessTicketCache implements StatelessTicketCache {
|
|||
/**
|
||||
* This is a no-op since we are not storing tickets.
|
||||
*/
|
||||
@Override
|
||||
public void putTicketInCache(final CasAuthenticationToken token) {
|
||||
// nothing to do
|
||||
}
|
||||
|
@ -45,6 +47,7 @@ public final class NullStatelessTicketCache implements StatelessTicketCache {
|
|||
/**
|
||||
* This is a no-op since we are not storing tickets.
|
||||
*/
|
||||
@Override
|
||||
public void removeTicketFromCache(final CasAuthenticationToken token) {
|
||||
// nothing to do
|
||||
}
|
||||
|
@ -52,6 +55,7 @@ public final class NullStatelessTicketCache implements StatelessTicketCache {
|
|||
/**
|
||||
* This is a no-op since we are not storing tickets.
|
||||
*/
|
||||
@Override
|
||||
public void removeTicketFromCache(final String serviceTicket) {
|
||||
// nothing to do
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ public class SpringCacheBasedTicketCache implements StatelessTicketCache {
|
|||
this.cache = cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CasAuthenticationToken getByTicketId(final String serviceTicket) {
|
||||
final Cache.ValueWrapper element = serviceTicket != null ? this.cache.get(serviceTicket) : null;
|
||||
|
||||
|
@ -49,6 +50,7 @@ public class SpringCacheBasedTicketCache implements StatelessTicketCache {
|
|||
return element == null ? null : (CasAuthenticationToken) element.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putTicketInCache(final CasAuthenticationToken token) {
|
||||
String key = token.getCredentials().toString();
|
||||
|
||||
|
@ -59,6 +61,7 @@ public class SpringCacheBasedTicketCache implements StatelessTicketCache {
|
|||
this.cache.put(key, token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTicketFromCache(final CasAuthenticationToken token) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Cache remove: " + token.getCredentials().toString());
|
||||
|
@ -67,6 +70,7 @@ public class SpringCacheBasedTicketCache implements StatelessTicketCache {
|
|||
this.removeTicketFromCache(token.getCredentials().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTicketFromCache(final String serviceTicket) {
|
||||
this.cache.evict(serviceTicket);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.springframework.security.core.userdetails.UserDetails;
|
|||
public abstract class AbstractCasAssertionUserDetailsService
|
||||
implements AuthenticationUserDetailsService<CasAssertionAuthenticationToken> {
|
||||
|
||||
@Override
|
||||
public final UserDetails loadUserDetails(final CasAssertionAuthenticationToken token) {
|
||||
return loadUserDetails(token.getAssertion());
|
||||
}
|
||||
|
|
|
@ -60,12 +60,14 @@ public class CasAuthenticationEntryPoint implements AuthenticationEntryPoint, In
|
|||
*/
|
||||
private boolean encodeServiceUrlWithSessionId = true;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
Assert.hasLength(this.loginUrl, "loginUrl must be specified");
|
||||
Assert.notNull(this.serviceProperties, "serviceProperties must be specified");
|
||||
Assert.notNull(this.serviceProperties.getService(), "serviceProperties.getService() cannot be null.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void commence(final HttpServletRequest servletRequest, final HttpServletResponse response,
|
||||
final AuthenticationException authenticationException) throws IOException {
|
||||
|
||||
|
|
|
@ -271,6 +271,7 @@ public class CasAuthenticationFilter extends AbstractAuthenticationProcessingFil
|
|||
/**
|
||||
* Overridden to provide proxying capabilities.
|
||||
*/
|
||||
@Override
|
||||
protected boolean requiresAuthentication(final HttpServletRequest request, final HttpServletResponse response) {
|
||||
final boolean serviceTicketRequest = serviceTicketRequest(request, response);
|
||||
final boolean result = serviceTicketRequest || proxyReceptorRequest(request)
|
||||
|
@ -398,6 +399,7 @@ public class CasAuthenticationFilter extends AbstractAuthenticationProcessingFil
|
|||
this.serviceTicketFailureHandler = failureHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
|
||||
AuthenticationException exception) throws IOException, ServletException {
|
||||
if (serviceTicketRequest(request, response)) {
|
||||
|
|
|
@ -61,6 +61,7 @@ final class DefaultServiceAuthenticationDetails extends WebAuthenticationDetails
|
|||
* Returns the current URL minus the artifact parameter and its value, if present.
|
||||
* @see org.springframework.security.cas.web.authentication.ServiceAuthenticationDetails#getServiceUrl()
|
||||
*/
|
||||
@Override
|
||||
public String getServiceUrl() {
|
||||
return this.serviceUrl;
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ public class ServiceAuthenticationDetailsSource
|
|||
* @return the {@code ServiceAuthenticationDetails} containing information about the
|
||||
* current request
|
||||
*/
|
||||
@Override
|
||||
public ServiceAuthenticationDetails buildDetails(HttpServletRequest context) {
|
||||
try {
|
||||
return new DefaultServiceAuthenticationDetails(this.serviceProperties.getService(), context,
|
||||
|
|
|
@ -378,6 +378,7 @@ public class CasAuthenticationProviderTests {
|
|||
|
||||
private class MockAuthoritiesPopulator implements AuthenticationUserDetailsService {
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserDetails(final Authentication token) throws UsernameNotFoundException {
|
||||
return makeUserDetailsFromAuthoritiesPopulator();
|
||||
}
|
||||
|
@ -388,18 +389,22 @@ public class CasAuthenticationProviderTests {
|
|||
|
||||
private Map<String, CasAuthenticationToken> cache = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public CasAuthenticationToken getByTicketId(String serviceTicket) {
|
||||
return this.cache.get(serviceTicket);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putTicketInCache(CasAuthenticationToken token) {
|
||||
this.cache.put(token.getCredentials().toString(), token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTicketFromCache(CasAuthenticationToken token) {
|
||||
throw new UnsupportedOperationException("mock method not implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTicketFromCache(String serviceTicket) {
|
||||
throw new UnsupportedOperationException("mock method not implemented");
|
||||
}
|
||||
|
@ -414,6 +419,7 @@ public class CasAuthenticationProviderTests {
|
|||
this.returnTicket = returnTicket;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Assertion validate(final String ticket, final String service) {
|
||||
if (this.returnTicket) {
|
||||
return new AssertionImpl("rod");
|
||||
|
|
|
@ -79,6 +79,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
|
|||
@EnableWebSecurity
|
||||
static class DefaultLdapConfig extends BaseLdapProviderConfig {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -102,6 +103,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
|
|||
@EnableWebSecurity
|
||||
static class GroupRolesConfig extends BaseLdapProviderConfig {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -126,6 +128,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
|
|||
@EnableWebSecurity
|
||||
static class GroupSearchConfig extends BaseLdapProviderConfig {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -150,6 +153,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
|
|||
@EnableWebSecurity
|
||||
static class GroupSubtreeSearchConfig extends BaseLdapProviderConfig {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -174,6 +178,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
|
|||
@EnableWebSecurity
|
||||
static class RolePrefixConfig extends BaseLdapProviderConfig {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -197,6 +202,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
|
|||
@EnableWebSecurity
|
||||
static class BindAuthenticationConfig extends BaseLdapServerConfig {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -222,6 +228,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
|
|||
@EnableWebSecurity
|
||||
static class PasswordEncoderConfig extends BaseLdapServerConfig {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -283,6 +290,7 @@ public class LdapAuthenticationProviderBuilderSecurityBuilderTests {
|
|||
return auth.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
abstract protected void configure(AuthenticationManagerBuilder auth) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ public class LdapAuthenticationProviderConfigurerTests {
|
|||
@EnableWebSecurity
|
||||
static class MultiLdapAuthenticationProvidersConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -106,6 +107,7 @@ public class LdapAuthenticationProviderConfigurerTests {
|
|||
@EnableWebSecurity
|
||||
static class MultiLdapWithCustomRolePrefixAuthenticationProvidersConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -146,6 +148,7 @@ public class LdapAuthenticationProviderConfigurerTests {
|
|||
@EnableWebSecurity
|
||||
static class GroupSubtreeSearchConfig extends BaseLdapProviderConfig {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
|
|
@ -31,6 +31,7 @@ public class NamespaceLdapAuthenticationProviderTestsConfigs {
|
|||
@EnableWebSecurity
|
||||
static class LdapAuthenticationProviderConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -45,6 +46,7 @@ public class NamespaceLdapAuthenticationProviderTestsConfigs {
|
|||
@EnableWebSecurity
|
||||
static class CustomLdapAuthenticationProviderConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -76,6 +78,7 @@ public class NamespaceLdapAuthenticationProviderTestsConfigs {
|
|||
|
||||
static LdapAuthoritiesPopulator LAP;
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
@ -90,6 +93,7 @@ public class NamespaceLdapAuthenticationProviderTestsConfigs {
|
|||
@EnableWebSecurity
|
||||
static class PasswordCompareLdapConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
// @formatter:off
|
||||
auth
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.springframework.security.config.debug.SecurityDebugBeanFactoryPostPro
|
|||
*/
|
||||
public class DebugBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
RootBeanDefinition debugPP = new RootBeanDefinition(SecurityDebugBeanFactoryPostProcessor.class);
|
||||
parserContext.getReaderContext().registerWithGeneratedName(debugPP);
|
||||
|
|
|
@ -91,6 +91,7 @@ public final class SecurityNamespaceHandler implements NamespaceHandler {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext pc) {
|
||||
if (!namespaceMatchesVersion(element)) {
|
||||
pc.getReaderContext().fatal(
|
||||
|
@ -121,6 +122,7 @@ public final class SecurityNamespaceHandler implements NamespaceHandler {
|
|||
return parser.parse(element, pc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext pc) {
|
||||
String name = pc.getDelegate().getLocalName(node);
|
||||
|
||||
|
@ -165,6 +167,7 @@ public final class SecurityNamespaceHandler implements NamespaceHandler {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
loadParsers();
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ public abstract class AbstractSecurityBuilder<O> implements SecurityBuilder<O> {
|
|||
*
|
||||
* @see org.springframework.security.config.annotation.SecurityBuilder#build()
|
||||
*/
|
||||
@Override
|
||||
public final O build() throws Exception {
|
||||
if (this.building.compareAndSet(false, true)) {
|
||||
this.object = doBuild();
|
||||
|
|
|
@ -39,9 +39,11 @@ public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>>
|
|||
|
||||
private CompositeObjectPostProcessor objectPostProcessor = new CompositeObjectPostProcessor();
|
||||
|
||||
@Override
|
||||
public void init(B builder) throws Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(B builder) throws Exception {
|
||||
}
|
||||
|
||||
|
@ -106,6 +108,7 @@ public abstract class SecurityConfigurerAdapter<O, B extends SecurityBuilder<O>>
|
|||
|
||||
private List<ObjectPostProcessor<?>> postProcessors = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public Object postProcess(Object object) {
|
||||
for (ObjectPostProcessor opp : this.postProcessors) {
|
||||
|
|
|
@ -212,6 +212,7 @@ public class AuthenticationManagerBuilder
|
|||
* @return a {@link AuthenticationManagerBuilder} to allow further authentication to
|
||||
* be provided to the {@link AuthenticationManagerBuilder}
|
||||
*/
|
||||
@Override
|
||||
public AuthenticationManagerBuilder authenticationProvider(AuthenticationProvider authenticationProvider) {
|
||||
this.authenticationProviders.add(authenticationProvider);
|
||||
return this;
|
||||
|
|
|
@ -33,9 +33,11 @@ import org.springframework.security.config.annotation.authentication.builders.Au
|
|||
public abstract class GlobalAuthenticationConfigurerAdapter
|
||||
implements SecurityConfigurer<AuthenticationManager, AuthenticationManagerBuilder> {
|
||||
|
||||
@Override
|
||||
public void init(AuthenticationManagerBuilder auth) throws Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ abstract class AbstractDaoAuthenticationConfigurer<B extends ProviderManagerBuil
|
|||
* @return the {@link UserDetailsService} that is used with the
|
||||
* {@link DaoAuthenticationProvider}
|
||||
*/
|
||||
@Override
|
||||
public U getUserDetailsService() {
|
||||
return this.userDetailsService;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ final class AutowireBeanFactoryObjectPostProcessor
|
|||
* org.springframework.security.config.annotation.web.Initializer#initialize(java.
|
||||
* lang.Object)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T postProcess(T object) {
|
||||
if (object == null) {
|
||||
|
@ -101,6 +102,7 @@ final class AutowireBeanFactoryObjectPostProcessor
|
|||
*
|
||||
* @see org.springframework.beans.factory.DisposableBean#destroy()
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
for (DisposableBean disposable : this.disposableBeans) {
|
||||
try {
|
||||
|
|
|
@ -43,6 +43,7 @@ class GlobalMethodSecurityAspectJAutoProxyRegistrar implements ImportBeanDefinit
|
|||
* of the @{@link EnableGlobalMethodSecurity#proxyTargetClass()} attribute on the
|
||||
* importing {@code @Configuration} class.
|
||||
*/
|
||||
@Override
|
||||
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
|
||||
|
||||
BeanDefinition interceptor = registry.getBeanDefinition("methodSecurityInterceptor");
|
||||
|
|
|
@ -91,6 +91,7 @@ public class GlobalMethodSecurityConfiguration implements ImportAware, SmartInit
|
|||
private static final Log logger = LogFactory.getLog(GlobalMethodSecurityConfiguration.class);
|
||||
|
||||
private ObjectPostProcessor<Object> objectPostProcessor = new ObjectPostProcessor<Object>() {
|
||||
@Override
|
||||
public <T> T postProcess(T object) {
|
||||
throw new IllegalStateException(ObjectPostProcessor.class.getName()
|
||||
+ " is a required bean. Ensure you have used @" + EnableGlobalMethodSecurity.class.getName());
|
||||
|
@ -402,6 +403,7 @@ public class GlobalMethodSecurityConfiguration implements ImportAware, SmartInit
|
|||
* Obtains the attributes from {@link EnableGlobalMethodSecurity} if this class was
|
||||
* imported using the {@link EnableGlobalMethodSecurity} annotation.
|
||||
*/
|
||||
@Override
|
||||
public final void setImportMetadata(AnnotationMetadata importMetadata) {
|
||||
Map<String, Object> annotationAttributes = importMetadata
|
||||
.getAnnotationAttributes(EnableGlobalMethodSecurity.class.getName());
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.springframework.util.ClassUtils;
|
|||
*/
|
||||
final class GlobalMethodSecuritySelector implements ImportSelector {
|
||||
|
||||
@Override
|
||||
public String[] selectImports(AnnotationMetadata importingClassMetadata) {
|
||||
Class<EnableGlobalMethodSecurity> annoType = EnableGlobalMethodSecurity.class;
|
||||
Map<String, Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(annoType.getName(),
|
||||
|
|
|
@ -39,6 +39,7 @@ class MethodSecurityMetadataSourceAdvisorRegistrar implements ImportBeanDefiniti
|
|||
* of the @{@link EnableGlobalMethodSecurity#proxyTargetClass()} attribute on the
|
||||
* importing {@code @Configuration} class.
|
||||
*/
|
||||
@Override
|
||||
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
|
||||
|
||||
BeanDefinitionBuilder advisor = BeanDefinitionBuilder
|
||||
|
|
|
@ -63,6 +63,7 @@ public enum PayloadInterceptorOrder implements Ordered {
|
|||
this.order = ordinal() * INTERVAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
|
|
@ -112,6 +112,7 @@ final class FilterComparator implements Comparator<Filter>, Serializable {
|
|||
put(SwitchUserFilter.class, order.next());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(Filter lhs, Filter rhs) {
|
||||
Integer left = getOrder(lhs.getClass());
|
||||
Integer right = getOrder(rhs.getClass());
|
||||
|
|
|
@ -239,6 +239,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* supported by <code>spring-security-oauth2</code>.
|
||||
* @see OpenIDLoginConfigurer
|
||||
*/
|
||||
@Deprecated
|
||||
public OpenIDLoginConfigurer<HttpSecurity> openidLogin() throws Exception {
|
||||
return getOrApply(new OpenIDLoginConfigurer<>());
|
||||
}
|
||||
|
@ -362,6 +363,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* supported by <code>spring-security-oauth2</code>.
|
||||
* @see OpenIDLoginConfigurer
|
||||
*/
|
||||
@Deprecated
|
||||
public HttpSecurity openidLogin(Customizer<OpenIDLoginConfigurer<HttpSecurity>> openidLoginCustomizer)
|
||||
throws Exception {
|
||||
openidLoginCustomizer.customize(getOrApply(new OpenIDLoginConfigurer<>()));
|
||||
|
@ -2507,6 +2509,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
return HttpSecurity.this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <C> void setSharedObject(Class<C> sharedType, C object) {
|
||||
super.setSharedObject(sharedType, object);
|
||||
}
|
||||
|
@ -2529,6 +2532,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* authenticationProvider
|
||||
* (org.springframework.security.authentication.AuthenticationProvider)
|
||||
*/
|
||||
@Override
|
||||
public HttpSecurity authenticationProvider(AuthenticationProvider authenticationProvider) {
|
||||
getAuthenticationRegistry().authenticationProvider(authenticationProvider);
|
||||
return this;
|
||||
|
@ -2541,6 +2545,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* userDetailsService
|
||||
* (org.springframework.security.core.userdetails.UserDetailsService)
|
||||
*/
|
||||
@Override
|
||||
public HttpSecurity userDetailsService(UserDetailsService userDetailsService) throws Exception {
|
||||
getAuthenticationRegistry().userDetailsService(userDetailsService);
|
||||
return this;
|
||||
|
@ -2556,6 +2561,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @see org.springframework.security.config.annotation.web.HttpSecurityBuilder#
|
||||
* addFilterAfter(javax .servlet.Filter, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public HttpSecurity addFilterAfter(Filter filter, Class<? extends Filter> afterFilter) {
|
||||
this.comparator.registerAfter(filter.getClass(), afterFilter);
|
||||
return addFilter(filter);
|
||||
|
@ -2567,6 +2573,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* @see org.springframework.security.config.annotation.web.HttpSecurityBuilder#
|
||||
* addFilterBefore( javax.servlet.Filter, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public HttpSecurity addFilterBefore(Filter filter, Class<? extends Filter> beforeFilter) {
|
||||
this.comparator.registerBefore(filter.getClass(), beforeFilter);
|
||||
return addFilter(filter);
|
||||
|
@ -2579,6 +2586,7 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
|
|||
* org.springframework.security.config.annotation.web.HttpSecurityBuilder#addFilter(
|
||||
* javax. servlet.Filter)
|
||||
*/
|
||||
@Override
|
||||
public HttpSecurity addFilter(Filter filter) {
|
||||
Class<? extends Filter> filterClass = filter.getClass();
|
||||
if (!this.comparator.isRegistered(filterClass)) {
|
||||
|
|
|
@ -35,6 +35,7 @@ class SpringWebMvcImportSelector implements ImportSelector {
|
|||
* @see org.springframework.context.annotation.ImportSelector#selectImports(org.
|
||||
* springframework .core.type.AnnotationMetadata)
|
||||
*/
|
||||
@Override
|
||||
public String[] selectImports(AnnotationMetadata importingClassMetadata) {
|
||||
boolean webmvcPresent = ClassUtils.isPresent("org.springframework.web.servlet.DispatcherServlet",
|
||||
getClass().getClassLoader());
|
||||
|
|
|
@ -227,6 +227,7 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
|
|||
* @see org.springframework.context.annotation.ImportAware#setImportMetadata(org.
|
||||
* springframework.core.type.AnnotationMetadata)
|
||||
*/
|
||||
@Override
|
||||
public void setImportMetadata(AnnotationMetadata importMetadata) {
|
||||
Map<String, Object> enableWebSecurityAttrMap = importMetadata
|
||||
.getAnnotationAttributes(EnableWebSecurity.class.getName());
|
||||
|
@ -244,6 +245,7 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
|
|||
* org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader(java.
|
||||
* lang.ClassLoader)
|
||||
*/
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
this.beanClassLoader = classLoader;
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ public abstract class WebSecurityConfigurerAdapter implements WebSecurityConfigu
|
|||
private ContentNegotiationStrategy contentNegotiationStrategy = new HeaderContentNegotiationStrategy();
|
||||
|
||||
private ObjectPostProcessor<Object> objectPostProcessor = new ObjectPostProcessor<Object>() {
|
||||
@Override
|
||||
public <T> T postProcess(T object) {
|
||||
throw new IllegalStateException(ObjectPostProcessor.class.getName()
|
||||
+ " is a required bean. Ensure you have used @EnableWebSecurity and @Configuration");
|
||||
|
@ -312,6 +313,7 @@ public abstract class WebSecurityConfigurerAdapter implements WebSecurityConfigu
|
|||
return new UserDetailsServiceDelegator(Arrays.asList(this.localConfigureAuthenticationBldr, globalAuthBuilder));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final WebSecurity web) throws Exception {
|
||||
final HttpSecurity http = getHttp();
|
||||
web.addSecurityFilterChainBuilder(http).postBuildAction(() -> {
|
||||
|
@ -331,6 +333,7 @@ public abstract class WebSecurityConfigurerAdapter implements WebSecurityConfigu
|
|||
* {@link #configure(HttpSecurity)} and the {@link HttpSecurity#authorizeRequests}
|
||||
* configuration method.
|
||||
*/
|
||||
@Override
|
||||
public void configure(WebSecurity web) throws Exception {
|
||||
}
|
||||
|
||||
|
@ -461,6 +464,7 @@ public abstract class WebSecurityConfigurerAdapter implements WebSecurityConfigu
|
|||
this.delegateBuilders = delegateBuilders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
if (this.delegate != null) {
|
||||
return this.delegate.loadUserByUsername(username);
|
||||
|
@ -514,6 +518,7 @@ public abstract class WebSecurityConfigurerAdapter implements WebSecurityConfigu
|
|||
this.delegateBuilder = delegateBuilder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
|
||||
if (this.delegate != null) {
|
||||
return this.delegate.authenticate(authentication);
|
||||
|
|
|
@ -69,6 +69,7 @@ public abstract class AbstractConfigAttributeRequestMatcherRegistry<C> extends A
|
|||
* @return the chained Object for the subclass which allows association of something
|
||||
* else to the {@link RequestMatcher}
|
||||
*/
|
||||
@Override
|
||||
protected final C chainRequestMatchers(List<RequestMatcher> requestMatchers) {
|
||||
this.unmappedMatchers = requestMatchers;
|
||||
return chainRequestMatchersInternal(requestMatchers);
|
||||
|
|
|
@ -64,6 +64,7 @@ final class PermitAllSupport {
|
|||
this.processUrl = processUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(HttpServletRequest request) {
|
||||
String uri = request.getRequestURI();
|
||||
String query = request.getQueryString();
|
||||
|
|
|
@ -108,6 +108,7 @@ public final class UrlAuthorizationConfigurer<H extends HttpSecurityBuilder<H>>
|
|||
* @param objectPostProcessor
|
||||
* @return the {@link UrlAuthorizationConfigurer} for further customizations
|
||||
*/
|
||||
@Override
|
||||
public UrlAuthorizationConfigurer<H> withObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor) {
|
||||
addObjectPostProcessor(objectPostProcessor);
|
||||
return this;
|
||||
|
|
|
@ -124,6 +124,7 @@ import org.springframework.security.web.util.matcher.RequestMatcher;
|
|||
* migrate</a> to <a href="https://openid.net/connect/">OpenID Connect</a>, which is
|
||||
* supported by <code>spring-security-oauth2</code>.
|
||||
*/
|
||||
@Deprecated
|
||||
public final class OpenIDLoginConfigurer<H extends HttpSecurityBuilder<H>>
|
||||
extends AbstractAuthenticationFilterConfigurer<H, OpenIDLoginConfigurer<H>, OpenIDAuthenticationFilter> {
|
||||
|
||||
|
|
|
@ -417,6 +417,7 @@ public class MessageSecurityMetadataSourceRegistry {
|
|||
this.matcher = matcher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageMatcher<?> build() {
|
||||
return this.matcher;
|
||||
}
|
||||
|
@ -434,6 +435,7 @@ public class MessageSecurityMetadataSourceRegistry {
|
|||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageMatcher<?> build() {
|
||||
if (this.type == null) {
|
||||
return new SimpDestinationMessageMatcher(this.pattern,
|
||||
|
@ -462,30 +464,37 @@ public class MessageSecurityMetadataSourceRegistry {
|
|||
|
||||
private PathMatcher delegate = new AntPathMatcher();
|
||||
|
||||
@Override
|
||||
public boolean isPattern(String path) {
|
||||
return this.delegate.isPattern(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(String pattern, String path) {
|
||||
return this.delegate.match(pattern, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchStart(String pattern, String path) {
|
||||
return this.delegate.matchStart(pattern, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String extractPathWithinPattern(String pattern, String path) {
|
||||
return this.delegate.extractPathWithinPattern(pattern, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> extractUriTemplateVariables(String pattern, String path) {
|
||||
return this.delegate.extractUriTemplateVariables(pattern, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comparator<String> getPatternComparator(String path) {
|
||||
return this.delegate.getPatternComparator(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String combine(String pattern1, String pattern2) {
|
||||
return this.delegate.combine(pattern1, pattern2);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.springframework.web.servlet.support.RequestDataValueProcessor;
|
|||
* @author Rob Winch
|
||||
* @since 3.2
|
||||
*/
|
||||
@Deprecated
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableWebSecurity
|
||||
public class WebMvcSecurityConfiguration implements WebMvcConfigurer {
|
||||
|
|
|
@ -93,6 +93,7 @@ public abstract class AbstractSecurityWebSocketMessageBrokerConfigurer extends A
|
|||
|
||||
private ApplicationContext context;
|
||||
|
||||
@Override
|
||||
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||
}
|
||||
|
||||
|
@ -233,6 +234,7 @@ public abstract class AbstractSecurityWebSocketMessageBrokerConfigurer extends A
|
|||
return this.expressionHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterSingletonsInstantiated() {
|
||||
if (sameOriginDisabled()) {
|
||||
return;
|
||||
|
|
|
@ -43,6 +43,7 @@ public abstract class AbstractUserDetailsServiceBeanDefinitionParser implements
|
|||
|
||||
protected abstract void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder);
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(getBeanClassName(element));
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ public class AuthenticationManagerBeanDefinitionParser implements BeanDefinition
|
|||
|
||||
private static final String ATT_ERASE_CREDENTIALS = "erase-credentials";
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext pc) {
|
||||
String id = element.getAttribute("id");
|
||||
|
||||
|
@ -148,10 +149,12 @@ public class AuthenticationManagerBeanDefinitionParser implements BeanDefinition
|
|||
*/
|
||||
public static final class NullAuthenticationProvider implements AuthenticationProvider {
|
||||
|
||||
@Override
|
||||
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> authentication) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public class AuthenticationManagerFactoryBean implements FactoryBean<Authenticat
|
|||
+ "to your configuration (with child <authentication-provider> elements)? Alternatively you can use the "
|
||||
+ "authentication-manager-ref attribute on your <http> and <global-method-security> elements.";
|
||||
|
||||
@Override
|
||||
public AuthenticationManager getObject() throws Exception {
|
||||
try {
|
||||
return (AuthenticationManager) this.bf.getBean(BeanIds.AUTHENTICATION_MANAGER);
|
||||
|
@ -71,14 +72,17 @@ public class AuthenticationManagerFactoryBean implements FactoryBean<Authenticat
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends AuthenticationManager> getObjectType() {
|
||||
return ProviderManager.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.bf = beanFactory;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ public class AuthenticationProviderBeanDefinitionParser implements BeanDefinitio
|
|||
|
||||
private static final String ATT_USER_DETAILS_REF = "user-service-ref";
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext pc) {
|
||||
RootBeanDefinition authProvider = new RootBeanDefinition(DaoAuthenticationProvider.class);
|
||||
authProvider.setSource(pc.extractSource(element));
|
||||
|
|
|
@ -33,10 +33,12 @@ public class JdbcUserServiceBeanDefinitionParser extends AbstractUserDetailsServ
|
|||
static final String ATT_GROUP_AUTHORITIES_QUERY = "group-authorities-by-username-query";
|
||||
static final String ATT_ROLE_PREFIX = "role-prefix";
|
||||
|
||||
@Override
|
||||
protected String getBeanClassName(Element element) {
|
||||
return "org.springframework.security.provisioning.JdbcUserDetailsManager";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
|
||||
String dataSource = element.getAttribute(ATT_DATA_SOURCE);
|
||||
|
||||
|
|
|
@ -51,10 +51,12 @@ public class UserServiceBeanDefinitionParser extends AbstractUserDetailsServiceB
|
|||
|
||||
private SecureRandom random;
|
||||
|
||||
@Override
|
||||
protected String getBeanClassName(Element element) {
|
||||
return InMemoryUserDetailsManager.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
|
||||
String userProperties = element.getAttribute(ATT_PROPERTIES);
|
||||
|
|
|
@ -35,6 +35,7 @@ public class SecurityDebugBeanFactoryPostProcessor implements BeanDefinitionRegi
|
|||
|
||||
private final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
@Override
|
||||
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
|
||||
this.logger.warn("\n\n" + "********************************************************************\n"
|
||||
+ "********** Security debugging is enabled. *************\n"
|
||||
|
@ -55,6 +56,7 @@ public class SecurityDebugBeanFactoryPostProcessor implements BeanDefinitionRegi
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||
}
|
||||
|
||||
|
|
|
@ -457,6 +457,7 @@ final class AuthenticationConfigBuilder {
|
|||
* migrate</a> to <a href="https://openid.net/connect/">OpenID Connect</a>, which is
|
||||
* supported by <code>spring-security-oauth2</code>.
|
||||
*/
|
||||
@Deprecated
|
||||
private RootBeanDefinition parseOpenIDFilter(BeanReference sessionStrategy, Element openIDLoginElt) {
|
||||
RootBeanDefinition openIDFilter;
|
||||
FormLoginBeanDefinitionParser parser = new FormLoginBeanDefinitionParser("/login/openid", null,
|
||||
|
|
|
@ -51,6 +51,7 @@ public class DefaultFilterChainValidator implements FilterChainProxy.FilterChain
|
|||
|
||||
private final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
@Override
|
||||
public void validate(FilterChainProxy fcp) {
|
||||
for (SecurityFilterChain filterChain : fcp.getFilterChains()) {
|
||||
checkLoginPageIsntProtected(fcp, filterChain.getFilters());
|
||||
|
|
|
@ -36,6 +36,7 @@ public class FilterChainBeanDefinitionParser implements BeanDefinitionParser {
|
|||
|
||||
private static final String ATT_REQUEST_MATCHER_REF = "request-matcher-ref";
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element elt, ParserContext pc) {
|
||||
MatcherType matcherType = MatcherType.fromElement(elt);
|
||||
String path = elt.getAttribute(HttpSecurityBeanDefinitionParser.ATT_PATH_PATTERN);
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.springframework.util.xml.DomUtils;
|
|||
*/
|
||||
public class FilterChainMapBeanDefinitionDecorator implements BeanDefinitionDecorator {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder holder, ParserContext parserContext) {
|
||||
BeanDefinition filterChainProxy = holder.getBeanDefinition();
|
||||
|
|
|
@ -62,6 +62,7 @@ public class FilterInvocationSecurityMetadataSourceParser implements BeanDefinit
|
|||
|
||||
private static final Log logger = LogFactory.getLog(FilterInvocationSecurityMetadataSourceParser.class);
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
List<Element> interceptUrls = DomUtils.getChildElementsByTagName(element, Elements.INTERCEPT_URL);
|
||||
|
||||
|
@ -223,6 +224,7 @@ public class FilterInvocationSecurityMetadataSourceParser implements BeanDefinit
|
|||
|
||||
private DefaultWebSecurityExpressionHandler handler = new DefaultWebSecurityExpressionHandler();
|
||||
|
||||
@Override
|
||||
public DefaultWebSecurityExpressionHandler getBean() {
|
||||
this.handler.setDefaultRolePrefix(this.rolePrefix);
|
||||
return this.handler;
|
||||
|
|
|
@ -38,6 +38,7 @@ class HandlerMappingIntrospectorFactoryBean
|
|||
|
||||
private ApplicationContext context;
|
||||
|
||||
@Override
|
||||
public HandlerMappingIntrospector getObject() {
|
||||
if (!this.context.containsBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME)) {
|
||||
throw new NoSuchBeanDefinitionException(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME, "A Bean named "
|
||||
|
|
|
@ -123,6 +123,7 @@ public class HeadersBeanDefinitionParser implements BeanDefinitionParser {
|
|||
|
||||
private ManagedList<BeanMetadataElement> headerWriters;
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
|
||||
this.headerWriters = new ManagedList<>();
|
||||
|
|
|
@ -855,6 +855,7 @@ class HttpConfigurationBuilder {
|
|||
|
||||
private RoleVoter voter = new RoleVoter();
|
||||
|
||||
@Override
|
||||
public RoleVoter getBean() {
|
||||
this.voter.setRolePrefix(this.rolePrefix);
|
||||
return this.voter;
|
||||
|
@ -867,6 +868,7 @@ class HttpConfigurationBuilder {
|
|||
|
||||
private SecurityContextHolderAwareRequestFilter filter = new SecurityContextHolderAwareRequestFilter();
|
||||
|
||||
@Override
|
||||
public SecurityContextHolderAwareRequestFilter getBean() {
|
||||
this.filter.setRolePrefix(this.rolePrefix);
|
||||
return this.filter;
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.springframework.util.StringUtils;
|
|||
*/
|
||||
public class HttpFirewallBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext pc) {
|
||||
String ref = element.getAttribute("ref");
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ class LogoutBeanDefinitionParser implements BeanDefinitionParser {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext pc) {
|
||||
String logoutUrl = null;
|
||||
String successHandlerRef = null;
|
||||
|
|
|
@ -42,6 +42,7 @@ class PortMappingsBeanDefinitionParser implements BeanDefinitionParser {
|
|||
|
||||
public static final String ATT_HTTPS_PORT = "https";
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
RootBeanDefinition portMapper = new RootBeanDefinition(PortMapperImpl.class);
|
||||
|
|
|
@ -67,6 +67,7 @@ class RememberMeBeanDefinitionParser implements BeanDefinitionParser {
|
|||
this.authenticationManager = authenticationManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext pc) {
|
||||
CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(),
|
||||
pc.extractSource(element));
|
||||
|
|
|
@ -126,6 +126,7 @@ public class UserDetailsServiceFactoryBean implements ApplicationContextAware {
|
|||
return (UserDetailsService) beans.values().toArray()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext beanFactory) throws BeansException {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ class ContextSourceSettingPostProcessor implements BeanFactoryPostProcessor, Ord
|
|||
*/
|
||||
private boolean defaultNameRequired;
|
||||
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory bf) throws BeansException {
|
||||
Class<?> contextSourceClass;
|
||||
|
||||
|
@ -80,6 +81,7 @@ class ContextSourceSettingPostProcessor implements BeanFactoryPostProcessor, Ord
|
|||
this.defaultNameRequired = defaultNameRequired;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return LOWEST_PRECEDENCE;
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ public class LdapProviderBeanDefinitionParser implements BeanDefinitionParser {
|
|||
static final String BIND_AUTH_CLASS = "org.springframework.security.ldap.authentication.BindAuthenticator";
|
||||
static final String PASSWD_AUTH_CLASS = "org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator";
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element elt, ParserContext parserContext) {
|
||||
RuntimeBeanReference contextSource = LdapUserServiceBeanDefinitionParser.parseServerReference(elt,
|
||||
parserContext);
|
||||
|
|
|
@ -85,6 +85,7 @@ public class LdapServerBeanDefinitionParser implements BeanDefinitionParser {
|
|||
|
||||
private static final String UNBOUNDID_CONTAINER_CLASSNAME = "org.springframework.security.ldap.server.UnboundIdContainer";
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element elt, ParserContext parserContext) {
|
||||
String url = elt.getAttribute(ATT_URL);
|
||||
|
||||
|
|
|
@ -68,10 +68,12 @@ public class LdapUserServiceBeanDefinitionParser extends AbstractUserDetailsServ
|
|||
|
||||
public static final String LDAP_AUTHORITIES_POPULATOR_CLASS = "org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator";
|
||||
|
||||
@Override
|
||||
protected String getBeanClassName(Element element) {
|
||||
return "org.springframework.security.ldap.userdetails.LdapUserDetailsService";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doParse(Element elt, ParserContext parserContext, BeanDefinitionBuilder builder) {
|
||||
|
||||
if (!StringUtils.hasText(elt.getAttribute(ATT_USER_SEARCH_FILTER))) {
|
||||
|
|
|
@ -123,6 +123,7 @@ public class GlobalMethodSecurityBeanDefinitionParser implements BeanDefinitionP
|
|||
|
||||
private static final String ATT_META_DATA_SOURCE_REF = "metadata-source-ref";
|
||||
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext pc) {
|
||||
CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(),
|
||||
pc.extractSource(element));
|
||||
|
@ -485,6 +486,7 @@ public class GlobalMethodSecurityBeanDefinitionParser implements BeanDefinitionP
|
|||
this.authMgrBean = StringUtils.hasText(authMgrBean) ? authMgrBean : BeanIds.AUTHENTICATION_MANAGER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
|
||||
synchronized (this.delegateMonitor) {
|
||||
if (this.delegate == null) {
|
||||
|
@ -506,6 +508,7 @@ public class GlobalMethodSecurityBeanDefinitionParser implements BeanDefinitionP
|
|||
return this.delegate.authenticate(authentication);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
|
@ -567,6 +570,7 @@ public class GlobalMethodSecurityBeanDefinitionParser implements BeanDefinitionP
|
|||
this.beanName = beanName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
|
||||
if (!registry.containsBeanDefinition(this.beanName)) {
|
||||
return;
|
||||
|
@ -575,6 +579,7 @@ public class GlobalMethodSecurityBeanDefinitionParser implements BeanDefinitionP
|
|||
beanDefinition.setLazyInit(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.springframework.aop.config.AbstractInterceptorDrivenBeanDefinitionDec
|
|||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanDefinitionHolder;
|
||||
import org.springframework.beans.factory.config.RuntimeBeanReference;
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.ManagedMap;
|
||||
import org.springframework.beans.factory.support.RootBeanDefinition;
|
||||
|
@ -47,6 +48,7 @@ public class InterceptMethodsBeanDefinitionDecorator implements BeanDefinitionDe
|
|||
|
||||
private final BeanDefinitionDecorator delegate = new InternalInterceptMethodsBeanDefinitionDecorator();
|
||||
|
||||
@Override
|
||||
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) {
|
||||
MethodConfigUtils.registerDefaultMethodAccessManagerIfNecessary(parserContext);
|
||||
|
||||
|
@ -66,12 +68,13 @@ class InternalInterceptMethodsBeanDefinitionDecorator extends AbstractIntercepto
|
|||
|
||||
private static final String ATT_ACCESS_MGR = "access-decision-manager-ref";
|
||||
|
||||
@Override
|
||||
protected BeanDefinition createInterceptorDefinition(Node node) {
|
||||
Element interceptMethodsElt = (Element) node;
|
||||
BeanDefinitionBuilder interceptor = BeanDefinitionBuilder.rootBeanDefinition(MethodSecurityInterceptor.class);
|
||||
|
||||
// Default to autowiring to pick up after invocation mgr
|
||||
interceptor.setAutowireMode(RootBeanDefinition.AUTOWIRE_BY_TYPE);
|
||||
interceptor.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
|
||||
|
||||
String accessManagerId = interceptMethodsElt.getAttribute(ATT_ACCESS_MGR);
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ public class MethodSecurityMetadataSourceBeanDefinitionParser extends AbstractBe
|
|||
static final String ATT_METHOD = "method";
|
||||
static final String ATT_ACCESS = "access";
|
||||
|
||||
@Override
|
||||
public AbstractBeanDefinition parseInternal(Element elt, ParserContext pc) {
|
||||
// Parse the included methods
|
||||
List<Element> methods = DomUtils.getChildElementsByTagName(elt, Elements.PROTECT);
|
||||
|
|
|
@ -99,10 +99,12 @@ final class ProtectPointcutPostProcessor implements BeanPostProcessor {
|
|||
supportedPrimitives);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (this.processedBeans.contains(beanName)) {
|
||||
// We already have the metadata for this bean
|
||||
|
|
|
@ -113,6 +113,7 @@ public final class WebSocketMessageBrokerSecurityBeanDefinitionParser implements
|
|||
* @param parserContext
|
||||
* @return the {@link BeanDefinition}
|
||||
*/
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
BeanDefinitionRegistry registry = parserContext.getRegistry();
|
||||
XmlReaderContext context = parserContext.getReaderContext();
|
||||
|
@ -234,6 +235,7 @@ public final class WebSocketMessageBrokerSecurityBeanDefinitionParser implements
|
|||
this.sameOriginDisabled = sameOriginDisabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
|
||||
String[] beanNames = registry.getBeanDefinitionNames();
|
||||
for (String beanName : beanNames) {
|
||||
|
@ -307,6 +309,7 @@ public final class WebSocketMessageBrokerSecurityBeanDefinitionParser implements
|
|||
bd.getPropertyValues().add(interceptorPropertyName, interceptors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
|
||||
|
||||
}
|
||||
|
@ -317,30 +320,37 @@ public final class WebSocketMessageBrokerSecurityBeanDefinitionParser implements
|
|||
|
||||
private PathMatcher delegate = new AntPathMatcher();
|
||||
|
||||
@Override
|
||||
public boolean isPattern(String path) {
|
||||
return this.delegate.isPattern(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(String pattern, String path) {
|
||||
return this.delegate.match(pattern, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchStart(String pattern, String path) {
|
||||
return this.delegate.matchStart(pattern, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String extractPathWithinPattern(String pattern, String path) {
|
||||
return this.delegate.extractPathWithinPattern(pattern, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> extractUriTemplateVariables(String pattern, String path) {
|
||||
return this.delegate.extractUriTemplateVariables(pattern, path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comparator<String> getPatternComparator(String path) {
|
||||
return this.delegate.getPatternComparator(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String combine(String pattern1, String pattern2) {
|
||||
return this.delegate.combine(pattern1, pattern2);
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ public class BeanNameCollectingPostProcessor implements BeanPostProcessor {
|
|||
|
||||
Set<String> afterInitPostProcessedBeans = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (beanName != null) {
|
||||
this.beforeInitPostProcessedBeans.add(beanName);
|
||||
|
@ -37,6 +38,7 @@ public class BeanNameCollectingPostProcessor implements BeanPostProcessor {
|
|||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (beanName != null) {
|
||||
this.afterInitPostProcessedBeans.add(beanName);
|
||||
|
|
|
@ -40,6 +40,7 @@ public class CollectingAppListener implements ApplicationListener {
|
|||
|
||||
Set<AbstractAuthorizationEvent> authorizationEvents = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent event) {
|
||||
if (event instanceof AbstractAuthenticationEvent) {
|
||||
this.events.add(event);
|
||||
|
|
|
@ -30,6 +30,7 @@ public class DataSourcePopulator implements InitializingBean {
|
|||
|
||||
JdbcTemplate template;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
Assert.notNull(this.template, "dataSource required");
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue