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

#include <src/api/mip/file/file_engine.h>

Public Member Functions

void ConfigureFunctionality (FunctionalityFilterType functionalityFilterType, bool enabled)
 Enables or disables functionality.
 
void EnablePFile (bool value)
 Sets the flag indicating if produce PFiles.
 
std::shared_ptr< AuthDelegateGetAuthDelegate () const
 Get the Engine Auth Delegate.
 
const std::string & GetClientData () const
 Returns the engine client data.
 
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::vector< std::pair< std::string, std::string > > & GetCustomSettings () const
 Gets a list of name/value pairs used for testing and experimentation.
 
DataBoundary GetDataBoundary () const
 Gets the data boundary region.
 
const std::string & GetDelegatedUserEmail () const
 Gets the delegated user.
 
const std::string & GetEngineId () const
 Returns the engine ID.
 
const IdentityGetIdentity () const
 Returns the engine Identity.
 
const std::vector< LabelFilterType > & GetLabelFilter () const
 Gets the label filters set through deprecated function SetLabelFilter.
 
const std::string & GetLocale () const
 Return the engine locale.
 
const std::shared_ptr< void > & GetLoggerContext () const
 Get logger context that will be opaquely passed to the logger delegate for logs associated with the created engine.
 
const std::string & GetPolicyCloudEndpointBaseUrl () const
 Gets the policy cloud endpoint base url.
 
const std::string & GetProtectionCloudEndpointBaseUrl () const
 Gets the protection cloud endpoint base url.
 
const std::string & GetSessionId () const
 Return the engine session ID.
 
bool IsLoadSensitivityTypesEnabled () const
 Get the the flag indicating if load sensitivity labels is enabled.
 
const bool IsPFileEnabled ()
 Get the flag indicating if produce PFiles.
 
const bool IsProtectionOnlyEngine () const
 Return protection only engine indicator - no policy/label.
 
void SetAuthDelegate (const std::shared_ptr< AuthDelegate > &authDelegate)
 Set the Engine Auth Delegate.
 
void SetCloud (Cloud cloud)
 Optionally sets the target cloud.
 
void SetCustomSettings (const std::vector< std::pair< std::string, std::string > > &value)
 Sets a list of name/value pairs used for testing and experimentation.
 
void SetDataBoundary (DataBoundary dataBoundary)
 Optionally sets the target diagnostic region.
 
void SetDelegatedUserEmail (const std::string &delegatedUserEmail)
 Sets the delegated user.
 
void SetEngineId (const std::string &id)
 Set the engine ID.
 
void SetIdentity (const Identity &identity)
 Sets the engine identity.
 
void SetLabelFilter (const std::vector< LabelFilterType > &deprecatedLabelFilters)
 Sets the label filter.
 
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 the created engine.
 
void SetPolicyCloudEndpointBaseUrl (const std::string &policyCloudEndpointBaseUrl)
 Sets the policy cloud endpoint base URL for custom cloud.
 
void SetProtectionCloudEndpointBaseUrl (const std::string &protectionCloudEndpointBaseUrl)
 Sets the protection cloud endpoint base URL for custom cloud.
 
void SetProtectionOnlyEngine (bool protectionOnly)
 Sets protection only engine indicator - no policy/label.
 
void SetSessionId (const std::string &sessionId)
 Sets the engine session ID.
 
 Settings (const Identity &identity, const std::shared_ptr< AuthDelegate > &authDelegate, const std::string &clientData, const std::string &locale="", bool loadSensitivityTypes=false)
 FileProfile::Settings constructor for creating a new engine.
 
 Settings (const std::string &engineId, const std::shared_ptr< AuthDelegate > &authDelegate, const std::string &clientData, const std::string &locale="", bool loadSensitivityTypes=false)
 FileEngine::Settings constructor for loading an existing engine.
 

Detailed Description

Definition at line 53 of file file_engine.h.

Constructor & Destructor Documentation

◆ Settings() [1/2]

FileEngine::Settings::Settings ( const std::string & engineId,
const std::shared_ptr< AuthDelegate > & authDelegate,
const std::string & clientData,
const std::string & locale = "",
bool loadSensitivityTypes = false )
inline

FileEngine::Settings constructor for loading an existing engine.

