Skip to content

Commit

Permalink
docs: Update doc string of auth models
Browse files Browse the repository at this point in the history
  • Loading branch information
Giriharan219 committed Oct 24, 2024
1 parent 98092c4 commit d6df109
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions nisystemlink/clients/auth/models/_auth_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


class AuthStatement(JsonModel):
"""Auth Statement information."""

actions: Optional[List[str]] = None
"""
A list of actions the user is allowed to perform
Expand All @@ -26,13 +28,17 @@ class AuthStatement(JsonModel):


class AuthPolicy(JsonModel):
"""Auth Policy information."""

statements: Optional[List[AuthStatement]] = None
"""
A list of statements defining the actions the user can perform on a resource in a workspace
"""


class Statement(JsonModel):
"""Statement information."""

actions: Optional[List[str]] = None
"""
A list of actions the user is allowed to perform
Expand All @@ -52,6 +58,8 @@ class Statement(JsonModel):


class Policy(JsonModel):
"""Policy information."""

id: Optional[str] = Field(None, example="policy-id")
"""
The unique id
Expand Down Expand Up @@ -107,11 +115,15 @@ class Policy(JsonModel):


class Status(Enum):
"""Enumeration to represent different status of user's registration."""

PENDING = "pending"
ACTIVE = "active"


class User(JsonModel):
"""User information."""

id: Optional[str] = Field(None, example="user-id")
"""
The unique id
Expand Down Expand Up @@ -182,6 +194,8 @@ class User(JsonModel):


class Org(JsonModel):
"""User's Organization information."""

id: Optional[str] = Field(None, example="org-id")
"""
The unique id
Expand All @@ -197,6 +211,8 @@ class Org(JsonModel):


class Workspace(JsonModel):
"""Workspace information."""

id: Optional[str] = Field(None, example="workspace-id")
"""
The unique id
Expand All @@ -220,12 +236,22 @@ class AuthInfo(JsonModel):
"""Information about the authenticated caller."""

user: Optional[User]
"""Details of authenticated caller"""
"""
Details of authenticated caller
"""
org: Optional[Org]
"""Organization of authenticated caller"""
"""
Organization of authenticated caller
"""
workspaces: Optional[List[Workspace]]
"""List of workspaces the authenticated caller has access"""
"""
List of workspaces the authenticated caller has access
"""
policies: Optional[List[AuthPolicy]]
"""List of policies for the authenticated caller"""
"""
List of policies for the authenticated caller
"""
properties: Optional[Dict[str, str]] = Field(None, example={"key1": "value1"})
"""A map of key value properties"""
"""
A map of key value properties
"""

0 comments on commit d6df109

Please sign in to comment.