olp-cpp-sdk
1.22.0
|
Encapsulates the fields required to make a policy decision for a given request context against the HERE Service. More...
#include <AuthorizeRequest.h>
Public Types | |
enum class | DecisionOperatorType { kAnd , kOr } |
Determines the overall policy decision based on individual decisions for each action. More... | |
using | Action = std::pair< std::string, std::string > |
An alias for the action pair. More... | |
using | Actions = std::vector< Action > |
An alias for the vector of actions. | |
Public Member Functions | |
const std::string & | GetServiceId () const |
Gets the ID of the requested service. More... | |
AuthorizeRequest & | WithServiceId (std::string service_id) |
Sets the service ID. More... | |
const boost::optional< std::string > & | GetContractId () const |
Gets the contract ID. More... | |
AuthorizeRequest & | WithContractId (boost::optional< std::string > contract_id) |
Sets the contract ID. More... | |
AuthorizeRequest & | WithContractId (std::string contract_id) |
Sets the contract ID. More... | |
const Actions & | GetActions () const |
Gets all actions. More... | |
AuthorizeRequest & | WithAction (std::string action, std::string resource="") |
Adds the action-resource pair. More... | |
DecisionOperatorType | GetOperatorType () const |
Gets the operator type. More... | |
AuthorizeRequest & | WithOperatorType (DecisionOperatorType operator_type) |
Sets the operator type for the request. More... | |
bool | GetDiagnostics () const |
Gets the diagnostics flag. More... | |
AuthorizeRequest & | WithDiagnostics (bool diagnostics) |
Sets the diagnostics flag for the request. More... | |
std::string | CreateKey () const |
Creates a readable format for the request. More... | |
Encapsulates the fields required to make a policy decision for a given request context against the HERE Service.
Collects all permissions associated with the authenticated user or application, requested service ID, and requested contract ID. For each action-resource pair in the request, this class determines an individual policy decision: DENY or ALLOW.
using olp::authentication::AuthorizeRequest::Action = std::pair<std::string, std::string> |
An alias for the action pair.
The first parameter is the type of action. The second one is optional and represents the resource.
Determines the overall policy decision based on individual decisions for each action.
std::string olp::authentication::AuthorizeRequest::CreateKey | ( | ) | const |
Creates a readable format for the request.
|
inline |
Gets all actions.
|
inline |
Gets the contract ID.
|
inline |
Gets the diagnostics flag.
|
inline |
Gets the operator type.
If the operator type is not set, the 'and' type is used in the request.
DecisionApiOperatorType
for more information.
|
inline |
Gets the ID of the requested service.
|
inline |
Adds the action-resource pair.
[in] | action | The action that is used to determine an individual policy decision. |
[in] | resource | The resource that is used to request the decision for the action. |
DecisionRequest
instance.
|
inline |
Sets the contract ID.
GetContractId
for information on the contract ID.contract_id | Your contract ID. |
DecisionRequest
instance.
|
inline |
Sets the contract ID.
GetContractId
for information on the contract ID.contract_id | Your contract ID. |
DecisionRequest
instance.
|
inline |
Sets the diagnostics flag for the request.
diagnostics | The flag used to turn on or off the diagnostic information in the response. |
DecisionRequest
instance.
|
inline |
Sets the operator type for the request.
GetOperatorType()
for information on usage and format.operator_type | The DecisionApiOperatorType enum. |
DecisionRequest
instance.
|
inline |
Sets the service ID.
service_id | The service ID. |
DecisionRequest
instance.