api login method

This commit is contained in:
Stephan D
2026-02-28 10:07:52 +01:00
parent f50313c30b
commit 800f8c12f8
19 changed files with 455 additions and 24 deletions

View File

@@ -0,0 +1,30 @@
post:
tags: [Accounts, Auth]
summary: API login using email/password and client credentials
description: |
Validates account credentials and eligible API client credentials, then returns final auth payload.
This endpoint bypasses login OTP/2FA and is intended only for approved API clients.
If the client definition includes `allowedCIDRs`, request source IP must match one of those CIDRs.
operationId: accountsApiLogin
requestBody:
$ref: ./bodies/auth.yaml#/components/requestBodies/ApiLoginBody
responses:
'200':
description: Login successful
content:
application/json:
schema:
allOf:
- $ref: ../response/response.yaml#/components/schemas/BaseResponse
- type: object
properties:
data:
$ref: ./response/auth.yaml#/components/schemas/LoginData
'400':
$ref: ../response/operation.yaml#/components/responses/BadRequest
'401':
$ref: ../response/operation.yaml#/components/responses/Unauthorized
'403':
$ref: ../response/operation.yaml#/components/responses/Forbidden
'500':
$ref: ../response/operation.yaml#/components/responses/InternalServerError

View File

@@ -6,6 +6,12 @@ components:
application/json:
schema:
$ref: ../request/auth.yaml#/components/schemas/LoginRequest
ApiLoginBody:
required: true
content:
application/json:
schema:
$ref: ../request/auth.yaml#/components/schemas/ApiLoginRequest
RefreshTokenBody:
required: true

View File

@@ -8,10 +8,26 @@ components:
properties:
clientId:
type: string
description: Client identifier bound to refresh token lifecycle and client policy checks.
deviceId:
type: string
login:
$ref: ../../../models/auth/login_data.yaml#/components/schemas/LoginData
ApiLoginRequest:
allOf:
- $ref: ./auth.yaml#/components/schemas/LoginRequest
- type: object
additionalProperties: false
required:
- clientId
- deviceId
- clientSecret
properties:
clientSecret:
type: string
format: password
description: Client secret for `client_secret_post` authentication.
RefreshTokenRequest:
$ref: ../../../models/auth/client_refresh_token.yaml#/components/schemas/ClientRefreshToken