MIP SDK — C++ 1.18
API Reference Documentation for C++
Loading...
Searching...
No Matches
PolicyEngine::Settings Class Reference

Defines the settings associated with a PolicyEngine. More...

#include <mip/upe/policy_engine.h>

Public Member Functions

 Settings (const std::string &engineId, const std::shared_ptr< AuthDelegate > &authDelegate, const std::string &clientData, const std::string &locale="", bool loadSensitivityTypes=false)
 PolicyEngine::Settings constructor for loading an existing engine.
 
 Settings (const Identity &identity, const std::shared_ptr< AuthDelegate > &authDelegate, const std::string &clientData, const std::string &locale="", bool loadSensitivityTypes=false)
 PolicyEngine::Settings constructor for creating a new engine.
 
const std::string & GetEngineId () const
 Get the engine ID.
 
void SetEngineId (const std::string &id)
 Set the engine ID.
 
const IdentityGetIdentity () const
 Get the Identity object.
 
void SetIdentity (const Identity &identity)
 Set the Identity object.
 
const std::string & GetClientData () const
 Get the Client Data set in the settings.
 
void SetClientData (const std::string &clientData)
 Set the Client Data string.
 
const std::string & GetLocale () const
 Get the Locale set in the settings.
 
void SetCustomSettings (const std::vector< std::pair< std::string, std::string > > &customSettings)
 Set the custom settings, used for feature gating and testing.
 
const std::vector< std::pair< std::string, std::string > > & GetCustomSettings () const
 Get the custom settings, used for feature gating and testing.
 
void SetSessionId (const std::string &sessionId)
 Set the session ID, used for client defined telemetry and to make it easier to correlate application events with the corresponding policy service REST requests.
 
const std::string & GetSessionId () const
 Get the session ID, a unique identifier.
 
bool IsLoadSensitivityTypesEnabled () const
 Get the the flag indicating if load sensitivity labels is enabled.
 
void SetCloud (Cloud cloud)
 Optionally sets the target cloud.
 
Cloud GetCloud () const
 Gets the target cloud used by all service requests.
 
void SetDataBoundary (DataBoundary dataBoundary)
 Optionally sets the target diagnostic region.
 
DataBoundary GetDataBoundary () const
 Gets the data boundary region.
 
void SetCloudEndpointBaseUrl (const std::string &cloudEndpointBaseUrl)
 Sets the cloud endpoint base URL for custom cloud.
 
const std::string & GetCloudEndpointBaseUrl () const
 Gets the cloud base URL used by all service requests, if specified.
 
void SetDelegatedUserEmail (const std::string &delegatedUserEmail)
 Sets the delegated user.
 
const std::string & GetDelegatedUserEmail () const
 Gets the delegated user.
 
void SetLabelFilter (const std::vector< LabelFilterType > &deprecatedLabelFilters)
 Sets the label filter.
 
const std::vector< LabelFilterType > & GetLabelFilter () const
 Gets the label filters set through deprecated function SetLabelFilter.
 
void ConfigureFunctionality (FunctionalityFilterType functionalityFilterType, bool enabled)
 Enables or disables functionality.
 
const std::map< FunctionalityFilterType, bool > & GetConfiguredFunctionality () const
 Gets the configured functionality.
 
void SetVariableTextMarkingType (VariableTextMarkingType variableTextMarkingType)
 Sets the variable text marking type.
 
VariableTextMarkingType GetVariableTextMarkingType () const
 Gets the variable text marking type.
 
void SetAuthDelegate (const std::shared_ptr< AuthDelegate > &authDelegate)
 Set the Engine Auth Delegate.
 
std::shared_ptr< AuthDelegateGetAuthDelegate () const
 Get the Engine Auth Delegate.
 
const std::shared_ptr< void > & GetLoggerContext () const
 Get logger context that will be opaquely passed to the logger delegate for logs associated with the created engine.
 
void SetLoggerContext (const std::shared_ptr< void > &loggerContext)
 Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created engine.
 
 ~Settings ()
 

Private Attributes

std::string mEngineId
 
Identity mIdentity
 
Cloud mCloud = Cloud::Unknown
 
