Skip to content

Commit

Permalink
Update:
Browse files Browse the repository at this point in the history
* fix unit tests
  • Loading branch information
P-A-R-U-S committed Nov 21, 2023
1 parent 999e5c1 commit ac00bce
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
30 changes: 17 additions & 13 deletions docs/sources/microsoft-365/msft-teams/msft-teams_no-userIds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endpoints:
encoding: "JSON"
- !<redact>
jsonPaths:
- "$..['@odata.context']"
- "$.['@odata.context']"
- !<redact>
jsonPaths:
- "$..['@odata.id']"
Expand All @@ -43,7 +43,7 @@ endpoints:
encoding: "JSON"
- !<redact>
jsonPaths:
- "$..['@odata.context']"
- "$.['@odata.context']"
- !<redact>
jsonPaths:
- "$..['@odata.id']"
Expand Down Expand Up @@ -71,7 +71,7 @@ endpoints:
encoding: "JSON"
- !<redact>
jsonPaths:
- "$..['@odata.context']"
- "$.['@odata.context']"
- !<redact>
jsonPaths:
- "$..['@odata.count']"
Expand All @@ -95,7 +95,7 @@ endpoints:
encoding: "JSON"
- !<redact>
jsonPaths:
- "$..['@odata.context']"
- "$.['@odata.context']"
- !<redact>
jsonPaths:
- "$..['@odata.count']"
Expand All @@ -104,7 +104,7 @@ endpoints:
- "$..['@odata.type']"
- !<tokenize>
jsonPaths:
- "$.['@odata.nextLink', '@odata.prevLink', '[email protected]']"
- "$.['@odata.nextLink', '@odata.prevLink']"
regex: "^https://graph.microsoft.com/(.*)$"
- pathTemplate: "/{apiVersion}/teams/{teamId}/channels/{channelId}/messages/delta"
allowedQueryParams:
Expand All @@ -127,7 +127,7 @@ endpoints:
encoding: "JSON"
- !<redact>
jsonPaths:
- "$..['@odata.context']"
- "$.['@odata.context']"
- !<redact>
jsonPaths:
- "$..['@odata.count']"
Expand All @@ -136,7 +136,7 @@ endpoints:
- "$..['@odata.type']"
- !<tokenize>
jsonPaths:
- "$.['@odata.nextLink', '@odata.prevLink', '[email protected]']"
- "$.['@odata.nextLink', '@odata.prevLink']"
regex: "^https://graph.microsoft.com/(.*)$"
- pathTemplate: "/{apiVersion}/chats/{chatId}/messages"
allowedQueryParams:
Expand Down Expand Up @@ -164,7 +164,7 @@ endpoints:
encoding: "JSON"
- !<redact>
jsonPaths:
- "$..['@odata.context']"
- "$.['@odata.context']"
- !<redact>
jsonPaths:
- "$..['@odata.count']"
Expand All @@ -173,7 +173,7 @@ endpoints:
- "$..['@odata.type']"
- !<tokenize>
jsonPaths:
- "$.['@odata.nextLink', '@odata.prevLink', '[email protected]']"
- "$.['@odata.nextLink', '@odata.prevLink']"
regex: "^https://graph.microsoft.com/(.*)$"
- pathTemplate: "/{apiVersion}/communications/calls/{callId}"
allowedQueryParams:
Expand All @@ -190,7 +190,7 @@ endpoints:
encoding: "JSON"
- !<redact>
jsonPaths:
- "$..['@odata.context']"
- "$.['@odata.context']"
- !<redact>
jsonPaths:
- "$..['@odata.count']"
Expand All @@ -216,13 +216,17 @@ endpoints:
encoding: "JSON"
- !<redact>
jsonPaths:
- "$..['@odata.context']"
- "$.['@odata.context']"
- !<redact>
jsonPaths:
- "$..['@odata.type']"
- !<tokenize>
jsonPaths:
- "$.['@odata.nextLink', '@odata.prevLink', '[email protected]']"
- "$.['@odata.nextLink', '@odata.prevLink']"
regex: "^https://graph.microsoft.com/(.*)$"
- !<tokenize>
jsonPaths:
- "$.['[email protected]']"
regex: "^https://graph.microsoft.com/(.*)$"
- pathTemplate: "/{apiVersion}/users/{userId}/onlineMeetings"
allowedQueryParams:
Expand All @@ -249,7 +253,7 @@ endpoints:
encoding: "JSON"
- !<redact>
jsonPaths:
- "$..['@odata.context']"
- "$.['@odata.context']"
- !<redact>
jsonPaths:
- "$..['@odata.type']"
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@
public class PrebuiltSanitizerRules {

static final Transform.Tokenize TOKENIZE_ODATA_LINKS = Transform.Tokenize.builder()
.jsonPath("$.['@odata.nextLink', '@odata.prevLink', '[email protected]']")
.jsonPath("$.['@odata.nextLink', '@odata.prevLink']")
.regex("^https://graph.microsoft.com/(.*)$")
.build();

static final Transform.Tokenize TOKENIZE_SESSIONS_ODATA_LINKS = Transform.Tokenize.builder()
.jsonPath("$.['[email protected]']")
.regex("^https://graph.microsoft.com/(.*)$")
.build();
static final Transform REDACT_ODATA_CONTEXT = Transform.Redact.builder()
.jsonPath("$..['@odata.context']")
.jsonPath("$.['@odata.context']")
.build();

static final Transform REDACT_ODATA_COUNT= Transform.Redact.builder()
Expand Down Expand Up @@ -415,7 +420,7 @@ public class PrebuiltSanitizerRules {
.withTransformByEndpointTemplate(MS_TEAMS_PATH_TEMPLATES_TEAMS_CHANNELS_MESSAGES_DELTA, PSEUDONYMIZE_USER_ID, REDACT_ODATA_CONTEXT, REDACT_ODATA_COUNT, REDACT_ODATA_TYPE, TOKENIZE_ODATA_LINKS)
.withTransformByEndpointTemplate(MS_TEAMS_PATH_TEMPLATES_CHATS_MESSAGES, PSEUDONYMIZE_USER_ID, REDACT_ODATA_CONTEXT, REDACT_ODATA_COUNT, REDACT_ODATA_TYPE, TOKENIZE_ODATA_LINKS)
.withTransformByEndpointTemplate(MS_TEAMS_PATH_TEMPLATES_COMMUNICATIONS_CALLS, PSEUDONYMIZE_USER_ID, REDACT_ODATA_CONTEXT, REDACT_ODATA_COUNT, REDACT_ODATA_TYPE )
.withTransformByEndpointTemplate(MS_TEAMS_PATH_TEMPLATES_COMMUNICATIONS_CALL_RECORDS, PSEUDONYMIZE_USER_ID, REDACT_ODATA_CONTEXT, REDACT_ODATA_TYPE, TOKENIZE_ODATA_LINKS)
.withTransformByEndpointTemplate(MS_TEAMS_PATH_TEMPLATES_COMMUNICATIONS_CALL_RECORDS, PSEUDONYMIZE_USER_ID, REDACT_ODATA_CONTEXT, REDACT_ODATA_TYPE, TOKENIZE_ODATA_LINKS, TOKENIZE_SESSIONS_ODATA_LINKS)
.withTransformByEndpointTemplate(MS_TEAMS_PATH_TEMPLATES_USERS_ONLINE_MEETINGS, PSEUDONYMIZE_USER_ID, REDACT_ODATA_CONTEXT, REDACT_ODATA_TYPE );

public static final Map<String, RESTRules> MSFT_DEFAULT_RULES_MAP =
Expand Down

0 comments on commit ac00bce

Please sign in to comment.