fix: commit semantic repair changes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# [DEF:backend.src.services.auth_service:Module]
|
||||
# [DEF:auth_service:Module]
|
||||
# @COMPLEXITY: 5
|
||||
# @SEMANTICS: auth, service, business-logic, login, jwt, adfs, jit-provisioning
|
||||
# @PURPOSE: Orchestrates credential authentication and ADFS JIT user provisioning.
|
||||
@@ -30,7 +30,7 @@ from ..core.logger import belief_scope
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Provides high-level authentication services.
|
||||
class AuthService:
|
||||
# [DEF:AuthService.__init__:Function]
|
||||
# [DEF:AuthService_init:Function]
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Initializes the authentication service with repository access over an active DB session.
|
||||
# @PRE: db is a valid SQLAlchemy Session instance bound to the auth persistence context.
|
||||
@@ -41,9 +41,9 @@ class AuthService:
|
||||
def __init__(self, db: Session):
|
||||
self.db = db
|
||||
self.repo = AuthRepository(db)
|
||||
# [/DEF:AuthService.__init__:Function]
|
||||
# [/DEF:AuthService_init:Function]
|
||||
|
||||
# [DEF:AuthService.authenticate_user:Function]
|
||||
# [DEF:authenticate_user:Function]
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Validates credentials and account state for local username/password authentication.
|
||||
# @PRE: username and password are non-empty credential inputs.
|
||||
@@ -68,9 +68,9 @@ class AuthService:
|
||||
self.db.refresh(user)
|
||||
|
||||
return user
|
||||
# [/DEF:AuthService.authenticate_user:Function]
|
||||
# [/DEF:authenticate_user:Function]
|
||||
|
||||
# [DEF:AuthService.create_session:Function]
|
||||
# [DEF:create_session:Function]
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Issues an access token payload for an already authenticated user.
|
||||
# @PRE: user is a valid User entity containing username and iterable roles with role.name values.
|
||||
@@ -86,9 +86,9 @@ class AuthService:
|
||||
data={"sub": user.username, "scopes": roles}
|
||||
)
|
||||
return {"access_token": access_token, "token_type": "bearer"}
|
||||
# [/DEF:AuthService.create_session:Function]
|
||||
# [/DEF:create_session:Function]
|
||||
|
||||
# [DEF:AuthService.provision_adfs_user:Function]
|
||||
# [DEF:provision_adfs_user:Function]
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Performs ADFS Just-In-Time provisioning and role synchronization from AD group mappings.
|
||||
# @PRE: user_info contains identity claims where at least one of 'upn' or 'email' is present; 'groups' may be absent.
|
||||
@@ -125,7 +125,7 @@ class AuthService:
|
||||
self.db.refresh(user)
|
||||
|
||||
return user
|
||||
# [/DEF:AuthService.provision_adfs_user:Function]
|
||||
# [/DEF:provision_adfs_user:Function]
|
||||
# [/DEF:AuthService:Class]
|
||||
|
||||
# [/DEF:backend.src.services.auth_service:Module]
|
||||
# [/DEF:auth_service:Module]
|
||||
Reference in New Issue
Block a user