Interface BaseSecurityPolicy

All Superinterfaces:
BasePolicy
All Known Subinterfaces:
HttpSecurityPolicy, KafkaSecurityPolicy, SecurityPolicy

public interface BaseSecurityPolicy extends BasePolicy
BaseSecurityPolicy is a base that can be used for securing declaring a security policy. A security policy is a special policy that is able to work with the concept of a Gravitee plan and can require a subscription. Implementing a BaseSecurityPolicy requires implementing 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:
  • order(): to define the priority compared to other security policies
  • requireSubscription() : to indicate if it require a valid subscription or not
Author:
Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Defines the priority order of the security policy compared to others.
    default boolean
    Security policy can be used together with a plan that requires a subscription.

    Methods inherited from interface io.gravitee.gateway.reactive.api.policy.base.BasePolicy

    id
  • Field Details

  • Method Details

    • requireSubscription

      default boolean requireSubscription()
      Security policy can be used together with a plan that requires a subscription. By enabling the subscription requirement, the gateway will automatically validate the subscription associated with the current request and reject the request if the subscription is invalid.
      Returns:
      true to indicates to check the subscription after the security policy has been successfully executed, false else.
    • order

      default int order()
      Defines the priority order of the security policy compared to others. By default, it is set to DEFAULT_ORDER. The lower is the order, the highest is the priority of the policy compared to other. The order is not guaranteed when 2 BaseSecurityPolicy have the same order.
      Returns:
      the order of the security policy when multiple security policies can be involved.