1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Remove PrePostTemplateDefaults

Closes gh-17296

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
Tran Ngoc Nhan
2025-06-20 00:41:59 +07:00
committed by Josh Cummings
parent 21036c94b4
commit d8043dc8a7
14 changed files with 22 additions and 270 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,13 +77,6 @@ abstract class AbstractExpressionAttributeRegistry<T extends ExpressionAttribute
this.expressionHandler = expressionHandler;
}
@Deprecated
void setTemplateDefaults(PrePostTemplateDefaults defaults) {
AnnotationTemplateExpressionDefaults adapter = new AnnotationTemplateExpressionDefaults();
adapter.setIgnoreUnknown(defaults.isIgnoreUnknown());
setTemplateDefaults(adapter);
}
abstract void setTemplateDefaults(AnnotationTemplateExpressionDefaults adapter);
/**
@@ -51,21 +51,6 @@ public final class PostAuthorizeAuthorizationManager
this.registry.setExpressionHandler(expressionHandler);
}
/**
* Configure pre/post-authorization template resolution
* <p>
* By default, this value is <code>null</code>, which indicates that templates should
* not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3
* @deprecated Please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)} instead
*/
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults);
}
/**
* Configure pre/post-authorization template resolution
* <p>
@@ -52,21 +52,6 @@ public final class PostAuthorizeReactiveAuthorizationManager
this.registry.setExpressionHandler(expressionHandler);
}
/**
* Configure pre/post-authorization template resolution
* <p>
* By default, this value is <code>null</code>, which indicates that templates should
* not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3
* @deprecated please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)}
*/
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults);
}
/**
* Configure pre/post-authorization template resolution
* <p>
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,20 +67,6 @@ public final class PostFilterAuthorizationMethodInterceptor implements Authoriza
this.registry.setExpressionHandler(expressionHandler);
}
/**
* Configure pre/post-authorization template resolution
* <p>
* By default, this value is <code>null</code>, which indicates that templates should
* not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3
* @deprecated Please use {@link AnnotationTemplateExpressionDefaults} instead
*/
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults);
}
/**
* Configure pre/post-authorization template resolution
* <p>
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,21 +67,6 @@ public final class PostFilterAuthorizationReactiveMethodInterceptor implements A
this.registry.setExpressionHandler(expressionHandler);
}
/**
* Configure pre/post-authorization template resolution
* <p>
* By default, this value is <code>null</code>, which indicates that templates should
* not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3
* @deprecated please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)}
*/
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults);
}
/**
* Configure pre/post-authorization template resolution
* <p>
@@ -51,21 +51,6 @@ public final class PreAuthorizeAuthorizationManager
this.registry.setExpressionHandler(expressionHandler);
}
/**
* Configure pre/post-authorization template resolution
* <p>
* By default, this value is <code>null</code>, which indicates that templates should
* not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3
* @deprecated Please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)} instead
*/
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults);
}
/**
* Configure pre/post-authorization template resolution
* <p>
@@ -51,21 +51,6 @@ public final class PreAuthorizeReactiveAuthorizationManager
this.registry.setExpressionHandler(expressionHandler);
}
/**
* Configure pre/post-authorization template resolution
* <p>
* By default, this value is <code>null</code>, which indicates that templates should
* not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3
* @deprecated please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)}
*/
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults);
}
/**
* Configure pre/post-authorization template resolution
* <p>
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,21 +68,6 @@ public final class PreFilterAuthorizationMethodInterceptor implements Authorizat
this.registry.setExpressionHandler(expressionHandler);
}
/**
* Configure pre/post-authorization template resolution
* <p>
* By default, this value is <code>null</code>, which indicates that templates should
* not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3
* @deprecated Please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)} instead
*/
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults);
}
/**
* Configure pre/post-authorization template resolution
* <p>
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,21 +70,6 @@ public final class PreFilterAuthorizationReactiveMethodInterceptor implements Au
this.registry.setExpressionHandler(expressionHandler);
}
/**
* Configure pre/post-authorization template resolution
* <p>
* By default, this value is <code>null</code>, which indicates that templates should
* not be resolved.
* @param defaults - whether to resolve pre/post-authorization templates parameters
* @since 6.3
* @deprecated please use
* {@link #setTemplateDefaults(AnnotationTemplateExpressionDefaults)}
*/
@Deprecated
public void setTemplateDefaults(PrePostTemplateDefaults defaults) {
this.registry.setTemplateDefaults(defaults);
}
/**
* Configure pre/post-authorization template resolution
* <p>
@@ -1,58 +0,0 @@
/*
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.authorization.method;
import org.springframework.security.core.annotation.AnnotationTemplateExpressionDefaults;
/**
* A component for configuring various cross-cutting aspects of pre/post method security
*
* @author Josh Cummings
* @since 6.3
* @see org.springframework.security.access.prepost.PreAuthorize
* @see org.springframework.security.access.prepost.PostAuthorize
* @see org.springframework.security.access.prepost.PreFilter
* @see org.springframework.security.access.prepost.PostFilter
* @deprecated Please use {@link AnnotationTemplateExpressionDefaults} instead
*/
@Deprecated
public final class PrePostTemplateDefaults {
private boolean ignoreUnknown = true;
/**
* Whether template resolution should ignore placeholders it doesn't recognize.
* <p>
* By default, this value is <code>true</code>.
*/
public boolean isIgnoreUnknown() {
return this.ignoreUnknown;
}
/**
* Configure template resolution to ignore unknown placeholders. When set to
* <code>false</code>, template resolution will throw an exception for unknown
* placeholders.
* <p>
* By default, this value is <code>true</code>.
* @param ignoreUnknown - whether to ignore unknown placeholders parameters
*/
public void setIgnoreUnknown(boolean ignoreUnknown) {
this.ignoreUnknown = ignoreUnknown;
}
}