class PolicyEngine::Settings

Defines the settings associated with a PolicyEngine.

Summary

Members Descriptions
public Settings(const std::string& engineId, const std::shared_ptr<AuthDelegate>& authDelegate, const std::string& clientData, const std::string& locale, bool loadSensitivityTypes) PolicyEngine::Settings constructor for loading an existing engine.
public Settings(const Identity& identity, const std::shared_ptr<AuthDelegate>& authDelegate, const std::string& clientData, const std::string& locale, bool loadSensitivityTypes) PolicyEngine::Settings constructor for creating a new engine.
public const std::string& GetEngineId() const Get the engine ID.
public void SetEngineId(const std::string& id) Set the engine ID.
public const Identity& GetIdentity() const Get the Identity object.
public void SetIdentity(const Identity& identity) Set the Identity object.
public const std::string& GetClientData() const Get the Client Data set in the settings.
public void SetClientData(const std::string& clientData) Set the Client Data string.
public const std::string& GetLocale() const Get the Locale set in the settings.
public void SetCustomSettings(const std::vector<std::pair<std::string, std::string>>& customSettings) Set the custom settings, used for feature gating and testing.
public const std::vector<std::pair<std::string, std::string>>& GetCustomSettings() const Get the custom settings, used for feature gating and testing.
public 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.
public const std::string& GetSessionId() const Get the session ID, a unique identifier.
public bool IsLoadSensitivityTypesEnabled() const Get the the flag indicating if load sensitivity labels is enabled.
public void SetCloud(Cloud cloud) Optionally sets the target cloud.
public Cloud GetCloud() const Gets the target cloud used by all service requests.
public void SetDataBoundary(DataBoundary dataBoundary) Optionally sets the target diagnostic region.
public DataBoundary GetDataBoundary() const Gets the data boundary region.
public void SetCloudEndpointBaseUrl(const std::string& cloudEndpointBaseUrl) Sets the cloud endpoint base URL for custom cloud.
public const std::string& GetCloudEndpointBaseUrl() const Gets the cloud base URL used by all service requests, if specified.
public void SetDelegatedUserEmail(const std::string& delegatedUserEmail) Sets the delegated user.
public const std::string& GetDelegatedUserEmail() const Gets the delegated user.
public void SetLabelFilter(const std::vector<LabelFilterType>& deprecatedLabelFilters) Sets the label filter.
public const std::vector<LabelFilterType>& GetLabelFilter() const Gets the label filters set through deprecated function SetLabelFilter.
public void ConfigureFunctionality(FunctionalityFilterType functionalityFilterType, bool enabled) Enables or disables functionality.
public const std::map<FunctionalityFilterType, bool>& GetConfiguredFunctionality() const Gets the configured functionality.
public void SetVariableTextMarkingType(VariableTextMarkingType variableTextMarkingType) Sets the variable text marking type.
public VariableTextMarkingType GetVariableTextMarkingType() const Gets the variable text marking type.
public void SetAuthDelegate(const std::shared_ptr<AuthDelegate>& authDelegate) Set the Engine Auth Delegate.
public std::shared_ptr<AuthDelegate> GetAuthDelegate() const Get the Engine Auth Delegate.
public 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.
public 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.

Members

Settings function

PolicyEngine::Settings constructor for loading an existing engine.

Parameters:

  • engineId: Set 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.

  • authDelegate: The authentication delegate used by the SDK to acquire authentication tokens, will override the PolicyProfile::Settings::authDelegate if both provided

  • clientData: customizable client data that can be stored with the engine when unloaded, can be retrieved from a loaded engine.

  • locale: engine localizable output will be provided in this locale.

  • Optional: 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 function

PolicyEngine::Settings constructor for creating a new engine.

Parameters:

  • identity: Identity info of the user associated with the new engine.

  • authDelegate: The authentication delegate used by the SDK to acquire authentication tokens, will override the PolicyProfile::Settings::authDelegate if both provided

  • clientData: customizable client data that can be stored with the engine when unloaded, can be retrieved from a loaded engine.

  • locale: engine localizable output will be provided in this locale.

  • Optional: 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.

GetEngineId function

Get the engine ID.

Returns: A unique string identifying the engine.

SetEngineId function

Set the engine ID.

Parameters:

  • id: engine ID.

GetIdentity function

Get the Identity object.

Returns: A reference to the identity in the settings object.

See also: mip::Identity

SetIdentity function

Set the Identity object.

Parameters:

  • identity: the unique identity of a user.

See also: mip::Identity

GetClientData function

Get the Client Data set in the settings.

Returns: A string of data specified by the client.

SetClientData function

Set the Client Data string.

Parameters:

  • clientData: user specified data.

GetLocale function

Get the Locale set in the settings.

Returns: The locale.

SetCustomSettings function

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

Parameters:

  • customSettings: List of name/value pairs.

GetCustomSettings function

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

Returns: List of name/value pairs.

SetSessionId function

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:

  • sessionId: An identifier (usually specified as a GUID) to uniquely identify this operation.

GetSessionId function

Get the session ID, a unique identifier.

Returns: The session ID.

IsLoadSensitivityTypesEnabled function

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

Returns: True if enabled else false.

SetCloud function

Optionally sets the target cloud.

Parameters:

  • cloud: Cloud

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

GetCloud function

Gets the target cloud used by all service requests.

Returns: Cloud

SetDataBoundary function

Optionally sets the target diagnostic region.

Parameters:

  • dataBoundary: Data boundary region

If dataBoundary is not specified, then it will default to global diagnostic region.

GetDataBoundary function

Gets the data boundary region.

Returns: DataBoundary

SetCloudEndpointBaseUrl function

Sets the cloud endpoint base URL for custom cloud.

Parameters:

  • cloudEndpointBaseUrl: the base URL used by all service requests (for example, "https://dataservice.protection.outlook.com")

This value will only be read and must be set for Cloud = Custom

GetCloudEndpointBaseUrl function

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

Returns: Base URL

SetDelegatedUserEmail function

Sets the delegated user.

Parameters:

  • delegatedUserEmail: the delegation email.

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

GetDelegatedUserEmail function

Gets the delegated user.

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

SetLabelFilter function

Sets the label filter.

Parameters:

  • labelFilter: the label filter.

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

GetLabelFilter function

Gets the label filters set through deprecated function SetLabelFilter.

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

ConfigureFunctionality function

Enables or disables functionality.

Parameters:

  • functionalityFilterType: the type of functionality.

  • enabled: True to enable, false to disable

HyokProtection, DoubleKeyProtection, DoubleKeyUserDefinedProtection are disabled by default and must be enabled

GetConfiguredFunctionality function

Gets the configured functionality.

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

SetVariableTextMarkingType function

Sets the variable text marking type.

Parameters:

  • variableTextMarkingType: the variable text marking type.

GetVariableTextMarkingType function

Gets the variable text marking type.

Returns: The variable text marking type.

SetAuthDelegate function

Set the Engine Auth Delegate.

Parameters:

  • authDelegate: the Auth delegate

GetAuthDelegate function

Get the Engine Auth Delegate.

Returns: The Engine Auth Delegate.

GetLoggerContext function

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

Returns: The logger context

SetLoggerContext function

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

Parameters:

  • loggerContext: The logger context