Skip to content

Commit

Permalink
Add mobile app auth on integration & escalation chain endpoints (#3056)
Browse files Browse the repository at this point in the history
  • Loading branch information
vstpme authored Sep 26, 2023
1 parent 2f1cc43 commit cc337d1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion engine/apps/api/views/alert_receive_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from apps.api.throttlers import DemoAlertThrottler
from apps.auth_token.auth import PluginAuthentication
from apps.integrations.legacy_prefix import has_legacy_prefix, remove_legacy_prefix
from apps.mobile_app.auth import MobileAppAuthTokenAuthentication
from common.api_helpers.exceptions import BadRequest
from common.api_helpers.filters import ByTeamModelFieldFilterMixin, TeamModelMultipleChoiceFilter
from common.api_helpers.mixins import (
Expand Down Expand Up @@ -72,7 +73,10 @@ class AlertReceiveChannelView(
UpdateSerializerMixin,
ModelViewSet,
):
authentication_classes = (PluginAuthentication,)
authentication_classes = (
MobileAppAuthTokenAuthentication,
PluginAuthentication,
)
permission_classes = (IsAuthenticated, RBACPermission)

model = AlertReceiveChannel
Expand Down
6 changes: 5 additions & 1 deletion engine/apps/api/views/escalation_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
FilterEscalationChainSerializer,
)
from apps.auth_token.auth import PluginAuthentication
from apps.mobile_app.auth import MobileAppAuthTokenAuthentication
from apps.user_management.models import Team
from common.api_helpers.exceptions import BadRequest
from common.api_helpers.filters import ByTeamModelFieldFilterMixin, ModelFieldFilterMixin, TeamModelMultipleChoiceFilter
Expand All @@ -38,7 +39,10 @@ class EscalationChainViewSet(
ListSerializerMixin,
viewsets.ModelViewSet,
):
authentication_classes = (PluginAuthentication,)
authentication_classes = (
MobileAppAuthTokenAuthentication,
PluginAuthentication,
)
permission_classes = (IsAuthenticated, RBACPermission)

rbac_permissions = {
Expand Down
6 changes: 5 additions & 1 deletion engine/apps/api/views/resolution_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
from apps.api.permissions import RBACPermission
from apps.api.serializers.resolution_note import ResolutionNoteSerializer, ResolutionNoteUpdateSerializer
from apps.auth_token.auth import PluginAuthentication
from apps.mobile_app.auth import MobileAppAuthTokenAuthentication
from common.api_helpers.mixins import PublicPrimaryKeyMixin, TeamFilteringMixin, UpdateSerializerMixin


class ResolutionNoteView(TeamFilteringMixin, PublicPrimaryKeyMixin, UpdateSerializerMixin, ModelViewSet):
authentication_classes = (PluginAuthentication,)
authentication_classes = (
MobileAppAuthTokenAuthentication,
PluginAuthentication,
)
permission_classes = (IsAuthenticated, RBACPermission)

rbac_permissions = {
Expand Down

0 comments on commit cc337d1

Please sign in to comment.