Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
policy_engine.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27/**
28 * @brief This file contains the PolicyEngine class which includes the PolicyEngine::Settings class.
29 *
30 * @file policy_engine.h
31 */
32
33#ifndef API_MIP_UPE_POLICY_ENGINE_H_
34#define API_MIP_UPE_POLICY_ENGINE_H_
35
36#include <memory>
37#include <string>
38#include <vector>
39
40#include "mip/common_types.h"
41#include "mip/error.h"
42#include "mip/mip_namespace.h"
43#include "mip/upe/action.h"
46#include "mip/upe/label.h"
49
50MIP_NAMESPACE_BEGIN
51
52/**
53 * @brief This class provides an interface for all engine functions.
54 */
56public:
57 /**
58 * @brief Defines the settings associated with a PolicyEngine.
59 */
60 class Settings {
61 public:
62 /**
63 * @brief PolicyEngine::Settings constructor for loading an existing engine.
64 *
65 * @param engineId Set it to the unique engine ID generated by AddEngineAsync or one self-generated. When loading an
66 * existing engine, reuse the ID else a new engine will be created.
67 * @param authDelegate The authentication delegate used by the SDK to acquire authentication tokens, will override the
68 * PolicyProfile::Settings::authDelegate if both provided
69 * @param clientData customizable client data that can be stored with the engine when unloaded, can be retrieved from
70 * a loaded engine.
71 * @param locale engine localizable output will be provided in this locale.
72 * @param Optional flag indicating when the engine is loaded should load also custom sensitivity types,
73 * if true OnPolicyChange Observer on the profile will be invoked on updates to custom sensitivity types as well as policy changes.
74 * if false ListSensitivityTypes call will always return an empty list.
75 */
77 const std::string& engineId,
78 const std::shared_ptr<AuthDelegate>& authDelegate,
79 const std::string& clientData,
80 const std::string& locale = "",
81 bool loadSensitivityTypes = false)
82 : mEngineId(engineId),
83 mAuthDelegate(authDelegate),
84 mClientData(clientData),
85 mLocale(locale),
86 mIsLoadSensitivityTypesEnabled(loadSensitivityTypes) {
87 if (mLocale.compare("") == 0) {
88 mLocale = "en-US";
89 }
90 }
91
92 /**
93 * @brief PolicyEngine::Settings constructor for creating a new engine.
94 *
95 * @param identity Identity info of the user associated with the new engine.
96 * @param authDelegate The authentication delegate used by the SDK to acquire authentication tokens, will override the
97 * PolicyProfile::Settings::authDelegate if both provided
98 * @param clientData customizable client data that can be stored with the engine when unloaded, can be retrieved from
99 * a loaded engine.
100 * @param locale engine localizable output will be provided in this locale.
101 * @param Optional flag indicating when the engine is loaded should load also custom sensitivity types,
102 * if true OnPolicyChange Observer on the profile will be invoked on updates to custom sensitivity types as well as policy changes.
103 * if false ListSensitivityTypes call will always return an empty list.
104 */
106 const Identity& identity,
107 const std::shared_ptr<AuthDelegate>& authDelegate,
108 const std::string& clientData,
109 const std::string& locale = "",
110 bool loadSensitivityTypes = false)
111 : mIdentity(identity),
112 mAuthDelegate(authDelegate),
113 mClientData(clientData),
114 mLocale(locale),
115 mIsLoadSensitivityTypesEnabled(loadSensitivityTypes) {
116 if (mLocale.compare("") == 0) {
117 mLocale = "en-US";
118 }
119 }
120
121 /**
122 * @brief Get the engine ID.
123 *
124 * @return a unique string identifying the engine.
125 */
126 const std::string& GetEngineId() const { return mEngineId; }
127
128 /**
129 * @brief Set the engine ID.
130 *
131 * @param id engine ID.
132 */
133 void SetEngineId(const std::string& id) { mEngineId = id; }
134
135 /**
136 * @brief Get the Identity object.
137 *
138 * @return a reference to the identity in the settings object.
139 * @see mip::Identity
140 */
141 const Identity& GetIdentity() const { return mIdentity; }
142
143 /**
144 * @brief Set the Identity object.
145 *
146 * @param identity the unique identity of a user.
147 * @see mip::Identity
148 */
149 void SetIdentity(const Identity& identity) { mIdentity = identity; }
150
151 /**
152 * @brief Get the Client Data set in the settings.
153 *
154 * @return a string of data specified by the client.
155 */
156 const std::string& GetClientData() const { return mClientData; }
157
158 /**
159 * @brief Set the Client Data string.
160 *
161 * @param clientData user specified data.
162 */
163 void SetClientData(const std::string& clientData) { mClientData = clientData; }
164
165 /**
166 * @brief Get the Locale set in the settings.
167 *
168 * @return the locale.
169 */
170 const std::string& GetLocale() const { return mLocale; }
171
172 /**
173 * @brief Set the custom settings, used for feature gating and testing.
174 *
175 * @param customSettings List of name/value pairs.
176 */
177 void SetCustomSettings(const std::vector<std::pair<std::string, std::string>>& customSettings) {
178 mCustomSettings = customSettings;
179 }
180
181 /**
182 * @brief Get the custom settings, used for feature gating and testing.
183 *
184 * @return List of name/value pairs.
185 */
186 const std::vector<std::pair<std::string, std::string>>& GetCustomSettings() const {
187 return mCustomSettings;
188 }
189
190 /**
191 * @brief Set the session ID, used for client defined telemetry
192 * and to make it easier to correlate application events with the corresponding policy service REST requests.
193 *
194 * @param sessionId An identifier (usually specified as a GUID) to uniquely identify this operation.
195 */
196 void SetSessionId(const std::string& sessionId) {
197 mSessionId = sessionId;
198 }
199
200 /**
201 * @brief Get the session ID, a unique identifier.
202 *
203 * @return the session ID.
204 */
205 const std::string& GetSessionId() const {
206 return mSessionId;
207 }
208
209 /**
210 * @brief Get the the flag indicating if load sensitivity labels is enabled.
211 *
212 * @return true if enabled else false.
213 */
215 return mIsLoadSensitivityTypesEnabled;
216 }
217
218 /**
219 * @brief Optionally sets the target cloud
220 *
221 * @param cloud Cloud
222 *
223 * @note If cloud is not specified, then it will default to commercial cloud.
224 */
225 void SetCloud(Cloud cloud) {
226 mCloud = cloud;
227 }
228
229 /**
230 * @brief Gets the target cloud used by all service requests
231 *
232 * @return cloud
233 */
234 Cloud GetCloud() const {
235 return mCloud;
236 }
237
238 /**
239 * @brief Optionally sets the target diagnostic region
240 *
241 * @param dataBoundary Data boundary region
242 *
243 * @note If dataBoundary is not specified, then it will default to global diagnostic region.
244 */
245 void SetDataBoundary(DataBoundary dataBoundary) {
246 mDataBoundary = dataBoundary;
247 }
248
249 /**
250 * @brief Gets the data boundary region
251 *
252 * @return DataBoundary
253 */
255 return mDataBoundary;
256 }
257
258 /**
259 * @brief Sets the cloud endpoint base URL for custom cloud
260 *
261 * @param cloudEndpointBaseUrl the base URL used by all service requests (for example, "https://dataservice.protection.outlook.com")
262 *
263 * @note This value will only be read and must be set for Cloud = Custom
264 */
265 void SetCloudEndpointBaseUrl(const std::string& cloudEndpointBaseUrl) {
266 mCloudEndpointBaseUrl = cloudEndpointBaseUrl;
267 }
268
269 /**
270 * @brief Gets the cloud base URL used by all service requests, if specified
271 *
272 * @return base URL
273 */
274 const std::string& GetCloudEndpointBaseUrl() const {
275 return mCloudEndpointBaseUrl;
276 }
277
278 /**
279 * @brief Sets the delegated user
280 *
281 * @param delegatedUserEmail the delegation email.
282 *
283 * @note A delegated user is specified when the authenticating user/application is acting on behalf of another user
284 */
285 void SetDelegatedUserEmail(const std::string& delegatedUserEmail) { mDelegatedUserEmail = delegatedUserEmail; }
286
287 /**
288 * @brief Gets the delegated user
289 *
290 * @return Delegated user
291 *
292 * @note A delegated user is specified when the authenticating user/application is acting on behalf of another user
293 */
294 const std::string& GetDelegatedUserEmail() const { return mDelegatedUserEmail; }
295
296 /**
297 * @brief Sets the label filter
298 *
299 * @param labelFilter the label filter.
300 *
301 * @note Labels are by default filter to scope, this api is to allow filtering by possible actions.
302 * @note If not set HyokProtection and DoubleKeyProtection are filtered.
303 */
304#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
305 [[deprecated("SetLabelFilter is deprecated, use ConfigureFunctionality")]]
306#endif
307 void SetLabelFilter(const std::vector<LabelFilterType>& deprecatedLabelFilters) {
308 mDeprecatedLabelFilters = deprecatedLabelFilters;
309 }
310 /**
311 * @brief Gets the label filters set through deprecated function SetLabelFilter
312 *
313 * @return the label filter.
314 *
315 * @note Labels are by default filter to scope, this api is to allow filtering by possible actions.
316 */
317 const std::vector<LabelFilterType>& GetLabelFilter() const { return mDeprecatedLabelFilters; }
318
319 /**
320 * @brief Enables or disables functionality
321 *
322 * @param functionalityFilterType the type of functionality.
323 * @param enabled True to enable, false to disable
324 *
325 * @note HyokProtection, DoubleKeyProtection, DoubleKeyUserDefinedProtection are disabled by default and must be enabled
326 */
327 void ConfigureFunctionality(FunctionalityFilterType functionalityFilterType, bool enabled) {
328 if(functionalityFilterType == FunctionalityFilterType::None) {
329 throw BadInputError(
330 "FunctionalityFilterType::None is not supported");
331 }
332
333 mConfiguredFunctionality[functionalityFilterType] = enabled;
334 }
335
336 /**
337 * @brief Gets the configured functionality
338 *
339 * @return A map of the types to a boolean value indicating whether or not it is enabled
340 */
341 const std::map<FunctionalityFilterType, bool>& GetConfiguredFunctionality() const { return mConfiguredFunctionality; }
342
343 /**
344 * @brief Sets the variable text marking type
345 *
346 * @param variableTextMarkingType the variable text marking type.
347 *
348 */
350 mVariableTextMarkingType = variableTextMarkingType;
351 }
352
353 /**
354 * @brief Gets the variable text marking type
355 *
356 * @return the variable text marking type.
357 *
358 */
360 return mVariableTextMarkingType;
361 }
362
363 /**
364 * @brief Set the Engine Auth Delegate.
365 *
366 * @param authDelegate the Auth delegate
367 */
368 void SetAuthDelegate(const std::shared_ptr<AuthDelegate>& authDelegate) {
369 mAuthDelegate = authDelegate;
370 }
371
372 /**
373 * @brief Get the Engine Auth Delegate.
374 *
375 * @return the Engine Auth Delegate.
376 */
377 std::shared_ptr<AuthDelegate> GetAuthDelegate() const { return mAuthDelegate; }
378
379#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
380 /**
381 * @brief Get logger context that will be opaquely passed to the logger delegate for logs associated with the created engine
382 *
383 * @return The logger context
384 */
385 const std::shared_ptr<void>& GetLoggerContext() const { return mLoggerContext; }
386#endif
387 /**
388 * @brief Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created engine
389 *
390 * @param loggerContext The logger context
391 *
392 */
393 void SetLoggerContext(const std::shared_ptr<void>& loggerContext) {
394 mLoggerContext = loggerContext;
395 }
396
397 /** @cond DOXYGEN_HIDE */
398 ~Settings() {}
399 private:
400 std::string mEngineId;
401 Identity mIdentity;
402 Cloud mCloud = Cloud::Unknown;
403 DataBoundary mDataBoundary = DataBoundary::Default;
404 std::shared_ptr<AuthDelegate> mAuthDelegate;
405 std::string mClientData;
406 std::vector<std::pair<std::string, std::string>> mCustomSettings;
407 std::vector<LabelFilterType> mDeprecatedLabelFilters; // Labels that the client does not want to view
408 std::map<FunctionalityFilterType, bool> mConfiguredFunctionality; // Functionality that has been turned on or off
409 std::string mLocale;
410 std::string mSessionId;
411 bool mIsLoadSensitivityTypesEnabled;
412 std::string mCloudEndpointBaseUrl;
413 std::string mDelegatedUserEmail;
415 std::map<Classifier, bool> mClassifierSupport; // Overwritten classifiers that the application elects to support or not
416 std::shared_ptr<void> mLoggerContext;
417 /** @endcond */
418 };
419
420 /**
421 * @brief Get the policy engine Settings.
422 *
423 * @return policy engine settings.
424 * @see mip::PolicyEngine::Settings
425 */
426 virtual const Settings& GetSettings() const = 0;
427
428 /**
429 * @brief list the sensitivity labels associated with the policy engine according to the provided contentFormats.
430 *
431 * @param contentFormats contentFormats Vector of formats to filter the sensitivity labels by, such as "file", "email", etc.
432 * Set contentFormats to an empty vector to filter the sensitivity labels by the default formats.
433 *
434 * @return a list of sensitivity labels.
435 */
436 virtual const std::vector<std::shared_ptr<Label>> ListSensitivityLabels(
437 const std::vector<std::string>& contentFormats = std::vector<std::string>()) = 0;
438
439 /**
440 * @brief list the sensitivity types associated with the policy engine.
441 *
442 * @return a list of sensitivity labels. empty if LoadSensitivityTypesEnabled was false (@see PolicyEngine::Settings).
443 */
444 virtual const std::vector<std::shared_ptr<SensitivityTypesRulePackage>>& ListSensitivityTypes() const = 0;
445
446 /**
447 * @brief Provide a url for looking up more information about the policy/labels.
448 *
449 * @return a url in string format.
450 */
451 virtual const std::string& GetMoreInfoUrl() const = 0;
452
453 /**
454 * @brief Checks if the policy dictates that a content must be labeled or not according to the provided contentFormat.
455 *
456 * @param contentFormat The format to filter by when determining whether a label is required - example: "file", "email", etc.
457 * Set contentFormat to an empty string to determine whether labeling is required for the default format.
458 *
459 * @return true if labeling is mandatory, else false.
460 */
461 virtual bool IsLabelingRequired(const std::string& contentFormat = std::string()) const = 0;
462
463 /**
464 * @brief Checks if the policy dictates that given a label sensitivity level downgrade requires a justification message.
465 *
466 * @return true if downgrade justification is required, else false.
467 */
468 virtual bool IsDowngradeJustificationRequired() const = 0;
469
470 /**
471 * @brief Get the default sensitivity label according to the provided contentFormat.
472 *
473 * @param contentFormat The format to filter by when retrieving the default sensitivity label - example: "file", "email", etc.
474 * Set contentFormat to an empty string to retrieve the default sensitivity label for the default format.
475 *
476 * @return default sensitivity label if exists, nullptr if there is no default label set.
477 */
478 virtual const std::shared_ptr<Label> GetDefaultSensitivityLabel(const std::string& contentFormat = std::string()) const = 0;
479
480 /**
481 * @brief Gets the label according to the provided id.
482 *
483 * @param id Identifier for the label.
484 *
485 * @return Label
486 */
487 virtual std::shared_ptr<Label> GetLabelById(const std::string& id) const = 0;
488
489 /**
490 * @brief Create a Policy Handler to execute policy-related functions on a file's execution state.
491 *
492 * @param isAuditDiscoveryEnabled Describes whether audit discovery is enabled or not.
493 *
494 * @return Policy Handler.
495 *
496 * @note Application needs to keep the policy handler object for the lifetime of the document.
497 */
498 virtual std::shared_ptr<PolicyHandler> CreatePolicyHandler(bool isAuditDiscoveryEnabled, bool isGetSensitivityLabelAuditDiscoveryEnabled = true) = 0;
499
500 /**
501 * @brief Logs an application specific event to the audit pipeline.
502 *
503 * @param level of the log level: Info/Error/Warning.
504 * @param eventType a description of the type of event.
505 * @param eventData the data associated with the event.
506 */
508 const std::string& level,
509 const std::string& eventType,
510 const std::string& eventData) = 0;
511
512 /**
513 * @brief Gets tenant ID associated with engine
514 *
515 * @return Tenant ID
516 */
517 virtual const std::string& GetTenantId() const = 0;
518
519 /**
520 * @brief Gets policy data XML which describes the settings, labels, and rules associated with this policy.
521 *
522 * @return Policy data XML.
523 */
524 virtual const std::string& GetPolicyDataXml() const = 0;
525
526 /**
527 * @brief Gets sensitivity types data XML which describes the sensitivity types associated with this policy.
528 *
529 * @return Sensitivity types data XML.
530 */
531 virtual const std::string& GetSensitivityTypesDataXml() const = 0;
532
533 /**
534 * @brief Gets a list of custom settings.
535 *
536 * @return a vector of custom settings.
537 */
538 virtual const std::vector<std::pair<std::string, std::string>>& GetCustomSettings() const = 0;
539
540 /**
541 * @brief Gets the policy file ID
542 *
543 * @return a string that represent the policy file ID
544 */
545 virtual const std::string& GetPolicyFileId() const = 0;
546
547 /**
548 * @brief Gets the sensitivity file ID
549 *
550 * @return a string that represent the policy file ID
551 */
552 virtual const std::string& GetSensitivityFileId() const = 0;
553
554 /**
555 * @brief Gets if the policy has automatic or recommendation rules according to the provided contentFormats
556 *
557 * @param contentFormat Vector of formats to consider when determining if a rule is defined for any provided format.
558 * Set contentFormats to an empty vector indicates the provided contentFormats are default formats.
559 *
560 * @return a bool that will tell if there any automatic or recommendation rules in
561 * the policy
562 */
563 virtual bool HasClassificationRules(const std::vector<std::string>& contentFormats = std::vector<std::string>()) const = 0;
564
565 /**
566 * @brief Gets the time when the policy was last fetched
567 *
568 * @return the time when the policy was last fetched
569 */
570 virtual std::chrono::time_point<std::chrono::system_clock> GetLastPolicyFetchTime() const = 0;
571
572 /**
573 * @brief Gets the recommended WXP (Word, Excel, Powerpoint) metadata version, currently 0 for old verion
574 * 1 for co-authoring enabled version.
575 *
576 * @return uint32_t int indecating what version of metadata the tenant supports for WXP files.
577 */
578 virtual uint32_t GetWxpMetadataVersion() const = 0;
579
580 /**
581 * @brief Checks if user has consented to specific workload,
582 *
583 * @return bool indicating consent.
584 */
585 virtual bool HasWorkloadConsent(Workload workload) const = 0;
586
587 /** @cond DOXYGEN_HIDE */
588
589 virtual ~PolicyEngine() { }
590
591protected:
592 PolicyEngine() {}
593
594 /** @endcond */
595};
596
597MIP_NAMESPACE_END
598
599#endif // API_MIP_UPE_POLICY_ENGINE_H_
A file containing the Action base class and the ActionType enumerator.
Bad input error, thrown when the input to an SDK API is invalid.
Definition error.h:247
Abstraction for identity.
Defines the settings associated with a PolicyEngine.
void SetCustomSettings(const std::vector< std::pair< std::string, std::string > > &customSettings)
Set the custom settings, used for feature gating and testing.
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 ...
Cloud GetCloud() const
Gets the target cloud used by all service requests.
const std::map< FunctionalityFilterType, bool > & GetConfiguredFunctionality() const
Gets the configured functionality.
const std::string & GetClientData() const
Get the Client Data set in the settings.
void SetDataBoundary(DataBoundary dataBoundary)
Optionally sets the target diagnostic region.
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 ...
void SetLabelFilter(const std::vector< LabelFilterType > &deprecatedLabelFilters)
Sets the label filter.
void SetIdentity(const Identity &identity)
Set the Identity object.
const std::string & GetEngineId() const
Get the engine ID.
const std::string & GetLocale() const
Get the Locale set in the settings.
const std::vector< LabelFilterType > & GetLabelFilter() const
Gets the label filters set through deprecated function SetLabelFilter.
const Identity & GetIdentity() const
Get the Identity object.
const std::shared_ptr< void > & GetLoggerContext() const
Get logger context that will be opaquely passed to the logger delegate for logs associated with the c...
void SetDelegatedUserEmail(const std::string &delegatedUserEmail)
Sets the delegated user.
bool IsLoadSensitivityTypesEnabled() const
Get the the flag indicating if load sensitivity labels is enabled.
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.
DataBoundary GetDataBoundary() const
Gets the data boundary region.
VariableTextMarkingType GetVariableTextMarkingType() const
Gets the variable text marking type.
const std::string & GetSessionId() const
Get the session ID, a unique identifier.
void SetEngineId(const std::string &id)
Set the engine ID.
const std::string & GetCloudEndpointBaseUrl() const
Gets the cloud base URL used by all service requests, if specified.
std::shared_ptr< AuthDelegate > GetAuthDelegate() const
Get the Engine Auth Delegate.
void SetVariableTextMarkingType(VariableTextMarkingType variableTextMarkingType)
Sets the variable text marking type.
const std::string & GetDelegatedUserEmail() const
Gets the delegated user.
void SetCloud(Cloud cloud)
Optionally sets the target cloud.
void SetAuthDelegate(const std::shared_ptr< AuthDelegate > &authDelegate)
Set the Engine Auth Delegate.
void ConfigureFunctionality(FunctionalityFilterType functionalityFilterType, bool enabled)
Enables or disables functionality.
void SetCloudEndpointBaseUrl(const std::string &cloudEndpointBaseUrl)
Sets the cloud endpoint base URL for custom cloud.
void SetClientData(const std::string &clientData)
Set the Client Data string.
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.
This class provides an interface for all engine functions.
virtual const std::string & GetSensitivityFileId() const =0
Gets the sensitivity file ID.
virtual std::chrono::time_point< std::chrono::system_clock > GetLastPolicyFetchTime() const =0
Gets the time when the policy was last fetched.
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 const std::string & GetMoreInfoUrl() const =0
Provide a url for looking up more information about the policy/labels.
virtual const std::string & GetTenantId() const =0
Gets tenant ID associated with engine.
virtual bool HasWorkloadConsent(Workload workload) const =0
Checks if user has consented to specific workload,.
virtual const std::vector< std::pair< std::string, std::string > > & GetCustomSettings() const =0
Gets a list of custom settings.
virtual std::shared_ptr< PolicyHandler > CreatePolicyHandler(bool isAuditDiscoveryEnabled, bool isGetSensitivityLabelAuditDiscoveryEnabled=true)=0
Create a Policy Handler to execute policy-related functions on a file's execution state.
virtual bool IsDowngradeJustificationRequired() const =0
Checks if the policy dictates that given a label sensitivity level downgrade requires a justification...
virtual const std::shared_ptr< Label > GetDefaultSensitivityLabel(const std::string &contentFormat=std::string()) const =0
Get the default sensitivity label according to the provided contentFormat.
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 content...
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.
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::vector< std::shared_ptr< SensitivityTypesRulePackage > > & ListSensitivityTypes() const =0
list the sensitivity types associated with the policy engine.
virtual std::shared_ptr< Label > GetLabelById(const std::string &id) const =0
Gets the label according to the provided id.
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 contentFormat...
virtual const std::string & GetSensitivityTypesDataXml() const =0
Gets sensitivity types data XML which describes the sensitivity types associated with this policy.
virtual const std::string & GetPolicyFileId() const =0
Gets the policy file ID.
virtual uint32_t GetWxpMetadataVersion() const =0
Gets the recommended WXP (Word, Excel, Powerpoint) metadata version, currently 0 for old verion 1 for...
virtual const Settings & GetSettings() const =0
Get the policy engine Settings.
A file Containing the common types used by the upe, file and protection modules.
Cloud
Azure cloud identifier.
@ Unknown
Cloud not specified or URL not recognized as an Azure cloud.
VariableTextMarkingType
various dynamic fields can be set into the text message of the application Some known: ${Item....
@ Default
Known markings are converted unknown marking are removed.
Workload
The workload the application is working on, used primary to check for consent.
LabelFilterType
Label filter types, optional set of properties that can be used to filter labels or label behavior wh...
@ None
Disable default labeling filtration.
DataBoundary
Diagnostic region identifier.
@ Default
Region is not specified.
A file Containing the ContentLabel class.
A file containing the MIP SDK error types.
This file contains the ExecutionState class.
This file contains the Label class.
MIP namespace macros.
This file contains the PolicyHandler class.