#include <functional>
#include <initializer_list>
#include <optional>
#include <string>
#include <vector>
#include "axiam/client.hpp"
#include "axiam/errors.hpp"
Go to the source code of this file.
|
| const AxiamUser & | axiam::require_auth (const std::optional< AxiamUser > &user) |
| | §11 require_auth — endpoint requires an authenticated identity.
|
| |
| void | axiam::require_role (const std::optional< AxiamUser > &user, std::initializer_list< std::string > any_of) |
| | §11 require_role — local check against the verified token's roles.
|
| |
| void | axiam::require_access (Client &client, const std::optional< AxiamUser > &user, const std::string &action, const std::string &resource_id, std::optional< std::string > scope=std::nullopt) |
| | §11 require_access — authorize the REQUEST's user (subject propagation: subject_id = user.user_id) for action on resource_id.
|
| |
| template<typename Request > |
| void | axiam::require_access (Client &client, const std::optional< AxiamUser > &user, const std::string &action, const std::function< std::string(const Request &)> &resolver, const Request &request, std::optional< std::string > scope=std::nullopt) |
| | Resolver-based overload (§11.3c): resolve the resource id from an arbitrary request object via a callback, then delegate to the guard above.
|
| |
◆ AXIAM_REQUIRE_ACCESS
| #define AXIAM_REQUIRE_ACCESS |
( |
|
client, |
|
|
|
user, |
|
|
|
action, |
|
|
|
resource |
|
) |
| ::axiam::require_access((client), (user), (action), (resource)) |
§11 C++ analog of the per-language require_access macro.
Evaluates the guard for client/user and throws on failure (AuthError/AuthzError), so it reads as a one-line precondition at the top of a handler.
◆ AXIAM_REQUIRE_AUTH