28#ifndef API_MIP_FILE_FILE_ENGINE_H_
29#define API_MIP_FILE_FILE_ENGINE_H_
69 const std::string& engineId,
70 const std::shared_ptr<AuthDelegate>& authDelegate,
71 const std::string& clientData,
72 const std::string& locale =
"",
73 bool loadSensitivityTypes =
false)
74 : mEngineId(engineId),
75 mAuthDelegate(authDelegate),
76 mClientData(clientData),
78 mIsLoadSensitivityTypesEnabled(loadSensitivityTypes) {
79 if (mLocale.compare(
"") == 0) {
99 const std::shared_ptr<AuthDelegate>& authDelegate,
100 const std::string& clientData,
101 const std::string& locale =
"",
102 bool loadSensitivityTypes =
false)
103 : mIdentity(identity),
104 mAuthDelegate(authDelegate),
105 mClientData(clientData),
107 mIsLoadSensitivityTypesEnabled(loadSensitivityTypes) {
108 if (mLocale.compare(
"") == 0) {
116 const std::string& GetEngineId()
const {
return mEngineId; }
123 void SetEngineId(
const std::string&
id) { mEngineId = id; }
128 const Identity& GetIdentity()
const {
return mIdentity; }
133 void SetIdentity(
const Identity& identity) { mIdentity = identity; }
138 const std::string& GetClientData()
const {
return mClientData; }
143 const std::string& GetLocale()
const {
return mLocale; }
148 void SetCustomSettings(
const std::vector<std::pair<std::string, std::string>>& value) { mCustomSettings = value; }
153 const std::vector<std::pair<std::string, std::string>>& GetCustomSettings()
const {
return mCustomSettings; }
158 void SetSessionId(
const std::string& sessionId) {
159 mSessionId = sessionId;
165 const std::string& GetSessionId()
const {
176 void SetCloud(
Cloud cloud) {
185 Cloud GetCloud()
const {
197 mDataBoundary = dataBoundary;
206 return mDataBoundary;
216 void SetProtectionCloudEndpointBaseUrl(
const std::string& protectionCloudEndpointBaseUrl) {
217 mProtectionCloudEndpointBaseUrl = protectionCloudEndpointBaseUrl;
227 const std::string& GetProtectionCloudEndpointBaseUrl()
const {
228 return mProtectionCloudEndpointBaseUrl;
236 void SetPolicyCloudEndpointBaseUrl(
const std::string& policyCloudEndpointBaseUrl) {
237 mPolicyCloudEndpointBaseUrl = policyCloudEndpointBaseUrl;
245 const std::string& GetPolicyCloudEndpointBaseUrl()
const {
246 return mPolicyCloudEndpointBaseUrl;
252 void SetProtectionOnlyEngine(
bool protectionOnly) {
253 mProtectionOnlyEngine = protectionOnly;
259 const bool IsProtectionOnlyEngine()
const {
260 return mProtectionOnlyEngine;
268 bool IsLoadSensitivityTypesEnabled()
const {
269 return mIsLoadSensitivityTypesEnabled;
275 void EnablePFile(
bool value) {
276 mEnablePFile = value;
284 const bool IsPFileEnabled() {
295 void SetDelegatedUserEmail(
const std::string& delegatedUserEmail) { mDelegatedUserEmail = delegatedUserEmail; }
304 const std::string& GetDelegatedUserEmail()
const {
return mDelegatedUserEmail; }
314#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
315 [[deprecated(
"SetLabelFilter is deprecated, use ConfigureFunctionality")]]
317 void SetLabelFilter(
const std::vector<LabelFilterType>& deprecatedLabelFilters) { mDeprecatedLabelFilters = deprecatedLabelFilters; }
326 const std::vector<LabelFilterType>& GetLabelFilter()
const {
return mDeprecatedLabelFilters; }
339 "FunctionalityFilterType::None is not supported");
342 mConfiguredFunctionality[functionalityFilterType] = enabled;
350 const std::map<FunctionalityFilterType, bool>& GetConfiguredFunctionality()
const {
351 return mConfiguredFunctionality;
359 void SetAuthDelegate(
const std::shared_ptr<AuthDelegate>& authDelegate) {
360 mAuthDelegate = authDelegate;
368 std::shared_ptr<AuthDelegate> GetAuthDelegate()
const {
return mAuthDelegate; }
370#if !defined(SWIG) && !defined(SWIG_DIRECTORS)
376 const std::shared_ptr<void>& GetLoggerContext()
const {
return mLoggerContext; }
384 void SetLoggerContext(
const std::shared_ptr<void>& loggerContext) {
385 mLoggerContext = loggerContext;
389 std::string mEngineId;
393 std::shared_ptr<AuthDelegate> mAuthDelegate;
394 std::string mClientData;
395 std::vector<std::pair<std::string, std::string>> mCustomSettings;
396 std::vector<LabelFilterType> mDeprecatedLabelFilters;
397 std::map<FunctionalityFilterType, bool> mConfiguredFunctionality;
398 std::string mProtectionCloudEndpointBaseUrl;
399 std::string mPolicyCloudEndpointBaseUrl;
401 std::string mSessionId;
402 bool mProtectionOnlyEngine =
false;
403 bool mIsLoadSensitivityTypesEnabled;
404 bool mEnablePFile =
true;
405 std::string mDelegatedUserEmail;
406 std::shared_ptr<void> mLoggerContext;
410 virtual ~FileEngine() {}
416 virtual const Settings& GetSettings()
const = 0;
423 virtual const std::vector<std::shared_ptr<SensitivityTypesRulePackage>>& ListSensitivityTypes()
const = 0;
430 virtual const std::shared_ptr<Label> GetDefaultSensitivityLabel()
const = 0;
435 virtual std::shared_ptr<Label> GetLabelById(
const std::string&
id)
const = 0;
440 virtual const std::vector<std::shared_ptr<Label>> ListSensitivityLabels() = 0;
447 virtual const std::string& GetMoreInfoUrl()
const = 0;
454 virtual const std::string& GetPolicyFileId()
const = 0;
461 virtual const std::string& GetSensitivityFileId()
const = 0;
468 virtual bool IsLabelingRequired()
const = 0;
475 virtual std::chrono::time_point<std::chrono::system_clock> GetLastPolicyFetchTime()
const = 0;
482 virtual const std::string& GetPolicyDataXml()
const = 0;
496 virtual std::shared_ptr<AsyncControl> CreateFileHandlerAsync(
497 const std::string& inputFilePath,
498 const std::string& filePathForAuditReporting,
499 bool isAuditDiscoveryEnabled,
500 const std::shared_ptr<FileHandler::Observer>& fileHandlerObserver,
501 const std::shared_ptr<void>& context,
502 const std::shared_ptr<FileExecutionState>& fileExecutionState =
nullptr,
503 bool isGetSensitivityLabelAuditDiscoveryEnabled =
true) = 0;
519 virtual std::shared_ptr<AsyncControl> CreateFileHandlerAsync(
520 const std::shared_ptr<Stream>& inputStream,
521 const std::string& actualFilePath,
522 bool isAuditDiscoveryEnabled,
523 const std::shared_ptr<FileHandler::Observer>& fileHandlerObserver,
524 const std::shared_ptr<void>& context,
525 const std::shared_ptr<FileExecutionState>& fileExecutionState =
nullptr,
526 bool isGetSensitivityLabelAuditDiscoveryEnabled =
true) = 0;
535 virtual void SendApplicationAuditEvent(
536 const std::string& level,
537 const std::string& eventType,
538 const std::string& eventData) = 0;
545 virtual const std::vector<std::pair<std::string, std::string>>& GetCustomSettings()
const = 0;
553 virtual bool HasClassificationRules()
const = 0;
560 virtual bool HasWorkloadConsent(
Workload workload)
const = 0;
Abstraction for identity.
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.
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 MIP SDK error types.
This file contains the ExecutionState class.
This file contains the Label class.