Skip to content

Commit

Permalink
use "uid" custom claim to get user_id from a token
Browse files Browse the repository at this point in the history
  • Loading branch information
douwevandermeij committed Oct 15, 2023
1 parent 3446526 commit 427a1dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fractal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Fractal is a scaffolding toolkit for building SOLID logic for your Python applications."""

__version__ = "4.1.2"
__version__ = "4.1.3"

from abc import ABC

Expand Down
10 changes: 5 additions & 5 deletions fractal/contrib/fastapi/routers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def add_entity(
except (ValueError, TypeError):
contract.id = None
_entity = contract.to_entity(
user_id=kwargs.get("sub"), account_id=kwargs.get("account")
user_id=kwargs.get("uid"), account_id=kwargs.get("account")
)
return self.ingress_service.add(
entity=_entity,
user_id=str(kwargs.get("sub")),
user_id=str(kwargs.get("uid")),
specification=specification,
)

Expand All @@ -171,13 +171,13 @@ def update_entity(
else:
_entity = contract.to_entity(
id=entity_id,
user_id=kwargs.get("sub"),
user_id=kwargs.get("uid"),
account_id=kwargs.get("account"),
)
return self.ingress_service.update(
entity_id=str(entity_id),
entity=_entity,
user_id=str(kwargs.get("sub")),
user_id=str(kwargs.get("uid")),
specification=specification,
)

Expand All @@ -190,7 +190,7 @@ def delete_entity(
) -> Dict:
self.ingress_service.delete(
entity_id=str(entity_id),
user_id=str(kwargs.get("sub")),
user_id=str(kwargs.get("uid")),
account_id=str(kwargs.get("account")),
specification=specification,
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "fractal-toolkit"
version = "4.1.2"
version = "4.1.3"
description = "Fractal is a scaffolding toolkit for building SOLID logic for your Python applications."
authors = ["Douwe van der Meij <douwe@karibu-online.nl>"]

Expand Down

0 comments on commit 427a1dc

Please sign in to comment.