Microsoft Information Protection (MIP) SDK for C: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C
Loading...
Searching...
No Matches
policy_profile_cc.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/**
29 * @brief Contains C API definitions for policy profile
30 *
31 * @file policy_profile_cc.h
32 */
33
34#ifndef API_MIP_UPE_POLICY_PROFILE_CC_H_
35#define API_MIP_UPE_POLICY_PROFILE_CC_H_
36
37#include <stdint.h>
38
43#include "mip_cc/error_cc.h"
47#include "mip_cc/result_cc.h"
50
53
54/**
55 * @brief Add a new policy engine to the profile.
56 *
57 * @param profile Parent profile under which an engine will be added
58 * @param settings Policy engine settings
59 * @param context Client context that will be opaquely passed to HttpDelegate and AuthDelegate
60 * @param engine [Output] Newly-created policy engine instance
61 * @param errorInfo [Output] (Optional) Failure info if operation result is error
62 *
63 * @return Result code indicating success or failure
64 */
65MIP_CC_API(mip_cc_result) MIP_CC_PolicyProfile_AddEngine(
68 const void* context,
71
72/**
73 * @brief Trigger an authentication callback
74 *
75 * @param profile Profile
76 * @param cloud Azure cloud
77 * @param authCallback Authentication callback that will be invoked
78 * @param errorInfo [Output] (Optional) Failure info if operation result is error
79 *
80 * @return Result code indicating success or failure
81 *
82 * @note MIP will not cache or do anything else with the value returned by the auth delegate. This function is
83 * recommended for applications that aren't "logged in" until after MIP requests an auth token. It allows
84 * an application to fetch a token before MIP actually requires one.
85 */
86MIP_CC_API(mip_cc_result) MIP_CC_PolicyProfile_AcquireAuthToken(
89 const mip_cc_auth_callback authCallback,
91
92/**
93 * @brief Load a profile
94 *
95 * @param settings Profile settings
96 * @param profile [Output] Newly-created policy profile instance
97 * @param errorInfo [Output] (Optional) Failure info if operation result is error
98 *
99 * @return Result code indicating success or failure
100 */
101MIP_CC_API(mip_cc_result) MIP_CC_LoadPolicyProfile(
105
106/**
107 * @brief Release resources associated with a policy profile
108 *
109 * @param profile Policy profile to be released
110 */
111MIP_CC_API(void) MIP_CC_ReleasePolicyProfile(mip_cc_policy_profile profile);
112
113/**
114 * @brief Create a settings object used to create a policy profile
115 *
116 * @param mipContext Global context shared across all profiles
117 * @param cacheStorageType Storage cache configuration
118 * @param reserved Reserved for backwards compatibility - set to nullptr
119 * @param settings [Output] Newly-created settings instance
120 * @param errorInfo [Output] (Optional) Failure info if operation result is error
121 *
122 * @return Result code indicating success or failure
123 */
124MIP_CC_API(mip_cc_result) MIP_CC_CreatePolicyProfileSettings(
127 const void* reserved,
130
131/**
132 * @brief Sets the session ID that can be used to correlate logs and telemetry
133 *
134 * @param settings Profile settings
135 * @param sessionId Session ID that represents the lifetime of a policy profile
136 * @param errorInfo [Output] (Optional) Failure info if operation result is error
137 *
138 * @return Result code indicating success or failure
139 */
140MIP_CC_API(mip_cc_result) MIP_CC_PolicyProfileSettings_SetSessionId(
142 const char* sessionId,
144
145/**
146 * @brief Override default HTTP stack with client's own
147 *
148 * @param settings Profile settings to which HTTP delegate will be assigned
149 * @param httpDelegate HTTP callback instance implemented by client application
150 * @param errorInfo [Output] (Optional) Failure info if operation result is error
151 *
152 * @return Result code indicating success or failure
153 */
154MIP_CC_API(mip_cc_result) MIP_CC_PolicyProfileSettings_SetHttpDelegate(
158
159/**
160 * @brief Override default async task dispatcher with client's own
161 *
162 * @param settings Profile settings to which task dispatcher delegate will be assigned
163 * @param taskDispatcherDelegate Task dispatcher callback instance implemented by client application
164 * @param errorInfo [Output] (Optional) Failure info if operation result is error
165 *
166 * @return Result code indicating success or failure
167 */
168MIP_CC_API(mip_cc_result) MIP_CC_PolicyProfileSettings_SetTaskDispatcherDelegate(
172
173/**
174 * @brief Configures custom settings, used for feature gating and testing.
175 *
176 * @param settings Profile settings
177 * @param customSettings Key/value pairs of custom settings
178 * @param errorInfo [Output] (Optional) Failure info if operation result is error
179 *
180 * @return Result code indicating success or failure
181 */
182MIP_CC_API(mip_cc_result) MIP_CC_PolicyProfileSettings_SetCustomSettings(
186
187/**
188 * @brief Release resources associated with a policy profile settings
189 *
190 * @param settings Policy profile settings to be released
191 */
192MIP_CC_API(void) MIP_CC_ReleasePolicyProfileSettings(mip_cc_policy_profile_settings profileSettings);
193
194#endif // API_MIP_PROTECTION_PROTECTION_PROFILE_H_
ApplicationInfo definition.
Defines auth callback functions.
A file Containing the common types used by the upe, file and protection modules.
mip_cc_cloud
mip_cc_cache_storage_type
Storage type for caches.
Contains C API definitions for common string dictionary.
Error definition and functions.
Defines HTTP callback functions.
Defines C-Style MipContext functions.
const char const mip_cc_log_level const bool const mip_cc_logger_delegate const mip_cc_telemetry_configuration mip_cc_mip_context * mipContext
Export/import and other macros for C API.
Contains C API definitions for policy engine.
mip_cc_policy_profile * profile
MIP_CC_API(void) MIP_CC_ReleasePolicyProfile(mip_cc_policy_profile profile)
Release resources associated with a policy profile.
mip_cc_handle * mip_cc_policy_profile_settings
const mip_cc_policy_engine_settings const void mip_cc_policy_engine mip_cc_error * errorInfo
const char * sessionId
const mip_cc_policy_engine_settings settings
mip_cc_handle * mip_cc_policy_profile
const mip_cc_cloud cloud
const mip_cc_policy_engine_settings const void mip_cc_policy_engine * engine
const mip_cc_policy_engine_settings const void * context
const mip_cc_dictionary customSettings
const mip_cc_cache_storage_type const void * reserved
const mip_cc_http_delegate httpDelegate
const mip_cc_cache_storage_type cacheStorageType
const mip_cc_task_dispatcher_delegate taskDispatcherDelegate
const mip_cc_cloud const mip_cc_auth_callback authCallback
Defines success/error result codes.
mip_cc_result
API success/failure result.
Definition result_cc.h:44
Error information.
Definition error_cc.h:79
Opaque handle to MIP object.
Defines task dispatcher callback functions.