Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Dec 16, 2024
1 parent d93484d commit d6d5b64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/linked_services/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024-present jefer94 <[email protected]>
#
# SPDX-License-Identifier: LGPL-3.0-or-later
__version__ = "1.3.0"
__version__ = "1.3.1"
6 changes: 4 additions & 2 deletions src/linked_services/pytest/django/fixtures/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.utils import timezone
from rest_framework.test import APIClient

from linked_services.core.settings import get_setting
from linked_services.rest_framework.types import LinkedApp

__all__ = ["Service", "service"]
Expand Down Expand Up @@ -39,21 +40,22 @@ def sign_jwt(
"""

now = timezone.now()
whoamy = get_setting("app_name")

# https://datatracker.ietf.org/doc/html/rfc7519#section-4
payload = {
"sub": str(user_id or ""),
"iss": os.getenv("API_URL", "http://localhost:8000"),
"app": app.slug,
"aud": "breathecode",
"aud": whoamy,
"exp": datetime.timestamp(now + timedelta(minutes=2)),
"iat": datetime.timestamp(now) - 1,
"typ": "JWT",
}

if reverse:
payload["aud"] = app.slug
payload["app"] = "breathecode"
payload["app"] = whoamy

if app.algorithm == "HMAC_SHA256":

Expand Down

0 comments on commit d6d5b64

Please sign in to comment.