AccessRule Trait (arul)

Trait representing an access rule.

AttributeValue
Idtag:google.com,2018:m2m:traits:access-rule:v1:v0#r0
Short-Idarul
Has-Childrenno
Requirestag:google.com,2018:m2m:traits:enabled:v1:v0#r0

This trait is a work in progress.

Rules are evaluated in order from lowest to highest. Once all rules have been evaluated (or when the last rule evaluated had the “done” flag set), the result of the evaluation is the value of the ‘deny’ flag of the last matching rule (or, if no matching rule, deny by default).

State Properties

NameKeyRWReqDescription
Counts/arul/cXThe number of times this rule has been matched.

s/arul/c : Count

The number of times this rule has been matched.

AttributeValue
Value Typeinteger
FlagsGET, RESET, OBS, VOLATILE

This count may be reset by setting it to zero. The count is not preserved across power cycles.

Config Properties

NameKeyRWReqDescription
Orderc/arul/ordrXXXThe order in which this rule should be applied.
Pathc/arul/pathXXXPath that this rule applies to.
Methodsc/arul/methXXXREST Methods that this rule applies to.
ApplyIdentityc/arul/idenXXIdentity to also apply access rules from.
Denyc/arul/denyXXXThe deny state to assume if this rule matches.
Donec/arul/doneXXXStop evaluation if this rule matches.

c/arul/ordr : Order

The order in which this rule should be applied.

AttributeValue
Value Typeinteger
FlagsREQ, RW

Rules are evaluated in order from lowest to highest.

c/arul/path : Path

Path that this rule applies to.

AttributeValue
Value Typetext string
FlagsREQ, RW

Simple wildcards (*) are supported. Can also match query parameters. Path must be absolute unless starting with a wildcard or a question mark.

c/arul/meth : Methods

REST Methods that this rule applies to.

AttributeValue
Value Typearray containing text strings
FlagsREQ, RW

Array can contain GET, OBSERVE, POST, PUT, or DELETE. Matches all methods if absent or empty.

c/arul/iden : ApplyIdentity

Identity to also apply access rules from.

AttributeValue
Value Typenullable text string
FlagsRW

Assuming path and meth match, if this field is set the rules engine will execute the rules from another identity inline, as if they were a single rule. A stop flag encountered in that rule set will only stop evaluation within that rule set. This rule will then assume the deny status that results.

c/arul/deny : Deny

The deny state to assume if this rule matches.

AttributeValue
Value Typeboolean
FlagsREQ, RW

If the rule matches, changes the assumed deny state to this value. Behavior is different if “iden” is specified: it is used as the required resulting state from evaluating ‘iden’ if ‘done’ is set.

c/arul/done : Done

Stop evaluation if this rule matches.

AttributeValue
Value Typeboolean
FlagsREQ, RW

If the rule matches, stop evaluating. If iden is set, evaluation of the rules is only stopped if deny matches the result of evaluating iden.

Metadata Properties

NameKeyRWReqDescription
TraitURIm/arul/turiXXThe URI that uniquely identifies the specification used to implement this trait.

m/arul/turi : TraitURI

The URI that uniquely identifies the specification used to implement this trait.

AttributeValue
Value TypeURI-reference
FlagsCONST, REQ