クラス AbstractSecurityInterceptor

java.lang.ObjectSE
org.springframework.security.access.intercept.AbstractSecurityInterceptor
実装されたすべてのインターフェース:
org.springframework.beans.factory.Awareorg.springframework.beans.factory.InitializingBeanorg.springframework.context.ApplicationEventPublisherAwareorg.springframework.context.MessageSourceAware
既知の直属サブクラス
ChannelSecurityInterceptorFilterSecurityInterceptorMethodSecurityInterceptor

@DeprecatedSE public abstract class AbstractSecurityInterceptor extends ObjectSE implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.MessageSourceAware
使用すべきではありません。
代わりに、フィルターセキュリティには AuthorizationFilter を、メッセージングセキュリティには AuthorizationChannelInterceptor を、メソッドセキュリティには AuthorizationManagerBeforeMethodInterceptorAuthorizationManagerAfterMethodInterceptor を使用してください。
セキュアオブジェクトのセキュリティインターセプトを実装する抽象クラス。

AbstractSecurityInterceptor は、セキュリティインターセプタの適切な起動設定を保証します。また、安全なオブジェクト呼び出しの適切な処理も実装します。

  1. SecurityContextHolder から Authentication オブジェクトを取得します。
  2. SecurityMetadataSource に対してセキュアオブジェクトリクエストを検索して、リクエストがセキュアな呼び出しに関連するのか、パブリックな呼び出しに関連するのかを判断します。
  3. 保護された呼び出しの場合(保護されたオブジェクト呼び出し用の ConfigAttribute のリストがあります):
    1. Authentication.isAuthenticated() が false を返す場合、または alwaysReauthenticate が true である場合は、構成された AuthenticationManager に対してリクエストを認証します。認証されたら、SecurityContextHolder の Authentication オブジェクトを戻り値に置き換えます。
    2. 構成された AccessDecisionManager に対してリクエストを承認します。
    3. 構成された RunAsManager を介して run-as 置換を実行します。
    4. 実際のオブジェクトの実行を続行する具象サブクラスに制御を渡します。InterceptorStatusToken が返されるため、サブクラスがオブジェクトの実行を続行した後、finally 句を使用すると、AbstractSecurityInterceptor が確実に再呼び出しされ、finallyInvocation(InterceptorStatusToken) を使用して正しく整理されます。
    5. 具象サブクラスは、afterInvocation(InterceptorStatusToken, Object) メソッドを介して AbstractSecurityInterceptor を再度呼び出します。
    6. RunAsManager が Authentication オブジェクトを置き換えた場合は、SecurityContextHolder を、AuthenticationManager の呼び出し後に存在していたオブジェクトに戻します。
    7. AfterInvocationManager が定義されている場合は、呼び出しマネージャーを呼び出し、呼び出し元に返されるため、オブジェクトを置き換えられるようにします。
  4. パブリックな呼び出しの場合(セキュアオブジェクト呼び出し用の ConfigAttribute はありません):
    1. 上記のように、具象サブクラスは InterceptorStatusToken が返され、セキュアオブジェクトが実行された後に AbstractSecurityInterceptor に再提示されます。afterInvocation(InterceptorStatusToken, Object) が呼び出されても、AbstractSecurityInterceptor はそれ以上のアクションを実行しません。
  5. コントロールは、呼び出し元に返される Object と共に、具象サブクラスに再び戻ります。次に、サブクラスはその結果または例外を元の呼び出し元に返します。
  • フィールドの詳細

    • logger

      protected final org.apache.commons.logging.Log logger
      使用すべきではありません。
    • messages

      protected org.springframework.context.support.MessageSourceAccessor messages
      使用すべきではありません。
  • コンストラクターの詳細

    • AbstractSecurityInterceptor

      public AbstractSecurityInterceptor()
      使用すべきではありません。
  • メソッドの詳細

    • afterPropertiesSet

      public void afterPropertiesSet()
      使用すべきではありません。
      次で指定:
      インターフェース org.springframework.beans.factory.InitializingBeanafterPropertiesSet 
    • beforeInvocation

      protected InterceptorStatusToken beforeInvocation(ObjectSE object)
      使用すべきではありません。
    • finallyInvocation

      protected void finallyInvocation(InterceptorStatusToken token)
      使用すべきではありません。
      セキュアオブジェクトの呼び出しが完了した後、 AbstractSecurityInterceptor の作業をクリーンアップします。このメソッドは、セキュアオブジェクトの呼び出しが正常に返されたかどうかに関係なく、セキュアオブジェクトの呼び出しの後、afterInvocation の前に呼び出す必要があります(つまり、finally ブロックで実行する必要があります)。
      パラメーター:
      token - beforeInvocation(Object) メソッドによって返される
    • afterInvocation

      protected ObjectSE afterInvocation(InterceptorStatusToken token, ObjectSE 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 ClassSE<?> 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.ApplicationEventPublisherAwaresetApplicationEventPublisher 
    • setAuthenticationManager

      public void setAuthenticationManager(AuthenticationManager newManager)
      使用すべきではありません。
    • setMessageSource

      public void setMessageSource(org.springframework.context.MessageSource messageSource)
      使用すべきではありません。
      次で指定:
      インターフェース org.springframework.context.MessageSourceAwaresetMessageSource 
    • 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)
      使用すべきではありません。