diff --git a/static/api-specs/idn/beta/paths/login-info.yaml b/static/api-specs/idn/beta/paths/login-info.yaml new file mode 100644 index 000000000..fe5cff09e --- /dev/null +++ b/static/api-specs/idn/beta/paths/login-info.yaml @@ -0,0 +1,38 @@ +get: + operationId: getLoginInfo + tags: + - Login Info + summary: Get Login Info + description: >- + Fetches the PTA or Non-PTA information from a user's Auth Profile. This endpoint will be called by UI before + authentication to determine if a password should be hashed (Non-PTA) or encrypted with a public key (PTA). + The public key (if available) and encryption type (PKI or HASH) are returned by this endpoint. + parameters: + - in: query + name: uid + schema: + type: string + required: true + description: The user ID + example: Esperanza.roleadmf + responses: + '200': + description: Request succeeded. + content: + application/json: + schema: + $ref: '../schemas/LoginInfoResponse.yaml' + '400': + description: Request failed due to missing uid param. + content: + application/json: + schema: + $ref: '../schemas/LoginInfoErrorResponse.yaml' + '401': + $ref: '../../v3/responses/401.yaml' + '403': + $ref: '../../v3/responses/403.yaml' + '429': + $ref: '../../v3/responses/429.yaml' + '500': + $ref: '../../v3/responses/500.yaml' \ No newline at end of file diff --git a/static/api-specs/idn/beta/schemas/LoginInfoErrorResponse.yaml b/static/api-specs/idn/beta/schemas/LoginInfoErrorResponse.yaml new file mode 100644 index 000000000..c158b26f8 --- /dev/null +++ b/static/api-specs/idn/beta/schemas/LoginInfoErrorResponse.yaml @@ -0,0 +1,24 @@ +type: object +properties: + timestamp: + type: string + description: an RFC-3339 timestamp of when the error was generated. + example: 2022-10-27T20:25:02+00:00 + status: + type: integer + description: The error code. Always 400. + format: int32 + example: 400 + error: + type: string + description: The error type. Always Bad Request. + example: Bad Request + path: + type: string + description: The relative path of the request. Always /login/login-info. + example: /login/login-info +required: + - timestamp + - status + - error + - path diff --git a/static/api-specs/idn/beta/schemas/LoginInfoResponse.yaml b/static/api-specs/idn/beta/schemas/LoginInfoResponse.yaml new file mode 100644 index 000000000..0306e28bd --- /dev/null +++ b/static/api-specs/idn/beta/schemas/LoginInfoResponse.yaml @@ -0,0 +1,13 @@ +type: object +properties: + encryption: + type: string + description: the encryption type of the user's password. PKI if they are an AD user, HASH otherwise. + example: PKI + publicKey: + type: string + description: The public key of the org, if a request was made with an AD user. + example: -----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArHB72hqWFM6sqM5yo9FdJc8221o8HoS/hEQqkDMQ+7WGuNZ83NjV3Td2lDO6Nzkuzzx1tf4Y24a2mdZojLRHJKyct/JKlaDFOOFDAjCKtUp0UGuWCMnTt2oUhxxJAC9r9KAxYL3MpWPGQGHNFWbabsEStOm3wHVyS3+AmThC6ops0OaAUecbboMSXiLJDKXX7MEpixZJKshkH0qvqzqgr+DpwKHOTelZDnK//XCCwPEuR7ykbfPzvgoJyUSj/obMcOuSzDSMbKplYho/NWhO9uh2PXvR+KGRkazkHsc5y5Zc0ggzMcMg6Vqhjt82Yn8RKr29IN8NyyvQDVejzsIsDwIDAQAB-----END PUBLIC KEY----- +required: + - id + - publicKey