Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
PolicyEngine Class Referenceabstract

This class provides an interface for all engine functions. More...

#include <src/api/mip/upe/policy_engine.h>

Classes

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

Public Member Functions

virtual std::shared_ptr< PolicyHandlerCreatePolicyHandler (bool isAuditDiscoveryEnabled, bool isGetSensitivityLabelAuditDiscoveryEnabled=true)=0
 Create a Policy Handler to execute policy-related functions on a file's execution state.
 
virtual const std::vector< std::pair< std::string, std::string > > & GetCustomSettings () const =0
 Gets a list of custom settings.
 
virtual const std::shared_ptr< LabelGetDefaultSensitivityLabel (const std::string &contentFormat=std::string()) const =0
 Get the default sensitivity label according to the provided contentFormat.
 
virtual std::shared_ptr< LabelGetLabelById (const std::string &id) const =0
 Gets the label according to the provided id.
 
virtual std::chrono::time_point< std::chrono::system_clock > GetLastPolicyFetchTime () const =0
 Gets the time when the policy was last fetched.
 
virtual const std::string & GetMoreInfoUrl () const =0
 Provide a url for looking up more information about the policy/labels.
 
virtual const std::string & GetPolicyDataXml () const =0
 Gets policy data XML which describes the settings, labels, and rules associated with this policy.
 
virtual const std::string & GetPolicyFileId () const =0
 Gets the policy file ID.
 
virtual const std::string & GetSensitivityFileId () const =0
 Gets the sensitivity file ID.
 
virtual const std::string & GetSensitivityTypesDataXml () const =0
 Gets sensitivity types data XML which describes the sensitivity types associated with this policy.
 
virtual const SettingsGetSettings () const =0
 Get the policy engine Settings.
 
virtual const std::string & GetTenantId () const =0
 Gets tenant ID associated with engine.
 
virtual uint32_t GetWxpMetadataVersion () const =0
 Gets the recommended WXP (Word, Excel, Powerpoint) metadata version, currently 0 for old verion 1 for co-authoring enabled version.
 
virtual bool HasClassificationRules (const std::vector< std::string > &contentFormats=std::vector< std::string >()) const =0
 Gets if the policy has automatic or recommendation rules according to the provided contentFormats.
 
virtual bool HasWorkloadConsent (Workload workload) const =0
 Checks if user has consented to specific workload,.
 
virtual bool IsDowngradeJustificationRequired () const =0
 Checks if the policy dictates that given a label sensitivity level downgrade requires a justification message.
 
virtual bool IsLabelingRequired (const std::string &contentFormat=std::string()) const =0
 Checks if the policy dictates that a content must be labeled or not according to the provided contentFormat.
 
virtual const std::vector< std::shared_ptr< Label > > ListSensitivityLabels (const std::vector< std::string > &contentFormats=std::vector< std::string >())=0
 list the sensitivity labels associated with the policy engine according to the provided contentFormats.
 
virtual const std::vector< std::shared_ptr< SensitivityTypesRulePackage > > & ListSensitivityTypes () const =0
 list the sensitivity types associated with the policy engine.
 
virtual void SendApplicationAuditEvent (const std::string &level, const std::string &eventType, const std::string &eventData)=0
 Logs an application specific event to the audit pipeline.
 

Detailed Description

This class provides an interface for all engine functions.

Definition at line 55 of file policy_engine.h.

Member Function Documentation

◆ CreatePolicyHandler()

virtual std::shared_ptr< PolicyHandler > PolicyEngine::CreatePolicyHandler ( bool isAuditDiscoveryEnabled,
bool isGetSensitivityLabelAuditDiscoveryEnabled = true )
pure virtual

Create a Policy Handler to execute policy-related functions on a file's execution state.

Parameters
isAuditDiscoveryEnabledDescribes whether audit discovery is enabled or not.
Returns
Policy Handler.
Note
Application needs to keep the policy handler object for the lifetime of the document.

◆ GetCustomSettings()

virtual const std::vector< std::pair< std::string, std::string > > & PolicyEngine::GetCustomSettings ( ) const
pure virtual

Gets a list of custom settings.

Returns
a vector of custom settings.

◆ GetDefaultSensitivityLabel()

virtual const std::shared_ptr< Label > PolicyEngine::GetDefaultSensitivityLabel ( const std::string & contentFormat = std::string()) const
pure virtual

Get the default sensitivity label according to the provided contentFormat.

Parameters
contentFormatThe format to filter by when retrieving the default sensitivity label - example: "file", "email", etc. Set contentFormat to an empty string to retrieve the default sensitivity label for the default format.
Returns
default sensitivity label if exists, nullptr if there is no default label set.

◆ GetLabelById()

virtual std::shared_ptr< Label > PolicyEngine::GetLabelById ( const std::string & id) const
pure virtual

Gets the label according to the provided id.

Parameters
idIdentifier for the label.
Returns
Label

