22 #include <boost/optional.hpp>
26 #include <olp/authentication/AuthenticationApi.h>
29 namespace authentication {
58 using Action = std::pair<std::string, std::string>;
86 inline const std::string&
GetServiceId()
const {
return service_id_; }
96 service_id_ = std::move(service_id);
126 boost::optional<std::string> contract_id) {
127 contract_id_ = std::move(contract_id);
141 contract_id_ = std::move(contract_id);
163 std::string resource =
"") {
164 actions_.emplace_back(std::move(action), std::move(resource));
190 operator_type_ = operator_type;
210 diagnostics_ = diagnostics;
222 std::string service_id_;
223 boost::optional<std::string> contract_id_;
226 bool diagnostics_{
false};
Encapsulates the fields required to make a policy decision for a given request context against the HE...
Definition: AuthorizeRequest.h:47
std::vector< Action > Actions
An alias for the vector of actions.
Definition: AuthorizeRequest.h:63
const Actions & GetActions() const
Gets all actions.
Definition: AuthorizeRequest.h:150
const boost::optional< std::string > & GetContractId() const
Gets the contract ID.
Definition: AuthorizeRequest.h:112
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
AuthorizeRequest & WithContractId(boost::optional< std::string > contract_id)
Sets the contract ID.
Definition: AuthorizeRequest.h:125
AuthorizeRequest & WithOperatorType(DecisionOperatorType operator_type)
Sets the operator type for the request.
Definition: AuthorizeRequest.h:188
DecisionOperatorType GetOperatorType() const
Gets the operator type.
Definition: AuthorizeRequest.h:177
AuthorizeRequest & WithContractId(std::string contract_id)
Sets the contract ID.
Definition: AuthorizeRequest.h:140
std::string CreateKey() const
Creates a readable format for the request.
bool GetDiagnostics() const
Gets the diagnostics flag.
Definition: AuthorizeRequest.h:199
AuthorizeRequest & WithServiceId(std::string service_id)
Sets the service ID.
Definition: AuthorizeRequest.h:95
std::pair< std::string, std::string > Action
An alias for the action pair.
Definition: AuthorizeRequest.h:58
AuthorizeRequest & WithDiagnostics(bool diagnostics)
Sets the diagnostics flag for the request.
Definition: AuthorizeRequest.h:209
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