Parameters
engineIdSet it to the unique engine ID generated by AddEngineAsync.
authDelegateThe authentication delegate used by the SDK to acquire authentication tokens, will override the PolicyProfile::Settings::authDelegate if both provided
clientDatacustomizable client data that can be stored with the engine when unloaded, can be retrieved from a loaded engine.
localeengine localizable output will be provided in this locale.
loadSensitivityTypesOptional flag indicating when the engine is loaded should load also custom sensitivity types, if true OnPolicyChange Observer on the profile will be invoked on updates to custom sensitivity types as well as policy changes. if false ListSensitivityTypes call will always return an empty list.

Definition at line 68 of file file_engine.h.

74 : mEngineId(engineId),
75 mAuthDelegate(authDelegate),
76 mClientData(clientData),
77 mLocale(locale),
78 mIsLoadSensitivityTypesEnabled(loadSensitivityTypes) {
79 if (mLocale.compare("") == 0) {
80 mLocale = "en-US";
81 }
82 }

◆ Settings() [2/2]

FileEngine::Settings::Settings ( const Identity & identity,
const std::shared_ptr< AuthDelegate > & authDelegate,
const std::string & clientData,
const std::string & locale = "",
bool loadSensitivityTypes = false )
inline

FileProfile::Settings constructor for creating a new engine.

Parameters
identityIdentity info of the user associated with the new engine.
authDelegateThe authentication delegate used by the SDK to acquire authentication tokens, will override the PolicyProfile::Settings::authDelegate if both provided
clientDatacustomizable client data that can be stored with the engine when unloaded, can be retrieved from a loaded engine.
localeengine localizable output will be provided in this locale.
loadSensitivityTypesOptional flag indicating when the engine is loaded should load also custom sensitivity types, if true OnPolicyChange Observer on the profile will be invoked on updates to custom sensitivity types as well as policy changes. if false ListSensitivityTypes call will always return an empty list.

Definition at line 97 of file file_engine.h.

103 : mIdentity(identity),
104 mAuthDelegate(authDelegate),
105 mClientData(clientData),
106 mLocale(locale) ,
107 mIsLoadSensitivityTypesEnabled(loadSensitivityTypes) {
108 if (mLocale.compare("") == 0) {
109 mLocale = "en-US";
110 }
111 }

Member Function Documentation

◆ ConfigureFunctionality()

void FileEngine::Settings::ConfigureFunctionality ( FunctionalityFilterType functionalityFilterType,
bool enabled )
inline

Enables or disables functionality.

Parameters
functionalityFilterTypethe type of functionality.
enabledTrue to enable, false to disable
Note
HyokProtection, DoubleKeyProtection, DoubleKeyUserDefinedProtection are disabled by default and must be enabled

Definition at line 336 of file file_engine.h.

336 {
337 if(functionalityFilterType == FunctionalityFilterType::None) {
338 throw BadInputError(
339 "FunctionalityFilterType::None is not supported");
340 }
341
342 mConfiguredFunctionality[functionalityFilterType] = enabled;
343 }
Bad input error, thrown when the input to an SDK API is invalid.
Definition error.h:247
@ None

References None.

◆ EnablePFile()

void FileEngine::Settings::EnablePFile ( bool value)
inline

Sets the flag indicating if produce PFiles.

Definition at line 275 of file file_engine.h.

275 {
276 mEnablePFile = value;
277 }

◆ GetAuthDelegate()

std::shared_ptr< AuthDelegate > FileEngine::Settings::GetAuthDelegate ( ) const
inline

Get the Engine Auth Delegate.

Returns
the Engine Auth Delegate.

Definition at line 368 of file file_engine.h.

368{ return mAuthDelegate; }

◆ GetClientData()

const std::string & FileEngine::Settings::GetClientData ( ) const
inline

Returns the engine client data.

Definition at line 138 of file file_engine.h.

138{ return mClientData; }

◆ GetCloud()

Cloud FileEngine::Settings::GetCloud ( ) const
inline

Gets the target cloud used by all service requests.

Returns
cloud

Definition at line 185 of file file_engine.h.

185 {
186 return mCloud;
187 }

◆ GetConfiguredFunctionality()

const std::map< FunctionalityFilterType, bool > & FileEngine::Settings::GetConfiguredFunctionality ( ) const
inline

Gets the configured functionality.

Returns
A map of the types to a boolean value indicating whether or not it is enabled

Definition at line 350 of file file_engine.h.

350 {
351 return mConfiguredFunctionality;
352 }

◆ GetCustomSettings()

