(allow rule pattern)
Inputs: [rule :- Rule pattern :- acl/ACEConfig] Returns: Rule
Inputs: [rule :- Rule pattern :- acl/ACEConfig] Returns: Rule
(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.
(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.
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.
(authorized? result)
Inputs: [result :- AuthorizationResult] Returns: schema/Bool
Inputs: [result :- AuthorizationResult] Returns: schema/Bool
(deny rule pattern)
Inputs: [rule :- Rule pattern :- acl/ACEConfig] Returns: Rule
Inputs: [rule :- Rule pattern :- acl/ACEConfig] Returns: Rule
(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.
(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.
(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.
(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
(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.
(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.
A match?
result containing the matched rule and any regex capture groups.
A `match?` result containing the matched rule and any regex capture groups.
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close