33#ifndef API_MIP_UPE_POLICY_ENGINE_H_
34#define API_MIP_UPE_POLICY_ENGINE_H_
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),
86 mIsLoadSensitivityTypesEnabled(loadSensitivityTypes) {
87 if (mLocale.compare(
"") == 0) {
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),
115 mIsLoadSensitivityTypesEnabled(loadSensitivityTypes) {
116 if (mLocale.compare(
"") == 0) {
126 const std::string& GetEngineId()
const {
return mEngineId; }
133 void SetEngineId(
const std::string&
id) { mEngineId = id; }
141 const Identity& GetIdentity()
const {
return mIdentity; }
149 void SetIdentity(
const Identity& identity) { mIdentity = identity; }
156 const std::string& GetClientData()
const {
return mClientData; }
163 void SetClientData(
const std::string& clientData) { mClientData = clientData; }
170 const std::string& GetLocale()
const {
return mLocale; }
177 void SetCustomSettings(
const std::vector<std::pair<std::string, std::string>>& customSettings) {
178 mCustomSettings = customSettings;
186 const std::vector<std::pair<std::string, std::string>>& GetCustomSettings()
const {
187 return mCustomSettings;
196 void SetSessionId(
const std::string& sessionId) {
197 mSessionId = sessionId;
205 const std::string& GetSessionId()
const {
214 bool IsLoadSensitivityTypesEnabled()
const {
215 return mIsLoadSensitivityTypesEnabled;
225 void SetCloud(
Cloud cloud) {
234 Cloud GetCloud()
const {
246 mDataBoundary = dataBoundary;
255 return mDataBoundary;
265 void SetCloudEndpointBaseUrl(
const std::string& cloudEndpointBaseUrl) {
266 mCloudEndpointBaseUrl = cloudEndpointBaseUrl;
274 const std::string& GetCloudEndpointBaseUrl()
const {
275 return mCloudEndpointBaseUrl;
285 void SetDelegatedUserEmail(
const std::string& delegatedUserEmail) { mDelegatedUserEmail = delegatedUserEmail; }
294 const std::string& GetDelegatedUserEmail()
const {
return mDelegatedUserEmail; }
304#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
305 [[deprecated(
"SetLabelFilter is deprecated, use ConfigureFunctionality")]]
307 void SetLabelFilter(
const std::vector<LabelFilterType>& deprecatedLabelFilters) {
308 mDeprecatedLabelFilters = deprecatedLabelFilters;
317 const std::vector<LabelFilterType>& GetLabelFilter()
const {
return mDeprecatedLabelFilters; }
330 "FunctionalityFilterType::None is not supported");
333 mConfiguredFunctionality[functionalityFilterType] = enabled;
341 const std::map<FunctionalityFilterType, bool>& GetConfiguredFunctionality()
const {
return mConfiguredFunctionality; }
350 mVariableTextMarkingType = variableTextMarkingType;
360 return mVariableTextMarkingType;
368 void SetAuthDelegate(
const std::shared_ptr<AuthDelegate>& authDelegate) {
369 mAuthDelegate = authDelegate;
377 std::shared_ptr<AuthDelegate> GetAuthDelegate()
const {
return mAuthDelegate; }
379#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
385 const std::shared_ptr<void>& GetLoggerContext()
const {
return mLoggerContext; }
393 void SetLoggerContext(
const std::shared_ptr<void>& loggerContext) {
394 mLoggerContext = loggerContext;
400 std::string mEngineId;
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;
408 std::map<FunctionalityFilterType, bool> mConfiguredFunctionality;
410 std::string mSessionId;
411 bool mIsLoadSensitivityTypesEnabled;
412 std::string mCloudEndpointBaseUrl;
413 std::string mDelegatedUserEmail;
415 std::map<Classifier, bool> mClassifierSupport;
416 std::shared_ptr<void> mLoggerContext;
436 virtual const std::vector<std::shared_ptr<Label>> ListSensitivityLabels(
437 const std::vector<std::string>& contentFormats = std::vector<std::string>()) = 0;
444 virtual const std::vector<std::shared_ptr<SensitivityTypesRulePackage>>& ListSensitivityTypes()
const = 0;
451 virtual const std::string& GetMoreInfoUrl()
const = 0;
461 virtual bool IsLabelingRequired(
const std::string& contentFormat = std::string())
const = 0;
468 virtual bool IsDowngradeJustificationRequired()
const = 0;
478 virtual const std::shared_ptr<Label> GetDefaultSensitivityLabel(
const std::string& contentFormat = std::string())
const = 0;
487 virtual std::shared_ptr<Label> GetLabelById(
const std::string&
id)
const = 0;
498 virtual std::shared_ptr<PolicyHandler> CreatePolicyHandler(
bool isAuditDiscoveryEnabled,
bool isGetSensitivityLabelAuditDiscoveryEnabled =
true) = 0;
507 virtual void SendApplicationAuditEvent(
508 const std::string& level,
509 const std::string& eventType,
510 const std::string& eventData) = 0;
517 virtual const std::string& GetTenantId()
const = 0;
524 virtual const std::string& GetPolicyDataXml()
const = 0;
531 virtual const std::string& GetSensitivityTypesDataXml()
const = 0;
538 virtual const std::vector<std::pair<std::string, std::string>>& GetCustomSettings()
const = 0;
545 virtual const std::string& GetPolicyFileId()
const = 0;
552 virtual const std::string& GetSensitivityFileId()
const = 0;
563 virtual bool HasClassificationRules(
const std::vector<std::string>& contentFormats = std::vector<std::string>())
const = 0;
570 virtual std::chrono::time_point<std::chrono::system_clock> GetLastPolicyFetchTime()
const = 0;
578 virtual uint32_t GetWxpMetadataVersion()
const = 0;
585 virtual bool HasWorkloadConsent(
Workload workload)
const = 0;
588 virtual ~PolicyEngine() { }
A file containing the Action base class and the ActionType enumerator.
Abstraction for identity.
Definition common_types.h:278
A file Containing the common types used by the upe, file and protection modules.
Cloud
Azure cloud identifier.
Definition common_types.h:752
VariableTextMarkingType
various dynamic fields can be set into the text message of the application Some known: ${Item....
Definition common_types.h:167
Workload
The workload the application is working on, used primary to check for consent.
Definition common_types.h:210
LabelFilterType
Label filter types, optional set of properties that can be used to filter labels or label behavior wh...
Definition common_types.h:114
@ None
Definition common_types.h:115
DataBoundary
Diagnostic region identifier for non-sovereign clouds.
Definition common_types.h:769
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.
This file contains the PolicyHandler class.
virtual const Settings & GetSettings() const =0
Get the settings set on the profile.