#include "JUserCont.h"
#include "BaServerLib.h"
#include "HashTable.h"
Go to the source code of this file.
◆ JConstrCont_setCaseInsensitive
| #define JConstrCont_setCaseInsensitive |
( |
|
o | ) |
(o)->caseSensensitive=FALSE |
Enable case-insensitive prefix matching.
- Parameters
-
| [in,out] | o | Initialized container. Exact-path comparisons are unchanged. |
◆ JConstrCont
Authorization rules loaded from a parsed JSON object.
Each object member is a rule object with urls, methods and roles arrays. The rule member name is only a label. For example:
{"admin":{"urls":["/admin/ *"],"methods":["GET"],"roles":["admin"]}}
Exact paths are checked before prefix rules. A final slash-star selects a prefix; this is not a general wildcard matcher. An empty methods array matches all HTTP methods, and an empty roles array matches all roles. A user with no roles has special super-user access as defined by JUserCont. HTTP HEAD is checked as GET. Unmatched requests are denied.
The user database is borrowed and must outlive this object. Rule updates are not transactional: existing rules are removed before replacement is complete. Serialize configuration changes with requests using this object.
◆ JConstrCont_constructor()
Initialize an empty rule container.
- Parameters
-
| [out] | o | Caller-owned storage. |
| [in] | userCont | Required borrowed user database. |
| [in] | alloc | Borrowed allocator, or NULL for the default. |
- See also
- JConstrCont::JConstrCont
◆ JConstrCont_destructor()
Release rules after detaching the authorizer from its users.
- Parameters
-
| [in,out] | o | Initialized container; its user database is not destroyed. |
◆ JConstrCont_setConstraints()
Replace rules without rollback on failure.
- Parameters
-
| [in,out] | o | Initialized container. |
| [in] | constraintsVal | Parsed JSON object; see JConstrCont::setConstraints. |
| [in,out] | err | Required initialized JErr receiving reported failures. |