Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only create websocket account locally #1121

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/aap_eda/services/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from itertools import groupby

import jwt
from ansible_base.resource_registry.signals.handlers import no_reverse_sync
from django.conf import settings

from aap_eda.core.models.user import User
Expand Down Expand Up @@ -46,10 +47,11 @@ def create_jwt_token() -> tuple[str, str]:

They can be sent to rulebook clients through command line arguments.
"""
user, new = User.objects.get_or_create(
username="_token_service_user",
is_service_account=True,
)
with no_reverse_sync():
user, new = User.objects.get_or_create(
username="_token_service_user",
is_service_account=True,
)
if new:
user.set_unusable_password()
user.save(update_fields=["password"])
Expand Down
Loading