クラス AbstractSecurityInterceptor
- java.lang.Object
-
- org.springframework.security.access.intercept.AbstractSecurityInterceptor
- 実装済みのインターフェース一覧:
org.springframework.beans.factory.Aware、org.springframework.beans.factory.InitializingBean、org.springframework.context.ApplicationEventPublisherAware、org.springframework.context.MessageSourceAware
@Deprecated public abstract class AbstractSecurityInterceptor extends java.lang.Object implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.MessageSourceAware使用すべきではありません。代わりに、フィルターセキュリティにはAuthorizationFilterを、メッセージングセキュリティにはAuthorizationChannelInterceptorを、メソッドセキュリティにはAuthorizationManagerBeforeMethodInterceptorとAuthorizationManagerAfterMethodInterceptorを使用してください。セキュアオブジェクトのセキュリティインターセプトを実装する抽象クラス。AbstractSecurityInterceptorは、セキュリティインターセプタの適切な起動設定を保証します。また、安全なオブジェクト呼び出しの適切な処理も実装します。SecurityContextHolderからAuthenticationオブジェクトを取得します。SecurityMetadataSourceに対してセキュアオブジェクトリクエストを検索して、リクエストがセキュアな呼び出しに関連するのか、パブリックな呼び出しに関連するのかを判断します。- 保護された呼び出しの場合(保護されたオブジェクト呼び出し用の
ConfigAttributeのリストがあります):Authentication.isAuthenticated()がfalseを返す場合、またはalwaysReauthenticateがtrueである場合は、構成されたAuthenticationManagerに対してリクエストを認証します。認証されたら、SecurityContextHolderのAuthenticationオブジェクトを戻り値に置き換えます。- 構成された
AccessDecisionManagerに対してリクエストを承認します。 - 構成された
RunAsManagerを介して run-as 置換を実行します。 - 実際のオブジェクトの実行を続行する具象サブクラスに制御を渡します。
InterceptorStatusTokenが返されるため、サブクラスがオブジェクトの実行を続行した後、finally 句を使用すると、AbstractSecurityInterceptorが確実に再呼び出しされ、finallyInvocation(InterceptorStatusToken)を使用して正しく整理されます。 - 具象サブクラスは、
afterInvocation(InterceptorStatusToken, Object)メソッドを介してAbstractSecurityInterceptorを再度呼び出します。 RunAsManagerがAuthenticationオブジェクトを置き換えた場合は、SecurityContextHolderを、AuthenticationManagerの呼び出し後に存在していたオブジェクトに戻します。AfterInvocationManagerが定義されている場合は、呼び出しマネージャーを呼び出し、呼び出し元に返されるため、オブジェクトを置き換えられるようにします。
- パブリックな呼び出しの場合(セキュアオブジェクト呼び出し用の
ConfigAttributeはありません):- 上記のように、具象サブクラスは
InterceptorStatusTokenが返され、セキュアオブジェクトが実行された後にAbstractSecurityInterceptorに再提示されます。afterInvocation(InterceptorStatusToken, Object)が呼び出されても、AbstractSecurityInterceptorはそれ以上のアクションを実行しません。
- 上記のように、具象サブクラスは
- コントロールは、呼び出し元に返される
Objectと共に、具象サブクラスに再び戻ります。次に、サブクラスはその結果または例外を元の呼び出し元に返します。
コンストラクター概要
コンストラクター コンストラクター 説明 AbstractSecurityInterceptor()使用すべきではありません。
方法の概要
すべてのメソッド インスタンスメソッド 抽象メソッド 具象メソッド 非推奨のメソッド 修飾子と型 メソッド 説明 protected java.lang.ObjectafterInvocation(InterceptorStatusToken token, java.lang.Object returnedObject)使用すべきではありません。セキュアオブジェクトの呼び出しが完了した後、 AbstractSecurityInterceptor の作業を完了します。voidafterPropertiesSet()使用すべきではありません。protected InterceptorStatusTokenbeforeInvocation(java.lang.Object object)使用すべきではありません。protected voidfinallyInvocation(InterceptorStatusToken token)使用すべきではありません。セキュアオブジェクトの呼び出しが完了した後、 AbstractSecurityInterceptor の作業をクリーンアップします。AccessDecisionManagergetAccessDecisionManager()使用すべきではありません。AfterInvocationManagergetAfterInvocationManager()使用すべきではありません。AuthenticationManagergetAuthenticationManager()使用すべきではありません。RunAsManagergetRunAsManager()使用すべきではありません。abstract java.lang.Class<?>getSecureObjectClass()使用すべきではありません。サブクラスが処理のために抽象親に提示するセキュアオブジェクトの型を示します。booleanisAlwaysReauthenticate()使用すべきではありません。booleanisRejectPublicInvocations()使用すべきではありません。booleanisValidateConfigAttributes()使用すべきではありません。abstract SecurityMetadataSourceobtainSecurityMetadataSource()使用すべきではありません。voidsetAccessDecisionManager(AccessDecisionManager accessDecisionManager)使用すべきではありません。voidsetAfterInvocationManager(AfterInvocationManager afterInvocationManager)使用すべきではありません。voidsetAlwaysReauthenticate(boolean alwaysReauthenticate)使用すべきではありません。AbstractSecurityInterceptorがAuthentication.isAuthenticated()プロパティを無視するかどうかを示します。voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)使用すべきではありません。voidsetAuthenticationManager(AuthenticationManager newManager)使用すべきではありません。voidsetMessageSource(org.springframework.context.MessageSource messageSource)使用すべきではありません。voidsetPublishAuthorizationSuccess(boolean publishAuthorizationSuccess)使用すべきではありません。AuthorizationFailureEventのみが公開されます。voidsetRejectPublicInvocations(boolean rejectPublicInvocations)使用すべきではありません。公開呼び出しを拒否する(およびこのプロパティを true に設定する)ことにより、AbstractSecurityInterceptorによって通知されたすべてのセキュアオブジェクト呼び出しに構成属性が定義されていることを確認できます。voidsetRunAsManager(RunAsManager runAsManager)使用すべきではありません。voidsetSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy)使用すべきではありません。使用するSecurityContextHolderStrategyを設定します。voidsetValidateConfigAttributes(boolean validateConfigAttributes)使用すべきではありません。
メソッドの詳細
afterPropertiesSet
public void afterPropertiesSet()
使用すべきではありません。- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBean内のafterPropertiesSet
beforeInvocation
protected InterceptorStatusToken beforeInvocation(java.lang.Object object)
使用すべきではありません。
finallyInvocation
protected void finallyInvocation(InterceptorStatusToken token)
使用すべきではありません。セキュアオブジェクトの呼び出しが完了した後、AbstractSecurityInterceptor の作業をクリーンアップします。このメソッドは、セキュアオブジェクトの呼び出しが正常に返されるかどうかに関係なく、セキュアオブジェクトの呼び出し後、afterInvocation の前に呼び出す必要があります (つまり、finally ブロックで実行する必要があります)。- パラメーター:
token-beforeInvocation(Object)メソッドによって返される
afterInvocation
protected java.lang.Object afterInvocation(InterceptorStatusToken token, java.lang.Object returnedObject)
使用すべきではありません。セキュアオブジェクトの呼び出しが完了した後、 AbstractSecurityInterceptor の作業を完了します。- パラメーター:
token-beforeInvocation(Object)メソッドによって返されるreturnedObject- セキュアオブジェクト呼び出しから返されたオブジェクト ( null の可能性があります)- 戻り値:
- 安全なオブジェクト呼び出しが最終的にその呼び出し元に返すべきオブジェクト ( null の可能性があります)
getAccessDecisionManager
public AccessDecisionManager getAccessDecisionManager()
使用すべきではありません。
getAfterInvocationManager
public AfterInvocationManager getAfterInvocationManager()
使用すべきではありません。
getAuthenticationManager
public AuthenticationManager getAuthenticationManager()
使用すべきではありません。
getRunAsManager
public RunAsManager getRunAsManager()
使用すべきではありません。
getSecureObjectClass
public abstract java.lang.Class<?> getSecureObjectClass()
使用すべきではありません。サブクラスが処理のために抽象親に提示するセキュアオブジェクトの型を示します。これは、AbstractSecurityInterceptorに接続されたコラボレーターがすべて、指定されたセキュアオブジェクトクラスをサポートするようにするために使用されます。- 戻り値:
- サブクラスがサービスを提供する安全なオブジェクトの型
isAlwaysReauthenticate
public boolean isAlwaysReauthenticate()
使用すべきではありません。
isRejectPublicInvocations
public boolean isRejectPublicInvocations()
使用すべきではありません。
isValidateConfigAttributes
public boolean isValidateConfigAttributes()
使用すべきではありません。
obtainSecurityMetadataSource
public abstract SecurityMetadataSource obtainSecurityMetadataSource()
使用すべきではありません。
setSecurityContextHolderStrategy
public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy)
使用すべきではありません。使用するSecurityContextHolderStrategyを設定します。デフォルトのアクションは、SecurityContextHolderに格納されているSecurityContextHolderStrategyを使用することです。- 導入:
- 5.8
setAccessDecisionManager
public void setAccessDecisionManager(AccessDecisionManager accessDecisionManager)
使用すべきではありません。
setAfterInvocationManager
public void setAfterInvocationManager(AfterInvocationManager afterInvocationManager)
使用すべきではありません。
setAlwaysReauthenticate
public void setAlwaysReauthenticate(boolean alwaysReauthenticate)
使用すべきではありません。AbstractSecurityInterceptorがAuthentication.isAuthenticated()プロパティを無視するかどうかを示します。デフォルトはfalseです。つまり、デフォルトでAuthentication.isAuthenticated()プロパティは信頼され、プリンシパルがすでに認証されている場合は再認証は行われません。- パラメーター:
alwaysReauthenticate-trueは、AbstractSecurityInterceptorにAuthentication.isAuthenticated()の値を無視させ、常にリクエストを再認証します(デフォルトはfalse)。
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
使用すべきではありません。- 次で指定:
- インターフェース
org.springframework.context.ApplicationEventPublisherAware内のsetApplicationEventPublisher
setAuthenticationManager
public void setAuthenticationManager(AuthenticationManager newManager)
使用すべきではありません。
setMessageSource
public void setMessageSource(org.springframework.context.MessageSource messageSource)
使用すべきではありません。- 次で指定:
- インターフェース
org.springframework.context.MessageSourceAware内のsetMessageSource
setPublishAuthorizationSuccess
public void setPublishAuthorizationSuccess(boolean publishAuthorizationSuccess)
使用すべきではありません。AuthorizationFailureEventのみが公開されます。このプロパティをtrueに設定すると、AuthorizedEventも公開されます。- パラメーター:
publishAuthorizationSuccess- デフォルト値はfalseです
setRejectPublicInvocations
public void setRejectPublicInvocations(boolean rejectPublicInvocations)
使用すべきではありません。公開呼び出しを拒否する(およびこのプロパティを true に設定する)ことにより、AbstractSecurityInterceptorによって通知されたすべてのセキュアオブジェクト呼び出しに構成属性が定義されていることを本質的に保証します。これは、宣言されていない安全なオブジェクトが拒否され、構成の省略が早期に検出される「フェイルセーフ」モードを保証できます。このプロパティを true に設定し、構成のないセキュアオブジェクトを呼び出そうとすると、 IllegalArgumentException が AbstractSecurityInterceptor によってスローされます。属性。- パラメーター:
rejectPublicInvocations- 構成属性を持たないセキュアオブジェクトの呼び出しを拒否するには、trueに設定します(デフォルトでは、宣言されていないセキュアオブジェクトを「パブリック」または無認可として扱うのはfalseです)。
setRunAsManager
public void setRunAsManager(RunAsManager runAsManager)
使用すべきではありません。
setValidateConfigAttributes
public void setValidateConfigAttributes(boolean validateConfigAttributes)
使用すべきではありません。