Liking cljdoc? Tell your friends :D

puppetlabs.trapperkeeper.authorization.rules


allowclj

(allow rule pattern)

Inputs: [rule :- Rule pattern :- acl/ACEConfig] Returns: Rule

Inputs: [rule :- Rule pattern :- acl/ACEConfig]
Returns: Rule
sourceraw docstring

allow-requestclj

(allow-request request rule message)

Inputs: [request :- ring/Request rule :- Rule message :- schema/Str] Returns: AuthorizationResult

Logs debugging information about the request and rule at the TRACE level and returns an authorized authorization result with the provided message.

Inputs: [request :- ring/Request rule :- Rule message :- schema/Str]
Returns: AuthorizationResult

Logs debugging information about the request and rule at the TRACE level
 and returns an authorized authorization result with the provided message.
sourceraw docstring

allowed?clj

(allowed? request rules oid-map rbac-is-permitted?)

Inputs: [request :- ring/Request rules :- [Rule] oid-map :- acl/OIDMap rbac-is-permitted? :- (schema/maybe IFn)] Returns: AuthorizationResult

Checks if a request is allowed access given the list of rules. Rules will be checked in the given order; use sort-rules to first sort them.

Inputs: [request :- ring/Request rules :- [Rule] oid-map :- acl/OIDMap rbac-is-permitted? :- (schema/maybe IFn)]
Returns: AuthorizationResult

Checks if a request is allowed access given the list of rules. Rules
 will be checked in the given order; use `sort-rules` to first sort them.
sourceraw docstring

AuthorizationResultclj

The result of a rules/allowed? indicating whether the request should be authorized or not, and an explanation message if it's not. Also contains meta-information like the request in question.

The result of a `rules/allowed?` indicating whether the request should be
authorized or not, and an explanation message if it's not. Also contains
meta-information like the request in question.
sourceraw docstring

authorized?clj

(authorized? result)

Inputs: [result :- AuthorizationResult] Returns: schema/Bool

Inputs: [result :- AuthorizationResult]
Returns: schema/Bool
sourceraw docstring

denyclj

(deny rule pattern)

Inputs: [rule :- Rule pattern :- acl/ACEConfig] Returns: Rule

Inputs: [rule :- Rule pattern :- acl/ACEConfig]
Returns: Rule
sourceraw docstring

deny-requestclj

(deny-request request rule reason)
(deny-request request rule log-reason resp-reason)

Inputs: ([request rule reason] [request :- ring/Request rule :- (schema/maybe Rule) log-reason :- schema/Str resp-reason :- schema/Str]) Returns: AuthorizationResult

Logs debugging information about the request and rule at the TRACE level as well as the reason for denial at the ERROR level, and returns an unauthorized authorization result with the provided reason message.

Inputs: ([request rule reason] [request :- ring/Request rule :- (schema/maybe Rule) log-reason :- schema/Str resp-reason :- schema/Str])
Returns: AuthorizationResult

Logs debugging information about the request and rule at the TRACE level
 as well as the reason for denial at the ERROR level, and returns an
 unauthorized authorization result with the provided reason message.
sourceraw docstring

match?clj

(match? rule request)

Inputs: [rule :- Rule request :- ring/Request] Returns: (schema/maybe RuleMatch)

Returns the rule if it matches the request URI, and also any capture groups of the Rule pattern if there are any.

Inputs: [rule :- Rule request :- ring/Request]
Returns: (schema/maybe RuleMatch)

Returns the rule if it matches the request URI, and also
 any capture groups of the Rule pattern if there are any.
sourceraw docstring

Methodclj

source

method-match?clj

(method-match? method specified)

Inputs: [method :- schema/Keyword specified :- Methods]

Return true if the provided method is equal to the value of specified. If specified is a list of methods, return true if method is contained in specified. If specified is set to :any then all methods will result in true.

Inputs: [method :- schema/Keyword specified :- Methods]

Return true if the provided method is equal to the value of `specified`. If
`specified` is a list of methods, return true if `method` is contained in
`specified`. If `specified` is set to :any then all methods will result in
true.
sourceraw docstring

Methodsclj

source

new-ruleclj

(new-rule type path method sort-order name)

Inputs: [type :- Type path :- schema/Str method :- Methods sort-order :- schema/Int name :- schema/Str] Returns: Rule

Creates a new rule with an empty ACL

Inputs: [type :- Type path :- schema/Str method :- Methods sort-order :- schema/Int name :- schema/Str]
Returns: Rule

Creates a new rule with an empty ACL
sourceraw docstring

query-paramclj

(query-param rule param value)

Inputs: [rule :- Rule param :- schema/Keyword value :- (schema/cond-pre schema/Str [schema/Str])] Returns: Rule

Add a query parameter matching value(s) to a rule. New values will be appended to existing values.

The query parameters are in a map under the :query-params section of the rule. Keys in the map are keywords corresponding to the query parameters to match, and the values are sets of strings of acceptable values.

Inputs: [rule :- Rule param :- schema/Keyword value :- (schema/cond-pre schema/Str [schema/Str])]
Returns: Rule

Add a query parameter matching value(s) to a rule. New values will be
 appended to existing values.

 The query parameters are in a map under the `:query-params` section of the
 rule. Keys in the map are keywords corresponding to the query parameters to
 match, and the values are sets of strings of acceptable values.
sourceraw docstring

requestorclj

(requestor request)

Inputs: [request :- ring/Request] Returns: schema/Str

Returns a string that identifies the source of the request containing at least the IP address and the hostname if available.

Inputs: [request :- ring/Request]
Returns: schema/Str

Returns a string that identifies the source of the request containing
 at least the IP address and the hostname if available.
sourceraw docstring

Ruleclj

source

RuleMatchclj

A match? result containing the matched rule and any regex capture groups.

A `match?` result containing the matched rule and any regex capture groups.
sourceraw docstring

sort-rulesclj

(sort-rules rules)

Inputs: [rules :- [Rule]] Returns: [Rule]

Sorts the rules based on their :sort-order, and then their :name if they have the same sort order value.

Inputs: [rules :- [Rule]]
Returns: [Rule]

Sorts the rules based on their :sort-order, and then their :name if they
 have the same sort order value.
sourceraw docstring

tag-ruleclj

(tag-rule rule file line)

Inputs: [rule :- Rule file :- schema/Str line :- schema/Int] Returns: Rule

Tag a rule with a file/line - useful for instance when the rule has been read from an authorization file.

Inputs: [rule :- Rule file :- schema/Str line :- schema/Int]
Returns: Rule

Tag a rule with a file/line - useful for instance when the rule has been read
from an authorization file.
sourceraw docstring

Typeclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close