390 lines
12 KiB
JSON
390 lines
12 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"contact": {}
|
|
},
|
|
"paths": {
|
|
"/auth/authenticate": {
|
|
"post": {
|
|
"description": "Authenticate user with wallet signature",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Authenticate user",
|
|
"parameters": [
|
|
{
|
|
"description": "Authentication Request",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.AuthenticateRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.AuthenticateResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/challenge": {
|
|
"post": {
|
|
"description": "Generate a challenge message for wallet authentication",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Generate authentication challenge",
|
|
"parameters": [
|
|
{
|
|
"description": "Challenge Request",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.ChallengeRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.ChallengeResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/send-otp": {
|
|
"post": {
|
|
"description": "Send OTP code to the provided phone number",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Send OTP code",
|
|
"parameters": [
|
|
{
|
|
"description": "OTP Request",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.OTPProviderReq"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.OTPProviderResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/verify-kyc": {
|
|
"post": {
|
|
"description": "Verify user KYC with national ID and birth date",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Verify user KYC",
|
|
"parameters": [
|
|
{
|
|
"description": "KYC Verify Request",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.KYCVerifyRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.KYCVerifyResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/verify-otp": {
|
|
"post": {
|
|
"description": "Verify the provided OTP code for the phone number",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"summary": "Verify OTP code",
|
|
"parameters": [
|
|
{
|
|
"description": "OTP Verify Request",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.OTPVerifyRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/dto.OTPVerifyResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"dto.AuthenticateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"pubKey",
|
|
"signature"
|
|
],
|
|
"properties": {
|
|
"pubKey": {
|
|
"type": "string"
|
|
},
|
|
"signature": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.AuthenticateResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"authorizationToken": {
|
|
"type": "string"
|
|
},
|
|
"expiresAt": {
|
|
"type": "integer"
|
|
},
|
|
"refreshToken": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.ChallengeRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"pubKey"
|
|
],
|
|
"properties": {
|
|
"pubKey": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.ChallengeResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"expiresAt": {
|
|
"type": "string"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"timeStamp": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.KYCVerifyRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"birthDate",
|
|
"nationalId",
|
|
"userId"
|
|
],
|
|
"properties": {
|
|
"birthDate": {
|
|
"type": "string"
|
|
},
|
|
"nationalId": {
|
|
"type": "string"
|
|
},
|
|
"userId": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.KYCVerifyResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.OTPProviderReq": {
|
|
"type": "object",
|
|
"properties": {
|
|
"receptor": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.OTPProviderResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.OTPVerifyRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"code",
|
|
"phone"
|
|
],
|
|
"properties": {
|
|
"code": {
|
|
"type": "string"
|
|
},
|
|
"phone": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"dto.OTPVerifyResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |