-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(integration): Extract base class for identity linking (#74744)
Extract common code for the "link identity" and "unlink identity" operations on messaging integrations.
- Loading branch information
1 parent
da3b048
commit 5771cda
Showing
22 changed files
with
621 additions
and
498 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,2 +0,0 @@ | ||
from .link_identity import * # noqa: F401,F403 | ||
from .unlink_identity import * # noqa: F401,F403 | ||
This file contains 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 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,34 @@ | ||
from abc import ABC | ||
|
||
from sentry.integrations.messaging import IdentityLinkageView, MessagingIntegrationSpec | ||
from sentry.integrations.types import ExternalProviderEnum, ExternalProviders | ||
|
||
from .constants import SALT | ||
|
||
|
||
class DiscordIdentityLinkageView(IdentityLinkageView, ABC): | ||
@property | ||
def parent_messaging_spec(self) -> MessagingIntegrationSpec: | ||
from sentry.integrations.discord.spec import DiscordMessagingSpec | ||
|
||
return DiscordMessagingSpec() | ||
|
||
@property | ||
def provider(self) -> ExternalProviders: | ||
return ExternalProviders.DISCORD | ||
|
||
@property | ||
def external_provider_enum(self) -> ExternalProviderEnum: | ||
return ExternalProviderEnum.DISCORD | ||
|
||
@property | ||
def salt(self) -> str: | ||
return SALT | ||
|
||
@property | ||
def external_id_parameter(self) -> str: | ||
return "discord_id" | ||
|
||
@property | ||
def expired_link_template(self) -> str: | ||
return "sentry/integrations/discord/expired-link.html" |
This file contains 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.