{"openapi":"3.1.0","info":{"title":"CertCode Auth Server","description":"Authentication server for user login","version":"1.0.0"},"paths":{"/register":{"post":{"summary":"Register","description":"Register a new user.\nUser must be associated with an existing issuer.","operationId":"register_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/login":{"post":{"summary":"Login","description":"Login with username and password.\nReturns JWT access token.","operationId":"login_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/login":{"post":{"summary":"Superadmin Login","description":"SuperAdmin login using credentials from .env file.\nReturns JWT access token with role='superadmin'.","operationId":"superadmin_login_superadmin_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me":{"get":{"summary":"Get Current User Info","description":"Get current logged-in user information.\nRequires valid JWT token in Authorization header.\nIncludes issuer_identifier from associated issuer.","operationId":"get_current_user_info_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/change-password":{"post":{"summary":"Change Password","description":"Change user password.\nIf user has password_must_change flag, old_password must match.\nValidates that new password is strong enough.","operationId":"change_password_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChange"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/issuers":{"get":{"summary":"List Issuers","description":"Get list of all active issuers.\nUsed for registration dropdown.","operationId":"list_issuers_issuers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/IssuerResponse"},"type":"array","title":"Response List Issuers Issuers Get"}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IssuerResponse":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["id","name","is_active"],"title":"IssuerResponse"},"PasswordChange":{"properties":{"old_password":{"type":"string","title":"Old Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["old_password","new_password"],"title":"PasswordChange"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"},"password_must_change":{"type":"boolean","title":"Password Must Change","default":false}},"type":"object","required":["access_token","token_type"],"title":"Token"},"UserCreate":{"properties":{"username":{"type":"string","title":"Username"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"issuer_id":{"type":"integer","title":"Issuer Id"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","issuer_id","password"],"title":"UserCreate"},"UserLogin":{"properties":{"issuer_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuer Identifier"},"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"UserLogin"},"UserResponse":{"properties":{"username":{"type":"string","title":"Username"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"issuer_id":{"type":"integer","title":"Issuer Id"},"id":{"type":"integer","title":"Id"},"is_active":{"type":"boolean","title":"Is Active"},"is_admin":{"type":"boolean","title":"Is Admin"},"password_must_change":{"type":"boolean","title":"Password Must Change"},"issuer_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuer Identifier"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["username","issuer_id","id","is_active","is_admin","password_must_change","created_at"],"title":"UserResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}