DataBoundary mDataBoundary = DataBoundary::Default
 
std::shared_ptr< AuthDelegatemAuthDelegate
 
std::string mClientData
 
std::vector< std::pair< std::string, std::string > > mCustomSettings
 
std::vector< LabelFilterType > mDeprecatedLabelFilters
 
std::map< FunctionalityFilterType, bool > mConfiguredFunctionality
 
std::string mLocale
 
std::string mSessionId
 
bool mIsLoadSensitivityTypesEnabled
 
std::string mCloudEndpointBaseUrl
 
std::string mDelegatedUserEmail
 
VariableTextMarkingType mVariableTextMarkingType = VariableTextMarkingType::Default
 
std::map< Classifier, bool > mClassifierSupport
 
std::shared_ptr< void > mLoggerContext
 

Detailed Description

Defines the settings associated with a PolicyEngine.

Constructor & Destructor Documentation

◆ Settings() [1/2]

PolicyEngine::Settings::Settings ( const std::string & engineId,
const std::shared_ptr< AuthDelegate > & authDelegate,
const std::string & clientData,
const std::string & locale = "",
bool loadSensitivityTypes = false )
inline

PolicyEngine::Settings constructor for loading an existing engine.

Parameters
engineIdSet it to the unique engine ID generated by AddEngineAsync or one self-generated. When loading an existing engine, reuse the ID else a new engine will be created.
authDelegateThe authentication delegate used by the SDK to acquire authentication tokens, will override the PolicyProfile::Settings::authDelegate if both provided
clientDatacustomizable client data that can be stored with the engine when unloaded, can be retrieved from a loaded engine.
localeengine localizable output will be provided in this locale.
loadSensitivityTypesOptional flag indicating when the engine is loaded should load also custom sensitivity types, if true OnPolicyChange Observer on the profile will be invoked on updates to custom sensitivity types as well as policy changes. if false ListSensitivityTypes call will always return an empty list.

◆ Settings() [2/2]

PolicyEngine::Settings::Settings ( const Identity & identity,
const std::shared_ptr< AuthDelegate > & authDelegate,
const std::string & clientData,
const std::string & locale = "",
bool loadSensitivityTypes = false )
inline

PolicyEngine::Settings constructor for creating a new engine.

Parameters
identityIdentity info of the user associated with the new engine.
authDelegateThe authentication delegate used by the SDK to acquire authentication tokens, will override the PolicyProfile::Settings::authDelegate if both provided
clientDatacustomizable client data that can be stored with the engine when unloaded, can be retrieved from a loaded engine.
localeengine localizable output will be provided in this locale.
loadSensitivityTypesOptional flag indicating when the engine is loaded should load also custom sensitivity types, if true OnPolicyChange Observer on the profile will be invoked on updates to custom sensitivity types as well as policy changes. if false ListSensitivityTypes call will always return an empty list.

◆ ~Settings()

PolicyEngine::Settings::~Settings ( )
inline

Member Function Documentation

◆ ConfigureFunctionality()

void PolicyEngine::Settings::ConfigureFunctionality ( FunctionalityFilterType functionalityFilterType,
bool enabled )
inline

Enables or disables functionality.

Parameters
functionalityFilterTypethe type of functionality.
enabledTrue to enable, false to disable
Note
HyokProtection, DoubleKeyProtection, DoubleKeyUserDefinedProtection are disabled by default and must be enabled

◆ GetAuthDelegate()

std::shared_ptr< AuthDelegate > PolicyEngine::Settings::GetAuthDelegate ( ) const
inline

Get the Engine Auth Delegate.

Returns
the Engine Auth Delegate.

◆ GetClientData()

const std::string & PolicyEngine::Settings::GetClientData ( ) const
inline

Get the Client Data set in the settings.

Returns
a string of data specified by the client.

◆ GetCloud()

Cloud PolicyEngine::Settings::GetCloud ( ) const
inline

Gets the target cloud used by all service requests.

Returns
cloud

◆ GetCloudEndpointBaseUrl()

const std::string & PolicyEngine::Settings::GetCloudEndpointBaseUrl ( ) const
inline

