25#include <olp/authentication/AuthenticationApi.h>
26#include <olp/core/porting/optional.h>
29namespace authentication {
58 using Action = std::pair<std::string, std::string>;
96 service_id_ = std::move(service_id);
125 template <
class T = porting::optional<std::
string>>
127 contract_id_ = std::forward<T>(contract_id);
141 contract_id_ = std::move(contract_id);
163 actions_.emplace_back(std::move(action), std::move(resource));
188 operator_type_ = operator_type;
208 diagnostics_ = diagnostics;
220 std::string service_id_;
221 porting::optional<std::string> contract_id_;
224 bool diagnostics_{
false};
Encapsulates the fields required to make a policy decision for a given request context against the HE...
Definition AuthorizeRequest.h:47
const porting::optional< std::string > & GetContractId() const
Gets the contract ID.
Definition AuthorizeRequest.h:112
std::vector< Action > Actions
An alias for the vector of actions.
Definition AuthorizeRequest.h:63
AuthorizeRequest & WithContractId(std::string contract_id)
Sets the contract ID.
Definition AuthorizeRequest.h:140
AuthorizeRequest & WithContractId(T &&contract_id)
Sets the contract ID.
Definition AuthorizeRequest.h:126
AuthorizeRequest & WithOperatorType(DecisionOperatorType operator_type)
Sets the operator type for the request.
Definition AuthorizeRequest.h:187
DecisionOperatorType GetOperatorType() const
Gets the operator type.
Definition AuthorizeRequest.h:176
std::string CreateKey() const
Creates a readable format for the request.
AuthorizeRequest & WithServiceId(std::string service_id)
Sets the service ID.
Definition AuthorizeRequest.h:95
AuthorizeRequest & WithDiagnostics(bool diagnostics)
Sets the diagnostics flag for the request.
Definition AuthorizeRequest.h:207
const Actions & GetActions() const
Gets all actions.
Definition AuthorizeRequest.h:150
bool GetDiagnostics() const
Gets the diagnostics flag.
Definition AuthorizeRequest.h:197
std::pair< std::string, std::string > Action
An alias for the action pair.
Definition AuthorizeRequest.h:58
const std::string & GetServiceId() const
Gets the ID of the requested service.
Definition AuthorizeRequest.h:86
AuthorizeRequest & WithAction(std::string action, std::string resource="")
Adds the action-resource pair.
Definition AuthorizeRequest.h:162
DecisionOperatorType
Determines the overall policy decision based on individual decisions for each action.
Definition AuthorizeRequest.h:79
Rules all the other namespaces.
Definition AppleSignInProperties.h:24