const std::vector< std::pair< std::string, std::string > > & FileEngine::Settings::GetCustomSettings ( ) const
inline

Gets a list of name/value pairs used for testing and experimentation.

Definition at line 153 of file file_engine.h.

153{ return mCustomSettings; }

◆ GetDataBoundary()

DataBoundary FileEngine::Settings::GetDataBoundary ( ) const
inline

Gets the data boundary region.

Returns
DataBoundary

Definition at line 205 of file file_engine.h.

205 {
206 return mDataBoundary;
207 }

◆ GetDelegatedUserEmail()

const std::string & FileEngine::Settings::GetDelegatedUserEmail ( ) const
inline

Gets the delegated user.

Returns
Delegated user
Note
A delegated user is specified when the authenticating user/application is acting on behalf of another user

Definition at line 304 of file file_engine.h.

304{ return mDelegatedUserEmail; }

◆ GetEngineId()

const std::string & FileEngine::Settings::GetEngineId ( ) const
inline

Returns the engine ID.

Definition at line 116 of file file_engine.h.

116{ return mEngineId; }

◆ GetIdentity()

const Identity & FileEngine::Settings::GetIdentity ( ) const
inline

Returns the engine Identity.

Definition at line 128 of file file_engine.h.

128{ return mIdentity; }

◆ GetLabelFilter()

const std::vector< LabelFilterType > & FileEngine::Settings::GetLabelFilter ( ) const
inline

Gets the label filters set through deprecated function SetLabelFilter.

Returns
the label filter.
Note
Labels are by default filter to scope, this api is to allow filtering by possible actions.

Definition at line 326 of file file_engine.h.

326{ return mDeprecatedLabelFilters; }

◆ GetLocale()

const std::string & FileEngine::Settings::GetLocale ( ) const
inline

Return the engine locale.

Definition at line 143 of file file_engine.h.

143{ return mLocale; }

◆ GetLoggerContext()

const std::shared_ptr< void > & FileEngine::Settings::GetLoggerContext ( ) const
inline

Get logger context that will be opaquely passed to the logger delegate for logs associated with the created engine.

Returns
The logger context

Definition at line 376 of file file_engine.h.

376{ return mLoggerContext; }

◆ GetPolicyCloudEndpointBaseUrl()

const std::string & FileEngine::Settings::GetPolicyCloudEndpointBaseUrl ( ) const
inline

Gets the policy cloud endpoint base url.

Returns
Base url associated with policy endpoints

Definition at line 245 of file file_engine.h.

245 {
246 return mPolicyCloudEndpointBaseUrl;
247 }

◆ GetProtectionCloudEndpointBaseUrl()

const std::string & FileEngine::Settings::GetProtectionCloudEndpointBaseUrl ( ) const
inline

Gets the protection cloud endpoint base url.

Returns
Base url associated with protection endpoints
Note
This value will only be read and must be set for Cloud = Custom

Definition at line 227 of file file_engine.h.

227 {
228 return mProtectionCloudEndpointBaseUrl;
229 }

◆ GetSessionId()

const std::string & FileEngine::Settings::GetSessionId ( ) const
inline

Return the engine session ID.

Definition at line 165 of file file_engine.h.

165 {
166 return mSessionId;
167 }

◆ IsLoadSensitivityTypesEnabled()

bool FileEngine::Settings::IsLoadSensitivityTypesEnabled ( ) const
inline

Get the the flag indicating if load sensitivity labels is enabled.

Returns
true if enabled else false.

Definition at line 268 of file file_engine.h.

268 {
269 return mIsLoadSensitivityTypesEnabled;
270 }

◆ IsPFileEnabled()

const bool FileEngine::Settings::IsPFileEnabled ( )
inline

Get the flag indicating if produce PFiles.

Returns
true if enabled else false.

Definition at line 284 of file file_engine.h.

284 {
285 return mEnablePFile;
286 }

◆ IsProtectionOnlyEngine()

const bool FileEngine::Settings::IsProtectionOnlyEngine ( ) const
inline

Return protection only engine indicator - no policy/label.

Definition at line 259 of file file_engine.h.

259 {
260 return mProtectionOnlyEngine;
261 }

◆ SetAuthDelegate()

void FileEngine::Settings::SetAuthDelegate ( const std::shared_ptr< AuthDelegate > & authDelegate)
inline

Set the Engine Auth Delegate.

Parameters
authDelegatethe Auth delegate

Definition at line 359 of file file_engine.h.