◆ GetLastPolicyFetchTime()

virtual std::chrono::time_point< std::chrono::system_clock > PolicyEngine::GetLastPolicyFetchTime ( ) const
pure virtual

Gets the time when the policy was last fetched.

Returns
the time when the policy was last fetched

◆ GetMoreInfoUrl()

virtual const std::string & PolicyEngine::GetMoreInfoUrl ( ) const
pure virtual

Provide a url for looking up more information about the policy/labels.

Returns
a url in string format.

◆ GetPolicyDataXml()

virtual const std::string & PolicyEngine::GetPolicyDataXml ( ) const
pure virtual

Gets policy data XML which describes the settings, labels, and rules associated with this policy.

Returns
Policy data XML.

◆ GetPolicyFileId()

virtual const std::string & PolicyEngine::GetPolicyFileId ( ) const
pure virtual

Gets the policy file ID.

Returns
a string that represent the policy file ID

◆ GetSensitivityFileId()

virtual const std::string & PolicyEngine::GetSensitivityFileId ( ) const
pure virtual

Gets the sensitivity file ID.

Returns
a string that represent the policy file ID

◆ GetSensitivityTypesDataXml()

virtual const std::string & PolicyEngine::GetSensitivityTypesDataXml ( ) const
pure virtual

Gets sensitivity types data XML which describes the sensitivity types associated with this policy.

Returns
Sensitivity types data XML.

◆ GetSettings()

virtual const Settings & PolicyEngine::GetSettings ( ) const
pure virtual

Get the policy engine Settings.

Returns
policy engine settings.
See also
mip::PolicyEngine::Settings

◆ GetTenantId()

virtual const std::string & PolicyEngine::GetTenantId ( ) const
pure virtual

Gets tenant ID associated with engine.

Returns
Tenant ID

◆ GetWxpMetadataVersion()

virtual uint32_t PolicyEngine::GetWxpMetadataVersion ( ) const
pure virtual

Gets the recommended WXP (Word, Excel, Powerpoint) metadata version, currently 0 for old verion 1 for co-authoring enabled version.

Returns
uint32_t int indecating what version of metadata the tenant supports for WXP files.

◆ HasClassificationRules()

virtual bool PolicyEngine::HasClassificationRules ( const std::vector< std::string > & contentFormats = std::vector< std::string >()) const
pure virtual

Gets if the policy has automatic or recommendation rules according to the provided contentFormats.

Parameters
contentFormatVector of formats to consider when determining if a rule is defined for any provided format. Set contentFormats to an empty vector indicates the provided contentFormats are default formats.
Returns
a bool that will tell if there any automatic or recommendation rules in the policy

◆ HasWorkloadConsent()

virtual bool PolicyEngine::HasWorkloadConsent ( Workload workload) const
pure virtual

Checks if user has consented to specific workload,.

Returns
bool indicating consent.

◆ IsDowngradeJustificationRequired()

virtual bool PolicyEngine::IsDowngradeJustificationRequired ( ) const
pure virtual

Checks if the policy dictates that given a label sensitivity level downgrade requires a justification message.

Returns
true if downgrade justification is required, else false.

◆ IsLabelingRequired()

virtual bool PolicyEngine::IsLabelingRequired ( const std::string & contentFormat = std::string()) const
pure virtual

Checks if the policy dictates that a content must be labeled or not according to the provided contentFormat.

Parameters
contentFormatThe format to filter by when determining whether a label is required - example: "file", "email", etc. Set contentFormat to an empty string to determine whether labeling is required for the default format.
Returns
true if labeling is mandatory, else false.

◆ ListSensitivityLabels()

virtual const std::vector< std::shared_ptr< Label > > PolicyEngine::ListSensitivityLabels ( const std::vector< std::string > & contentFormats = std::vector< std::string >())
pure virtual

list the sensitivity labels associated with the policy engine according to the provided contentFormats.

Parameters
contentFormatscontentFormats Vector of formats to filter the sensitivity labels by, such as "file", "email", etc. Set contentFormats to an empty vector to filter the sensitivity labels by the default formats.
Returns
a list of sensitivity labels.

◆ ListSensitivityTypes()

virtual const std::vector< std::shared_ptr< SensitivityTypesRulePackage > > & PolicyEngine::ListSensitivityTypes ( ) const
pure virtual

list the sensitivity types associated with the policy engine.

Returns
a list of sensitivity labels. empty if LoadSensitivityTypesEnabled was false (
See also
PolicyEngine::Settings).

◆ SendApplicationAuditEvent()

virtual void PolicyEngine::SendApplicationAuditEvent ( const std::string & level,
const std::string & eventType,
const std::string & eventData )
pure virtual

Logs an application specific event to the audit pipeline.

Parameters
levelof the log level: Info/Error/Warning.
eventTypea description of the type of event.
eventDatathe data associated with the event.

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