-
Notifications
You must be signed in to change notification settings - Fork 55
Privacy Concern Event wrapper #1310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
nahidfgh
wants to merge
6
commits into
main
Choose a base branch
from
PG-swift-wrapper
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b0eead5
Added privacy concern provider
nahidfgh 326da18
Address comments
nahidfgh 9cd4b5c
remove privacy concern event
nahidfgh 16098fe
revert version
nahidfgh c12b796
remove import
nahidfgh bb5b255
swift wrapper added
nahidfgh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
#include "objc_begin.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/*! | ||
@brief Represents a Privacy Concern Event. | ||
This class is used to store and manage privacy concern event data including details | ||
like the event name, server name, database name, and various other privacy-related | ||
attributes. | ||
*/ | ||
@interface PrivacyConcernEvent : NSObject | ||
|
||
/*! | ||
@brief The name of the privacy concern event. | ||
Used as a unique identifier for the event. Example: "PrivacyConcerns". | ||
*/ | ||
@property (nonatomic, strong) NSString *PG_ConcernEventName; | ||
|
||
/*! | ||
@brief The name of the server associated with the privacy concern event. | ||
This field is optional and may be nil. | ||
*/ | ||
@property (nonatomic, strong, nullable) NSString *PG_ServerName; | ||
|
||
/*! | ||
@brief The name of the database associated with the privacy concern event. | ||
This field is optional and may be nil. | ||
*/ | ||
@property (nonatomic, strong, nullable) NSString *PG_DatabaseName; | ||
|
||
/*! | ||
@brief The table name that contains privacy concern event data. | ||
This field is mandatory and used to locate the specific data in a table. | ||
*/ | ||
@property (nonatomic, strong) NSString *PG_TableName; | ||
|
||
/*! | ||
@brief The column name in the table that stores the privacy concern data. | ||
This field is mandatory and specifies which column to examine. | ||
*/ | ||
@property (nonatomic, strong) NSString *PG_ColumnName; | ||
|
||
/*! | ||
@brief The locator name to uniquely identify the row in the table containing the privacy concern. | ||
This field is optional and can be nil if not needed. | ||
*/ | ||
@property (nonatomic, strong, nullable) NSString *PG_EventLocatorName; | ||
|
||
/*! | ||
@brief The locator value associated with the PG_EventLocatorName, which can uniquely identify | ||
the specific row containing the privacy concern. | ||
This field is optional and can be nil if not needed. | ||
*/ | ||
@property (nonatomic, strong, nullable) NSString *PG_EventLocatorValue; | ||
|
||
/*! | ||
@brief The timestamp of the privacy concern event. | ||
This field is mandatory and represents the time the event occurred. | ||
*/ | ||
@property (nonatomic, assign) int64_t PG_EventTime; | ||
|
||
/*! | ||
@brief The type of privacy concern event as a string. | ||
This field is mandatory and can describe the concern (e.g., "Sensitive Data Leak"). | ||
*/ | ||
@property (nonatomic, strong) NSString *PG_ConcernTypeText; | ||
|
||
/*! | ||
@brief Whether the privacy concern event should be ignored. | ||
This boolean determines if the concern will be processed or ignored in reporting. | ||
*/ | ||
@property (nonatomic, assign) BOOL PG_ShouldIgnore; | ||
|
||
/*! | ||
@brief Indicates whether the data field is considered as a semantic context. | ||
This boolean indicates if this concern applies universally to the table or to a subset of data. | ||
*/ | ||
@property (nonatomic, assign) BOOL PG_IsContext; | ||
|
||
/*! | ||
@brief Indicates whether the semantic context applies to all records or just a subset. | ||
This boolean helps categorize whether the context is global or partial. | ||
*/ | ||
@property (nonatomic, assign) BOOL PG_IsGlobalContext; | ||
|
||
/*! | ||
@brief The tenant ID associated with the privacy concern event. | ||
This field is optional and can be used to filter events based on tenant. | ||
*/ | ||
@property (nonatomic, strong, nullable) NSString *PG_AssociatedTenant; | ||
|
||
/*! | ||
@brief The environment or deployment ring for the service (e.g., "Production", "PPE"). | ||
This field is optional and can specify the deployment context of the privacy concern. | ||
*/ | ||
@property (nonatomic, strong, nullable) NSString *PG_Environment; | ||
|
||
/*! | ||
@brief Additional metadata that can be attached to the privacy concern event. | ||
This field is optional and allows for flexible extension of the event data. | ||
*/ | ||
@property (nonatomic, strong, nullable) NSString *PG_Metadata; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END | ||
#include "objc_end.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
#import <Foundation/Foundation.h> | ||
#import "ODWPrivacyConcernEvent.h" | ||
|
||
/*! | ||
@brief Represents a privacy concern event. | ||
*/ | ||
@implementation ODWPrivacyConcernEvent : NSObject | ||
|
||
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/*! | ||
@brief Represents a metadata provider for privacy concern events. | ||
*/ | ||
@interface ODWPrivacyConcernMetadataProvider : NSObject | ||
|
||
/*! | ||
@brief Get the database name. | ||
@param record The record for which to retrieve the database name. | ||
@return A string representing the database name. | ||
*/ | ||
- (NSString *)getDatabaseNameForRecord:(id)record; | ||
|
||
/*! | ||
@brief Get the server name. | ||
@param record The record for which to retrieve the server name. | ||
@return A string representing the server name. | ||
*/ | ||
- (NSString *)getServerNameForRecord:(id)record; | ||
|
||
/*! | ||
@brief Get the event locator name. | ||
@param record The record for which to retrieve the event locator name. | ||
@return A string representing the event locator name. | ||
*/ | ||
- (NSString *)getEventLocatorNameForRecord:(id)record; | ||
|
||
/*! | ||
@brief Get the event locator value. | ||
@param record The record for which to retrieve the event locator value. | ||
@return A string representing the event locator value. | ||
*/ | ||
- (NSString *)getEventLocatorValueForRecord:(id)record; | ||
|
||
/*! | ||
@brief Get the override for the privacy guard event time. | ||
@param record The record for which to retrieve the event time override. | ||
@return An integer representing the event time override. | ||
*/ | ||
- (int64_t)getPrivacyGuardEventTimeOverrideForRecord:(id)record; | ||
|
||
/*! | ||
@brief Check if the record should be ignored. | ||
@param record The record to check. | ||
@return A boolean indicating whether the record should be ignored. | ||
*/ | ||
- (BOOL)getShouldIgnoreOverrideForRecord:(id)record; | ||
|
||
/*! | ||
@brief Get the associated tenant. | ||
@param record The record for which to retrieve the associated tenant. | ||
@return A string representing the associated tenant. | ||
*/ | ||
- (NSString *)getAssociatedTenantForRecord:(id)record; | ||
|
||
/*! | ||
@brief Get the environment. | ||
@param record The record for which to retrieve the environment. | ||
@return A string representing the environment. | ||
*/ | ||
- (NSString *)getEnvironmentForRecord:(id)record; | ||
|
||
/*! | ||
@brief Get the metadata. | ||
@param record The record for which to retrieve the metadata. | ||
@return A string representing the metadata. | ||
*/ | ||
- (NSString *)getMetadataForRecord:(id)record; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "ODWPrivacyConcernMetadataProvider.h" | ||
|
||
/*! | ||
@brief Represents a metadata provider for privacy concern events. | ||
*/ | ||
@implementation ODWPrivacyConcernMetadataProvider : NSObject | ||
|
||
- (NSString *)getDatabaseNameForRecord:(id)record { | ||
return @""; // Default implementation | ||
} | ||
|
||
- (NSString *)getServerNameForRecord:(id)record { | ||
return @""; // Default implementation | ||
} | ||
|
||
- (NSString *)getEventLocatorNameForRecord:(id)record { | ||
return @"BaseType"; // Default implementation | ||
} | ||
|
||
- (NSString *)getEventLocatorValueForRecord:(id)record { | ||
return [record baseType]; // Example assuming `record` has a `baseType` property | ||
} | ||
|
||
- (int64_t)getPrivacyGuardEventTimeOverrideForRecord:(id)record { | ||
return [record time]; // Example assuming `record` has a `time` property | ||
} | ||
|
||
- (BOOL)getShouldIgnoreOverrideForRecord:(id)record { | ||
return NO; // Default implementation | ||
} | ||
|
||
- (NSString *)getAssociatedTenantForRecord:(id)record { | ||
return [record iKey]; // Example assuming `record` has an `iKey` property | ||
} | ||
|
||
- (NSString *)getEnvironmentForRecord:(id)record { | ||
return @""; // Default implementation | ||
} | ||
|
||
- (NSString *)getMetadataForRecord:(id)record { | ||
return @""; // Default implementation | ||
} | ||
|
||
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.