359 {
360 mAuthDelegate = authDelegate;
361 }

◆ SetCloud()

void FileEngine::Settings::SetCloud ( Cloud cloud)
inline

Optionally sets the target cloud.

Parameters
cloudCloud
Note
If cloud is not specified, then it will default to global cloud.

Definition at line 176 of file file_engine.h.

176 {
177 mCloud = cloud;
178 }

◆ SetCustomSettings()

void FileEngine::Settings::SetCustomSettings ( const std::vector< std::pair< std::string, std::string > > & value)
inline

Sets a list of name/value pairs used for testing and experimentation.

Definition at line 148 of file file_engine.h.

148{ mCustomSettings = value; }

◆ SetDataBoundary()

void FileEngine::Settings::SetDataBoundary ( DataBoundary dataBoundary)
inline

Optionally sets the target diagnostic region.

Parameters
dataBoundaryData boundary region
Note
If dataBoundary is not specified, then it will default to global diagnostic region.

Definition at line 196 of file file_engine.h.

196 {
197 mDataBoundary = dataBoundary;
198 }

◆ SetDelegatedUserEmail()

void FileEngine::Settings::SetDelegatedUserEmail ( const std::string & delegatedUserEmail)
inline

Sets the delegated user.

Parameters
delegatedUserEmailthe delegation email.
Note
A delegated user is specified when the authenticating user/application is acting on behalf of another user

Definition at line 295 of file file_engine.h.

295{ mDelegatedUserEmail = delegatedUserEmail; }

◆ SetEngineId()

void FileEngine::Settings::SetEngineId ( const std::string & id)
inline

Set the engine ID.

Parameters
idengine ID.

Definition at line 123 of file file_engine.h.

123{ mEngineId = id; }

◆ SetIdentity()

void FileEngine::Settings::SetIdentity ( const Identity & identity)
inline

Sets the engine identity.

Definition at line 133 of file file_engine.h.

133{ mIdentity = identity; }

◆ SetLabelFilter()

void FileEngine::Settings::SetLabelFilter ( const std::vector< LabelFilterType > & deprecatedLabelFilters)
inline

Sets the label filter.

Parameters
labelFilterthe label filter.
Note
Labels are by default filter to scope, this api is to allow filtering by possible actions.
If not set HyokProtection and DoubleKeyProtection are filtered.

Definition at line 317 of file file_engine.h.

317{ mDeprecatedLabelFilters = deprecatedLabelFilters; }

◆ SetLoggerContext()

void FileEngine::Settings::SetLoggerContext ( const std::shared_ptr< void > & loggerContext)
inline

Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created engine.

Parameters
loggerContextThe logger context

Definition at line 384 of file file_engine.h.

384 {
385 mLoggerContext = loggerContext;
386 }

◆ SetPolicyCloudEndpointBaseUrl()

void FileEngine::Settings::SetPolicyCloudEndpointBaseUrl ( const std::string & policyCloudEndpointBaseUrl)
inline

Sets the policy cloud endpoint base URL for custom cloud.

Parameters
policyCloudEndpointBaseUrlBase url associated with policy endpoints

Definition at line 236 of file file_engine.h.

236 {
237 mPolicyCloudEndpointBaseUrl = policyCloudEndpointBaseUrl;
238 }

◆ SetProtectionCloudEndpointBaseUrl()

void FileEngine::Settings::SetProtectionCloudEndpointBaseUrl ( const std::string & protectionCloudEndpointBaseUrl)
inline

Sets the protection cloud endpoint base URL for custom cloud.

Parameters
protectionCloudEndpointBaseUrlBase url associated with protection endpoints
Note
This value will only be read and must be set for Cloud = Custom

Definition at line 216 of file file_engine.h.

216 {
217 mProtectionCloudEndpointBaseUrl = protectionCloudEndpointBaseUrl;
218 }

◆ SetProtectionOnlyEngine()

void FileEngine::Settings::SetProtectionOnlyEngine ( bool protectionOnly)
inline

Sets protection only engine indicator - no policy/label.

Definition at line 252 of file file_engine.h.

252 {
253 mProtectionOnlyEngine = protectionOnly;
254 }

◆ SetSessionId()

void FileEngine::Settings::SetSessionId ( const std::string & sessionId)
inline

Sets the engine session ID.

Definition at line 158 of file file_engine.h.

158 {
159 mSessionId = sessionId;
160 }

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