Interface SecurityPolicy

All Known Implementing Classes:
BasicSecurityPolicy

public interface SecurityPolicy
API for a security policy, that is rules defining access permissions.
  • Field Details

    • INVERTED_PATH_MATCH_PREFIX

      static final String INVERTED_PATH_MATCH_PREFIX
      A prefix that can be applied to some path patterns to logically invert the match.
      Since:
      1.3
      See Also:
  • Method Details

    • getNodeIds

      Set<Long> getNodeIds()
      Get a set of node IDs this policy applies to.
      Returns:
      set of node IDs, or null
    • getSourceIds

      Set<String> getSourceIds()
      Get a set of source IDs this policy applies to.
      Returns:
      set of source IDs
    • getAggregations

      Set<net.solarnetwork.domain.datum.Aggregation> getAggregations()
      Get a set of aggregations this policy applies to.
      Returns:
      set of aggregations
    • getMinAggregation

      net.solarnetwork.domain.datum.Aggregation getMinAggregation()
      Get a minimum aggregation level this policy applies to.
      Returns:
      The minimum aggregation level.
    • getLocationPrecisions

      Set<LocationPrecision> getLocationPrecisions()
      Get a location precision this policy applies to.
      Returns:
      set of precisions
    • getMinLocationPrecision

      LocationPrecision getMinLocationPrecision()
      Get a minimum location precision this policy applies to.
      Returns:
      The minimum location precision.
    • getNodeMetadataPaths

      Set<String> getNodeMetadataPaths()
      Get a set of node metadata paths this policy applies to.
      Returns:
      set of node metadata paths
      Since:
      1.1
    • getUserMetadataPaths

      Set<String> getUserMetadataPaths()
      Get a set of user metadata paths this policy applies to.
      Returns:
      set of user metadata paths
      Since:
      1.1
    • getApiPaths

      Set<String> getApiPaths()
      Get a set of API paths this policy allows.

      API paths are URL paths that support Ant-style patterns. If a path starts with ! then the match is inverted, so that any path not matching the pattern is allowed. Note that if any paths are defined here, then only paths that match some pattern are allowed. Or put another way, paths are denied unless some pattern matches.

      Returns:
      set of allowed API paths, or null or empty set if all paths are allowed
      Since:
      1.3
    • getNotAfter

      Instant getNotAfter()
      Get a date after which a token is no longer valid.
      Returns:
      the expire date, or null for no expiration
      Since:
      2.0
    • isValidAt

      boolean isValidAt(Instant timestamp)
      Test if the policy is valid at a specific date.
      Parameters:
      timestamp - the time to test
      Returns:
      false if notAfter is set on the policy and timestamp is after that
      Since:
      2.0
    • getRefreshAllowed

      Boolean getRefreshAllowed()
      Flag indicating if the token can be refreshed.
      Returns:
      true if a token can be refreshed, false otherwise
      Since:
      1.2