tsk-18: Create service user (#22)

Closes #18

Reviewed-on: phoenix/textsender-auth#22
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-11-20 19:11:36 +00:00
committed by phoenix
parent 8a90448854
commit c340693b24
17 changed files with 531 additions and 26 deletions
+59
View File
@@ -43,6 +43,22 @@ definitions:
username:
type: string
type: object
handler.ServiceCreationRequest:
properties:
passphrase:
type: string
username:
type: string
type: object
handler.ServiceCreationResponse:
properties:
data:
items:
$ref: '#/definitions/user.ServiceUser'
type: array
message:
type: string
type: object
token.Login:
properties:
access_token:
@@ -52,6 +68,17 @@ definitions:
token_type:
type: string
type: object
user.ServiceUser:
properties:
date_created:
type: string
id:
type: string
passphrase:
type: string
username:
type: string
type: object
host: localhost:9080
info:
contact: {}
@@ -123,6 +150,38 @@ paths:
summary: Register user
tags:
- users
/service/register:
post:
consumes:
- application/json
description: Create a service user that can send texts (requires JWT)
parameters:
- description: Data to add user
in: body
name: request
required: true
schema:
$ref: '#/definitions/handler.ServiceCreationRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.ServiceCreationResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handler.ServiceCreationResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handler.ServiceCreationResponse'
security:
- BearerAuth: []
summary: Register service user
tags:
- service users
securityDefinitions:
BearerAuth:
description: JWT Bearer Token