Gets the cloud base URL used by all service requests, if specified.

Returns
base URL

◆ GetConfiguredFunctionality()

const std::map< FunctionalityFilterType, bool > & PolicyEngine::Settings::GetConfiguredFunctionality ( ) const
inline

Gets the configured functionality.

Returns
A map of the types to a boolean value indicating whether or not it is enabled

◆ GetCustomSettings()

const std::vector< std::pair< std::string, std::string > > & PolicyEngine::Settings::GetCustomSettings ( ) const
inline

Get the custom settings, used for feature gating and testing.

Returns
List of name/value pairs.

◆ GetDataBoundary()

DataBoundary PolicyEngine::Settings::GetDataBoundary ( ) const
inline

Gets the data boundary region.

Returns
DataBoundary

◆ GetDelegatedUserEmail()

const std::string & PolicyEngine::Settings::GetDelegatedUserEmail ( ) const
inline

Gets the delegated user.

Returns
Delegated user
Note
A delegated user is specified when the authenticating user/application is acting on behalf of another user

◆ GetEngineId()

const std::string & PolicyEngine::Settings::GetEngineId ( ) const
inline

Get the engine ID.

Returns
a unique string identifying the engine.

◆ GetIdentity()

const Identity & PolicyEngine::Settings::GetIdentity ( ) const
inline

Get the Identity object.

Returns
a reference to the identity in the settings object.
See also
mip::Identity

◆ GetLabelFilter()

const std::vector< LabelFilterType > & PolicyEngine::Settings::GetLabelFilter ( ) const
inline

Gets the label filters set through deprecated function SetLabelFilter.

Returns
the label filter.
Note
Labels are by default filter to scope, this api is to allow filtering by possible actions.

◆ GetLocale()

const std::string & PolicyEngine::Settings::GetLocale ( ) const
inline

Get the Locale set in the settings.

Returns
the locale.

◆ GetLoggerContext()

const std::shared_ptr< void > & PolicyEngine::Settings::GetLoggerContext ( ) const
inline

Get logger context that will be opaquely passed to the logger delegate for logs associated with the created engine.

Returns
The logger context

◆ GetSessionId()

const std::string & PolicyEngine::Settings::GetSessionId ( ) const
inline

Get the session ID, a unique identifier.

Returns
the session ID.

◆ GetVariableTextMarkingType()

VariableTextMarkingType PolicyEngine::Settings::GetVariableTextMarkingType ( ) const
inline

Gets the variable text marking type.

Returns
the variable text marking type.

◆ IsLoadSensitivityTypesEnabled()

bool PolicyEngine::Settings::IsLoadSensitivityTypesEnabled ( ) const
inline

Get the the flag indicating if load sensitivity labels is enabled.

Returns
true if enabled else false.

◆ SetAuthDelegate()

void PolicyEngine::Settings::SetAuthDelegate ( const std::shared_ptr< AuthDelegate > & authDelegate)
inline

Set the Engine Auth Delegate.

Parameters
authDelegatethe Auth delegate

◆ SetClientData()

void PolicyEngine::Settings::SetClientData ( const std::string & clientData)
inline

Set the Client Data string.

Parameters
clientDatauser specified data.

◆ SetCloud()

void PolicyEngine::Settings::SetCloud ( Cloud cloud)
inline

Optionally sets the target cloud.

Parameters
cloudCloud
Note
If cloud is not specified, then it will default to commercial cloud.

◆ SetCloudEndpointBaseUrl()

void PolicyEngine::Settings::SetCloudEndpointBaseUrl ( const std::string & cloudEndpointBaseUrl)
inline

Sets the cloud endpoint base URL for custom cloud.

Parameters
cloudEndpointBaseUrlthe base URL used by all service requests (for example, "https://dataservice.protection.outlook.com")
Note
This value will only be read and must be set for Cloud = Custom

◆ SetCustomSettings()

void PolicyEngine::Settings::SetCustomSettings ( const std::vector< std::pair< std::string, std::string > > & customSettings)
inline

Set the custom settings, used for feature gating and testing.

Parameters
customSettingsList of name/value pairs.

◆ SetDataBoundary()

