Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove authentication from API endpoints
Browse files Browse the repository at this point in the history
gsnider2195 committed Nov 13, 2024
1 parent 67a5b63 commit b051bfa
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion changes/341.fixed
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Fixed django-constance not being upgradable due to this app accessing the database before migrations could run.
Removed conditional logic for adding grafana navigation menu items.
Fixed Nautobot v2.3 incompatibility caused by saved views not being able to determine the models' table classes.
Fixed mattermost, msteams, slack and webex integration API views that were not requiring the user to be logged in.
Added exception handling for cases where diffsync is not installed, since it's marked as optional.
6 changes: 2 additions & 4 deletions nautobot_chatops/views.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
to send requests and notifications to.
"""

from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.shortcuts import render
@@ -24,7 +24,7 @@
from nautobot_chatops.tables import AccessGrantTable, ChatOpsAccountLinkTable, CommandLogTable, CommandTokenTable


class SettingsControlledViewMixin(LoginRequiredMixin):
class SettingsControlledViewMixin:
"""View mixin to enable or disable views based on constance settings."""

enable_view_setting = None
@@ -35,8 +35,6 @@ def dispatch(self, request, *args, **kwargs):
raise ImproperlyConfigured(
"Property `enable_view_setting` must be defined on the view to use SettingsControlledView."
)
if not request.user.is_authenticated:
return self.handle_no_permission()
if not get_app_settings_or_config("nautobot_chatops", self.enable_view_setting):
raise Http404
return super().dispatch(request, *args, **kwargs)
5 changes: 4 additions & 1 deletion nautobot_chatops/workers/__init__.py
Original file line number Diff line number Diff line change
@@ -57,7 +57,10 @@

def get_commands_registry():
"""Populate and return the _commands_registry dictionary with all known commands, subcommands, and workers."""
from nautobot_chatops.integrations.utils import ALL_INTEGRATIONS, DISABLED_INTEGRATIONS
from nautobot_chatops.integrations.utils import ( # pylint: disable=import-outside-toplevel
ALL_INTEGRATIONS,
DISABLED_INTEGRATIONS,
)

global _commands_registry # pylint: disable=global-variable-not-assigned
global _registry_initialized # pylint: disable=global-statement

0 comments on commit b051bfa

Please sign in to comment.