forked from a2aproject/a2a-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.py
More file actions
31 lines (22 loc) · 788 Bytes
/
Copy pathuser.py
File metadata and controls
31 lines (22 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""Authenticated user information."""
from abc import ABC, abstractmethod
class User(ABC):
"""A representation of an authenticated user."""
@property
@abstractmethod
def is_authenticated(self) -> bool:
"""Returns whether the current user is authenticated."""
@property
@abstractmethod
def user_name(self) -> str:
"""Returns the user name of the current user."""
class UnauthenticatedUser(User):
"""A representation that no user has been authenticated in the request."""
@property
def is_authenticated(self) -> bool:
"""Returns whether the current user is authenticated."""
return False
@property
def user_name(self) -> str:
"""Returns the user name of the current user."""
return ''