Skip to content

Commit

Permalink
User schema (#54)
Browse files Browse the repository at this point in the history
* FIX & DOCS: user_uuid will be more suitable for data filteration & updated docs for the same

* FEAT: added token payload schema

* DOCS: removed redundand explanation
  • Loading branch information
mramitdas authored Nov 8, 2023
1 parent 8c2be51 commit cb02590
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions app/schemas/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ class UserUpdate(BaseModel):
"""
Represents a user update model for modifying user data.
This class includes two fields:
- user_uuid (int): The unique identifier for the user whose subscription is being updated.
- user_data: An instance of the BaseUser class containing updated user data.
Attributes:
user_uuid (int): The unique identifier for the user whose subscription is being updated.
user_data (BaseUser): An instance of the BaseUser class containing updated user data.
Expand Down Expand Up @@ -205,10 +201,6 @@ class UserLogin(BaseModel):
"""
Represents a user login model for authenticating user access.
This class includes two fields:
- user_uuid (int): The unique identifier for the user.
- password (str): The user's password for authentication.
Attributes:
user_uuid (int): The unique identifier for the user.
password (str): The user's password for authentication.
Expand All @@ -232,3 +224,21 @@ class Config:
"""

from_attributes = True


class TokenPayload(BaseModel):
"""
Represents a token payload model for JSON Web Tokens (JWT).
This class defines the structure of the payload contained within a JWT. It includes two fields:
Attributes:
- exp (int): The expiration timestamp (in seconds) indicating when the token will expire.
- sub (str): The subject field specifying the token's subject, typically representing a user or entity.
Note:
The payload is an essential part of a JWT and carries information about the token's validity and subject.
"""

exp: int
sub: str

0 comments on commit cb02590

Please sign in to comment.