Skip to content

Commit 57876ba

Browse files
committed
Uncomment code
1 parent 9ec69c1 commit 57876ba

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
ignore = E501, W503
2+
ignore = E501, E701, W503
33
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
44
max-complexity = 10
55
min_python_version = 3.9

canarytokens/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@
3333
WEBHOOK_BASE_URL_GOOGLE_CHAT = "https://chat.googleapis.com"
3434
WEBHOOK_BASE_URL_DISCORD = "https://discord.com/api/webhooks"
3535
WEBHOOK_BASE_URL_REGEX_MS_TEAMS = (
36-
r"^https:\/\/\S+\.ac\.environment\.api\.powerplatform\.com\S*"
36+
r"^https:\/\/\S+\.ac\.environment\.api\.powerplatform\.com"
3737
)

canarytokens/webhook_formatting.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ def _format_exposed_details_for_webhook(
130130
return _format_as_googlechat_token_exposed(details)
131131
elif webhook_type == WebhookType.DISCORD:
132132
return _format_as_discord_token_exposed(details)
133-
# elif webhook_type == WebhookType.MS_TEAMS:
134-
# return _format_as_ms_teams_token_exposed(details)
133+
elif webhook_type == WebhookType.MS_TEAMS:
134+
return _format_as_ms_teams_token_exposed(details)
135135
elif webhook_type == WebhookType.GENERIC:
136136
return TokenExposedDetailGeneric(**details.dict())
137137
else:
@@ -356,8 +356,7 @@ def __init__(self, label: str, text: str):
356356
super().__init__(text=f"*{label}*\n{text}")
357357

358358

359-
class SlackBlock(BaseModel):
360-
...
359+
class SlackBlock(BaseModel): ...
361360

362361

363362
class SlackHeader(SlackBlock):
@@ -559,7 +558,7 @@ def _format_as_googlechat_token_exposed(
559558

560559

561560
def _data_to_googlechat_text_widgets(
562-
data: dict[str, str]
561+
data: dict[str, str],
563562
) -> list[GoogleChatTextWithTopLabel]:
564563
widgets: list[GoogleChatTextWithTopLabel] = []
565564
for label, text in data.items():
@@ -576,8 +575,7 @@ def _data_to_googlechat_text_widgets(
576575
return widgets
577576

578577

579-
class GoogleChatWidget(BaseModel):
580-
...
578+
class GoogleChatWidget(BaseModel): ...
581579

582580

583581
class GoogleChatParagraph(GoogleChatWidget):
@@ -971,9 +969,9 @@ class TokenAlertContentMsTeams(BaseModel):
971969
)
972970
type: str = "AdaptiveCard"
973971
version: str = "1.5"
974-
body: Optional[
975-
list[Union[MsTeamsColumnSet, MsTeamsFactSet, MsTeamsTextblock]]
976-
] = None
972+
body: Optional[list[Union[MsTeamsColumnSet, MsTeamsFactSet, MsTeamsTextblock]]] = (
973+
None
974+
)
977975
actions: Optional[list[MsTeamsAction]] = None
978976

979977

@@ -989,12 +987,10 @@ def json_safe_dict(self) -> dict[str, str]:
989987
return self.dict(by_alias=True, exclude_none=True)
990988

991989

992-
class TokenAlertDetailGeneric(TokenAlertDetails):
993-
...
990+
class TokenAlertDetailGeneric(TokenAlertDetails): ...
994991

995992

996-
class TokenExposedDetailGeneric(TokenExposedDetails):
997-
...
993+
class TokenExposedDetailGeneric(TokenExposedDetails): ...
998994

999995

1000996
def _get_exposed_token_description(token_type: TokenTypes) -> str:

0 commit comments

Comments
 (0)