Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
compute_engine.h
Go to the documentation of this file.
1#ifndef UPE_CORE_API_COMPUTE_ENGINE_H_
2#define UPE_CORE_API_COMPUTE_ENGINE_H_
3
4#include <map>
5#include <memory>
6#include <string>
7#include <vector>
8
9#include "core/api/diagnostic/diagnostic_event_factory.h"
10#include "mip/audit_delegate.h"
11#include "mip/common_types.h"
13#include "mip/logger_delegate.h"
14#include "mip/mip_namespace.h"
16#include "mip/upe/action.h"
23#include "mip/upe/label.h"
25
26MIP_NAMESPACE_BEGIN
27
29public:
30
31 virtual const std::vector<std::shared_ptr<Label>> ListSensitivityLabels(
32 const std::vector<std::string>& contentFormats = std::vector<std::string>()) = 0;
33
34 virtual std::shared_ptr<ContentLabel> GetSensitivityLabel(
35 ComputeEngineContext& context,
36 const DocumentState& state) = 0;
37
38 virtual std::vector<std::shared_ptr<Action>> ComputeActions(
39 ComputeEngineContext& context,
40 const DocumentState& documentState,
41 const ApplicationActionState& actionState) = 0;
42
62 virtual std::pair<std::vector<std::shared_ptr<Action>>, bool> ComputeActionsWithRemoteState(
63 ComputeEngineContext& context,
64 const DocumentState& localDocumentState,
65 const DocumentState& remoteDocumentState,
66 const ApplicationActionState& actionState) = 0;
67
69 ComputeEngineContext& context,
70 const DocumentState& documentState,
71 const ApplicationActionState& actionState) = 0;
72
73 virtual const std::shared_ptr<Label> GetDefaultLabel(const std::string& contentFormat = std::string()) const = 0;
74
75 virtual const std::string& GetMoreInfoUrl() const = 0;
76
77 virtual const std::string& GetUpn() const = 0;
78
79 virtual bool IsLabelingRequired(const std::string& contentFormat = std::string()) const = 0;
80
81 virtual bool IsDowngradeJustificationRequired() const = 0;
82
83 virtual const std::string& GetFileId() const = 0;
84
85 virtual bool HasClassificationRules(const std::vector<std::string>& contentFormats = std::vector<std::string>()) const = 0;
86
87 virtual bool IsEnhancedClassificationEnabled() const = 0;
88
89 virtual std::shared_ptr<Label> GetLabelById(const std::string& id) const = 0;
90
91 virtual const std::string& GetTenantId() const = 0;
92
93 virtual void SetSensitivityTypesRulePackages(std::vector<std::shared_ptr<SensitivityTypesRulePackage>>&& custom) = 0;
94
95 virtual const std::vector<std::shared_ptr<SensitivityTypesRulePackage>>& GetSensitivityTypesRulePackages() const = 0;
96
97 virtual const std::vector<std::pair<std::string, std::string>>& GetCustomSettings() const = 0;
98
99 virtual uint32_t GetOpcMetadataVersion() const = 0;
100
101 virtual const std::string& GetUserObjectId() const = 0;
102
103 virtual bool HasWorkloadConsent(Workload workload) const = 0;
104
105 class Settings {
106
107 public:
109 const Identity& identity,
110 const ApplicationInfo& applicationInfo,
111 const std::shared_ptr<TelemetryDelegate>& telemetryDelegate,
112 const std::shared_ptr<AuditDelegate>& auditDelegate,
113 const std::shared_ptr<DiagnosticEventFactory>& eventFactory,
114 LogLevel thresholdLogLevel,
115 const std::shared_ptr<LoggerDelegate>& loggerDelegate,
116 const std::string& hostName,
117 const std::vector<std::pair<std::string, std::string>>& customProperties,
118 const std::vector<LabelFilterType>& deprecatedFilters,
119 const std::map<FunctionalityFilterType, bool>& configuredFunctionality)
120 : mIdentity(identity),
121 mApplicationInfo(applicationInfo),
122 mTelemetryDelegate(telemetryDelegate),
123 mAuditDelegate(auditDelegate),
124 mEventFactory(eventFactory),
125 mThresholdLogLevel(thresholdLogLevel),
126 mLoggerDelegate(loggerDelegate),
127 mHostName(hostName),
128 mCustomProperties(customProperties),
129 mDeprecatedLabelFilters(deprecatedFilters),
130 mConfiguredFunctionality(configuredFunctionality) {}
131
132 const Identity& GetIdentity() const { return mIdentity; }
133
134 void SetIdentity(const Identity& identity) { mIdentity = identity; }
135
137
138 std::shared_ptr<TelemetryDelegate> GetTelemetryDelegate() const { return mTelemetryDelegate; }
139
140 std::shared_ptr<AuditDelegate> GetAuditDelegate() const { return mAuditDelegate; }
141
142 std::shared_ptr<DiagnosticEventFactory> GetEventFactory() const { return mEventFactory; }
143
144 std::shared_ptr<LoggerDelegate> GetLoggerDelegate() const { return mLoggerDelegate; }
145
146 const std::string& GetHostName() const { return mHostName; }
147
148 const std::vector<std::pair<std::string, std::string>>& GetCustomProperties() const { return mCustomProperties; };
149
150 void SetParentCorrelationId(const std::string correlationId, const std::string description) {
151 mParentCorrelationId = correlationId;
153 }
154
155 const std::string& GetParentCorrelationId() const {
157 }
158
159 const std::string& GetParentCorrelationIdDescription() const {
161 }
162
163 const std::vector<LabelFilterType>& GetDeprecatedLabelFilter() const {
165 }
166
167 const std::map<FunctionalityFilterType, bool>& GetConfiguredFunctionality() const { return mConfiguredFunctionality; }
168
170 mVariableTextMarkingType = variableTextMarkingType;
171 }
172
176
180
186 const std::shared_ptr<void>& GetLoggerContext() const { return mLoggerContext; }
187
194 void SetLoggerContext(const std::shared_ptr<void>& loggerContext) {
195 mLoggerContext = loggerContext;
196 }
197
198 private:
201 std::shared_ptr<TelemetryDelegate> mTelemetryDelegate;
202 std::shared_ptr<AuditDelegate> mAuditDelegate;
203 std::shared_ptr<DiagnosticEventFactory> mEventFactory;
205 std::shared_ptr<LoggerDelegate> mLoggerDelegate;
206 std::string mHostName;
207 std::vector<std::pair<std::string, std::string>> mCustomProperties;
208 std::vector<LabelFilterType> mDeprecatedLabelFilters; //Labels that the client does not want to view
209 std::map<FunctionalityFilterType, bool> mConfiguredFunctionality; //Functionality that has been turned on or off
213 std::shared_ptr<void> mLoggerContext;
214 };
215
216 MIP_UPE_CORE_API static std::shared_ptr<ComputeEngine> Create(
217 const SyncFilePolicyData& policyData,
218 const ComputeEngine::Settings& settings);
219
220 MIP_UPE_CORE_API static std::shared_ptr<ComputeEngineContext> CreateContext(
221 const std::map<FlightingFeature, bool>& flightingFeatures,
222 bool isAuditDiscoveryEnabled);
223
224 virtual ~ComputeEngine() {};
225};
226
227MIP_NAMESPACE_END
228
229#endif // UPE_CORE_API_COMPUTE_ENGINE_H_
A file containing the Action base class and the ActionType enumerator.
A file containing the AuditDelegate class to be used to override MIP audit.
Definition application_action_state.h:28
Definition compute_engine_context.h:8
Definition compute_engine.h:105
std::shared_ptr< LoggerDelegate > mLoggerDelegate
Definition compute_engine.h:205
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...
Definition compute_engine.h:186
VariableTextMarkingType GetVariableTextMarkingType() const
Definition compute_engine.h:173
ApplicationInfo mApplicationInfo
Definition compute_engine.h:200
std::vector< std::pair< std::string, std::string > > mCustomProperties
Definition compute_engine.h:207
const std::string & GetParentCorrelationIdDescription() const
Definition compute_engine.h:159
std::shared_ptr< AuditDelegate > mAuditDelegate
Definition compute_engine.h:202
void SetVariableTextMarkingType(VariableTextMarkingType variableTextMarkingType)
Definition compute_engine.h:169
void SetIdentity(const Identity &identity)
Definition compute_engine.h:134
const std::map< FunctionalityFilterType, bool > & GetConfiguredFunctionality() const
Definition compute_engine.h:167
std::shared_ptr< void > mLoggerContext
Definition compute_engine.h:213
std::shared_ptr< TelemetryDelegate > GetTelemetryDelegate() const
Definition compute_engine.h:138
const std::vector< std::pair< std::string, std::string > > & GetCustomProperties() const
Definition compute_engine.h:148
LogLevel GetThresholdLogLevel() const
Definition compute_engine.h:177
std::vector< LabelFilterType > mDeprecatedLabelFilters
Definition compute_engine.h:208
Settings(const Identity &identity, const ApplicationInfo &applicationInfo, const std::shared_ptr< TelemetryDelegate > &telemetryDelegate, const std::shared_ptr< AuditDelegate > &auditDelegate, const std::shared_ptr< DiagnosticEventFactory > &eventFactory, LogLevel thresholdLogLevel, const std::shared_ptr< LoggerDelegate > &loggerDelegate, const std::string &hostName, const std::vector< std::pair< std::string, std::string > > &customProperties, const std::vector< LabelFilterType > &deprecatedFilters, const std::map< FunctionalityFilterType, bool > &configuredFunctionality)
Definition compute_engine.h:108
std::string mParentCorrelationId
Definition compute_engine.h:210
LogLevel mThresholdLogLevel
Definition compute_engine.h:204
std::shared_ptr< DiagnosticEventFactory > GetEventFactory() const
Definition compute_engine.h:142
std::shared_ptr< LoggerDelegate > GetLoggerDelegate() const
Definition compute_engine.h:144
const Identity & GetIdentity() const
Definition compute_engine.h:132
const std::string & GetParentCorrelationId() const
Definition compute_engine.h:155
Identity mIdentity
Definition compute_engine.h:199
std::string mParentCorrelationIdDescription
Definition compute_engine.h:211
std::shared_ptr< TelemetryDelegate > mTelemetryDelegate
Definition compute_engine.h:201
std::string mHostName
Definition compute_engine.h:206
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 ...
Definition compute_engine.h:194
const std::string & GetHostName() const
Definition compute_engine.h:146
std::shared_ptr< AuditDelegate > GetAuditDelegate() const
Definition compute_engine.h:140
std::shared_ptr< DiagnosticEventFactory > mEventFactory
Definition compute_engine.h:203
VariableTextMarkingType mVariableTextMarkingType
Definition compute_engine.h:212
void SetParentCorrelationId(const std::string correlationId, const std::string description)
Definition compute_engine.h:150
const std::vector< LabelFilterType > & GetDeprecatedLabelFilter() const
Definition compute_engine.h:163
const ApplicationInfo & GetApplicationInfo() const
Definition compute_engine.h:136
std::map< FunctionalityFilterType, bool > mConfiguredFunctionality
Definition compute_engine.h:209
Definition compute_engine.h:28
static MIP_UPE_CORE_API std::shared_ptr< ComputeEngineContext > CreateContext(const std::map< FlightingFeature, bool > &flightingFeatures, bool isAuditDiscoveryEnabled)
virtual bool IsEnhancedClassificationEnabled() const =0
virtual bool IsLabelingRequired(const std::string &contentFormat=std::string()) const =0
virtual bool IsDowngradeJustificationRequired() const =0
virtual const std::string & GetFileId() const =0
virtual void SetSensitivityTypesRulePackages(std::vector< std::shared_ptr< SensitivityTypesRulePackage > > &&custom)=0
virtual const std::vector< std::shared_ptr< SensitivityTypesRulePackage > > & GetSensitivityTypesRulePackages() const =0
virtual const std::string & GetTenantId() const =0
virtual bool HasClassificationRules(const std::vector< std::string > &contentFormats=std::vector< std::string >()) const =0
virtual const std::string & GetUserObjectId() const =0
virtual std::shared_ptr< Label > GetLabelById(const std::string &id) const =0
virtual const std::string & GetUpn() const =0
virtual void NotifyCommittedActions(ComputeEngineContext &context, const DocumentState &documentState, const ApplicationActionState &actionState)=0
virtual std::shared_ptr< ContentLabel > GetSensitivityLabel(ComputeEngineContext &context, const DocumentState &state)=0
virtual ~ComputeEngine()
Definition compute_engine.h:224
virtual const std::shared_ptr< Label > GetDefaultLabel(const std::string &contentFormat=std::string()) const =0
virtual const std::string & GetMoreInfoUrl() const =0
virtual std::vector< std::shared_ptr< Action > > ComputeActions(ComputeEngineContext &context, const DocumentState &documentState, const ApplicationActionState &actionState)=0
virtual uint32_t GetOpcMetadataVersion() const =0
static MIP_UPE_CORE_API std::shared_ptr< ComputeEngine > Create(const SyncFilePolicyData &policyData, const ComputeEngine::Settings &settings)
virtual const std::vector< std::shared_ptr< Label > > ListSensitivityLabels(const std::vector< std::string > &contentFormats=std::vector< std::string >())=0
virtual std::pair< std::vector< std::shared_ptr< Action > >, bool > ComputeActionsWithRemoteState(ComputeEngineContext &context, const DocumentState &localDocumentState, const DocumentState &remoteDocumentState, const ApplicationActionState &actionState)=0
Computes actions while choosing between remote and local state.
virtual const std::vector< std::pair< std::string, std::string > > & GetCustomSettings() const =0
virtual bool HasWorkloadConsent(Workload workload) const =0
Definition document_state.h:20
Abstraction for identity.
Definition common_types.h:278
Definition sync_file_data.h:23
A file Containing the common types used by the upe, file and protection modules.
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
A file Containing the ContentLabel class.
A file containing the FlightingFeature definition.
This file contains the Label class.
LogLevel
Different log levels used across the MIP SDK.
Definition log_message_data.h:48
A file containing the LoggerDelegate class to be used to override MIP logger.
MIP namespace macros.
A struct that includes application specific information.
Definition common_types.h:531
A file containing the TelemetryDelegate class to be used to override MIP telemetry.
#define MIP_UPE_CORE_API
Definition upe_core_export.h:21