Interface SecurityPolicy
- All Known Implementing Classes:
BasicSecurityPolicy
public interface SecurityPolicy
API for a security policy, that is rules defining access permissions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA prefix that can be applied to some path patterns to logically invert the match. -
Method Summary
Modifier and TypeMethodDescriptionSet<net.solarnetwork.domain.datum.Aggregation> Get a set of aggregations this policy applies to.Get a set of API paths this policy allows.Get a location precision this policy applies to.net.solarnetwork.domain.datum.AggregationGet a minimum aggregation level this policy applies to.Get a minimum location precision this policy applies to.Get a set of node IDs this policy applies to.Get a set of node metadata paths this policy applies to.Get a date after which a token is no longer valid.Flag indicating if the token can be refreshed.Get a set of source IDs this policy applies to.Get a set of user metadata paths this policy applies to.booleanTest if the policy is valid at a specific date.
-
Field Details
-
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
Get a set of node IDs this policy applies to.- Returns:
- set of node IDs, or
null
-
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
Get a set of node metadata paths this policy applies to.- Returns:
- set of node metadata paths
- Since:
- 1.1
-
getUserMetadataPaths
Get a set of user metadata paths this policy applies to.- Returns:
- set of user metadata paths
- Since:
- 1.1
-
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
Test if the policy is valid at a specific date.- Parameters:
timestamp- the time to test- Returns:
- false if
notAfteris set on the policy andtimestampis 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
-