1
0

User account deletion (#937)

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/937
Co-authored-by: konrad <konrad@kola-entertainments.de>
Co-committed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
konrad
2021-08-11 19:08:10 +00:00
parent cd21c5fc6e
commit 27119ad6d4
28 changed files with 1402 additions and 41 deletions

View File

@ -6315,6 +6315,144 @@ var doc = `{
}
}
},
"/user/deletion/cancel": {
"post": {
"description": "Aborts an in-progress user deletion.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Abort a user deletion request",
"parameters": [
{
"description": "The user password to confirm.",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1.UserDeletionRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Message"
}
},
"412": {
"description": "Bad password provided.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/user/deletion/confirm": {
"post": {
"description": "Confirms the deletion request of a user sent via email.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Confirm a user deletion request",
"parameters": [
{
"description": "The token.",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1.UserDeletionRequestConfirm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Message"
}
},
"412": {
"description": "Bad token provided.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/user/deletion/request": {
"post": {
"description": "Requests the deletion of the current user. It will trigger an email which has to be confirmed to start the deletion.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Request the deletion of the user",
"parameters": [
{
"description": "The user password.",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1.UserDeletionRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Message"
}
},
"412": {
"description": "Bad password provided.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/user/password": {
"post": {
"security": [
@ -8556,6 +8694,22 @@ var doc = `{
}
}
},
"v1.UserDeletionRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
}
}
},
"v1.UserDeletionRequestConfirm": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
},
"v1.UserPassword": {
"type": "object",
"properties": {
@ -8695,6 +8849,9 @@ var doc = `{
"totp_enabled": {
"type": "boolean"
},
"user_deletion_enabled": {
"type": "boolean"
},
"version": {
"type": "string"
}

View File

@ -6298,6 +6298,144 @@
}
}
},
"/user/deletion/cancel": {
"post": {
"description": "Aborts an in-progress user deletion.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Abort a user deletion request",
"parameters": [
{
"description": "The user password to confirm.",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1.UserDeletionRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Message"
}
},
"412": {
"description": "Bad password provided.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/user/deletion/confirm": {
"post": {
"description": "Confirms the deletion request of a user sent via email.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Confirm a user deletion request",
"parameters": [
{
"description": "The token.",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1.UserDeletionRequestConfirm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Message"
}
},
"412": {
"description": "Bad token provided.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/user/deletion/request": {
"post": {
"description": "Requests the deletion of the current user. It will trigger an email which has to be confirmed to start the deletion.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user"
],
"summary": "Request the deletion of the user",
"parameters": [
{
"description": "The user password.",
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1.UserDeletionRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Message"
}
},
"412": {
"description": "Bad password provided.",
"schema": {
"$ref": "#/definitions/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/user/password": {
"post": {
"security": [
@ -8539,6 +8677,22 @@
}
}
},
"v1.UserDeletionRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
}
}
},
"v1.UserDeletionRequestConfirm": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
},
"v1.UserPassword": {
"type": "object",
"properties": {
@ -8678,6 +8832,9 @@
"totp_enabled": {
"type": "boolean"
},
"user_deletion_enabled": {
"type": "boolean"
},
"version": {
"type": "string"
}

View File

@ -1185,6 +1185,16 @@ definitions:
email), `upload`, `initials`, `default`.
type: string
type: object
v1.UserDeletionRequest:
properties:
password:
type: string
type: object
v1.UserDeletionRequestConfirm:
properties:
token:
type: string
type: object
v1.UserPassword:
properties:
new_password:
@ -1284,6 +1294,8 @@ definitions:
type: boolean
totp_enabled:
type: boolean
user_deletion_enabled:
type: boolean
version:
type: string
type: object
@ -5531,6 +5543,97 @@ paths:
summary: Confirm the email of a new user
tags:
- user
/user/deletion/cancel:
post:
consumes:
- application/json
description: Aborts an in-progress user deletion.
parameters:
- description: The user password to confirm.
in: body
name: credentials
required: true
schema:
$ref: '#/definitions/v1.UserDeletionRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Message'
"412":
description: Bad password provided.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
summary: Abort a user deletion request
tags:
- user
/user/deletion/confirm:
post:
consumes:
- application/json
description: Confirms the deletion request of a user sent via email.
parameters:
- description: The token.
in: body
name: credentials
required: true
schema:
$ref: '#/definitions/v1.UserDeletionRequestConfirm'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Message'
"412":
description: Bad token provided.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
summary: Confirm a user deletion request
tags:
- user
/user/deletion/request:
post:
consumes:
- application/json
description: Requests the deletion of the current user. It will trigger an email
which has to be confirmed to start the deletion.
parameters:
- description: The user password.
in: body
name: credentials
required: true
schema:
$ref: '#/definitions/v1.UserDeletionRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Message'
"412":
description: Bad password provided.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
summary: Request the deletion of the user
tags:
- user
/user/password:
post:
consumes: