Interface HttpSecurityPolicy

All Superinterfaces:
BasePolicy, BaseSecurityPolicy, HttpPolicy
All Known Subinterfaces:
SecurityPolicy

public interface HttpSecurityPolicy extends HttpPolicy, BaseSecurityPolicy
HttpSecurityPolicy is a Policy that can be used for securing a plan that can require a subscription. Implementing a HttpSecurityPolicy requires to implement some additional behavior in order to be used by the gateway during the security chain execution that will identify which plan the consumer is using:
  • Method Details

    • extractSecurityToken

      io.reactivex.rxjava3.core.Maybe<SecurityToken> extractSecurityToken(HttpPlainExecutionContext ctx)
      Extracts the SecurityToken from the request execution context. If no relevant SecurityToken is found, it returns an empty Maybe, so that policy won't be executed.
      Parameters:
      ctx - the current request execution context.
      Returns:
      the SecurityToken found in the request execution context
    • onResponse

      default io.reactivex.rxjava3.core.Completable onResponse(HttpPlainExecutionContext ctx)
      The onResponse(HttpSimpleExecutionContext) method shouldn't call on a SecurityPolicy
      Specified by:
      onResponse in interface HttpPolicy
      Parameters:
      ctx - the current request execution context allowing to access the request, response and attributes.
      Returns:
      a UnsupportedOperationException</code
    • onMessageResponse

      default io.reactivex.rxjava3.core.Completable onMessageResponse(HttpMessageExecutionContext ctx)
      The onMessageResponse(MessageExecutionContext) method shouldn't call on a SecurityPolicy
      Specified by:
      onMessageResponse in interface HttpPolicy
      Parameters:
      ctx - the current request execution context allowing to access the request, response and attributes.
      Returns:
      the order of the security policy when multiple security policies can be involved.