void PolicyEngine::Settings::SetDataBoundary ( DataBoundary dataBoundary)
inline

Optionally sets the target diagnostic region.

Parameters
dataBoundaryData boundary region
Note
If dataBoundary is not specified, then it will default to global diagnostic region.

◆ SetDelegatedUserEmail()

void PolicyEngine::Settings::SetDelegatedUserEmail ( const std::string & delegatedUserEmail)
inline

Sets the delegated user.

Parameters
delegatedUserEmailthe delegation email.
Note
A delegated user is specified when the authenticating user/application is acting on behalf of another user

◆ SetEngineId()

void PolicyEngine::Settings::SetEngineId ( const std::string & id)
inline

Set the engine ID.

Parameters
idengine ID.

◆ SetIdentity()

void PolicyEngine::Settings::SetIdentity ( const Identity & identity)
inline

Set the Identity object.

Parameters
identitythe unique identity of a user.
See also
mip::Identity

◆ SetLabelFilter()

void PolicyEngine::Settings::SetLabelFilter ( const std::vector< LabelFilterType > & deprecatedLabelFilters)
inline

Sets the label filter.

Parameters
labelFilterthe label filter.
Note
Labels are by default filter to scope, this api is to allow filtering by possible actions.
If not set HyokProtection and DoubleKeyProtection are filtered.

◆ SetLoggerContext()

void PolicyEngine::Settings::SetLoggerContext ( const std::shared_ptr< void > & loggerContext)
inline

Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created engine.

Parameters
loggerContextThe logger context

◆ SetSessionId()

void PolicyEngine::Settings::SetSessionId ( const std::string & sessionId)
inline

Set the session ID, used for client defined telemetry and to make it easier to correlate application events with the corresponding policy service REST requests.

Parameters
sessionIdAn identifier (usually specified as a GUID) to uniquely identify this operation.

◆ SetVariableTextMarkingType()

void PolicyEngine::Settings::SetVariableTextMarkingType ( VariableTextMarkingType variableTextMarkingType)
inline

Sets the variable text marking type.

Parameters
variableTextMarkingTypethe variable text marking type.

Member Data Documentation

◆ mAuthDelegate

std::shared_ptr<AuthDelegate> PolicyEngine::Settings::mAuthDelegate
private

◆ mClassifierSupport

std::map<Classifier, bool> PolicyEngine::Settings::mClassifierSupport
private

◆ mClientData

std::string PolicyEngine::Settings::mClientData
private

◆ mCloud

Cloud PolicyEngine::Settings::mCloud = Cloud::Unknown
private

◆ mCloudEndpointBaseUrl

std::string PolicyEngine::Settings::mCloudEndpointBaseUrl
private

◆ mConfiguredFunctionality

std::map<FunctionalityFilterType, bool> PolicyEngine::Settings::mConfiguredFunctionality
private

◆ mCustomSettings

std::vector<std::pair<std::string, std::string> > PolicyEngine::Settings::mCustomSettings
private

◆ mDataBoundary

DataBoundary PolicyEngine::Settings::mDataBoundary = DataBoundary::Default
private

◆ mDelegatedUserEmail

std::string PolicyEngine::Settings::mDelegatedUserEmail
private

◆ mDeprecatedLabelFilters

std::vector<LabelFilterType> PolicyEngine::Settings::mDeprecatedLabelFilters
private

◆ mEngineId

std::string PolicyEngine::Settings::mEngineId
private

◆ mIdentity

Identity PolicyEngine::Settings::mIdentity
private

◆ mIsLoadSensitivityTypesEnabled

bool PolicyEngine::Settings::mIsLoadSensitivityTypesEnabled
private

◆ mLocale

std::string PolicyEngine::Settings::mLocale
private

◆ mLoggerContext

std::shared_ptr<void> PolicyEngine::Settings::mLoggerContext
private

◆ mSessionId

std::string PolicyEngine::Settings::mSessionId
private

◆ mVariableTextMarkingType

VariableTextMarkingType PolicyEngine::Settings::mVariableTextMarkingType = VariableTextMarkingType::Default
private

The documentation for this class was generated from the following file: