Add confirm=? query-param to delete-user route and confirm dialog in flutter [skip-tests]
All checks were successful
Build Docker and Deploy / Run Unit-Tests (push) Has been skipped
Build Docker and Deploy / Build Docker Container (push) Successful in 1m7s
Build Docker and Deploy / Deploy to Server (push) Successful in 11s

This commit is contained in:
2025-05-11 15:43:06 +02:00
parent 7bbe321d3c
commit 255fc9337c
17 changed files with 417 additions and 437 deletions

View File

@@ -16,31 +16,31 @@ type DBLogger struct {
Ident string
}
func (l DBLogger) PrePing(ctx context.Context) error {
func (l DBLogger) PrePing(ctx context.Context, meta sq.PrePingMeta) error {
log.Debug().Msg("[SQL-PING]")
return nil
}
func (l DBLogger) PreTxBegin(ctx context.Context, txid uint16) error {
func (l DBLogger) PreTxBegin(ctx context.Context, txid uint16, meta sq.PreTxBeginMeta) error {
log.Debug().Msg(fmt.Sprintf("[SQL-TX<%s|%d>-START]", l.Ident, txid))
return nil
}
func (l DBLogger) PreTxCommit(txid uint16) error {
func (l DBLogger) PreTxCommit(txid uint16, meta sq.PreTxCommitMeta) error {
log.Debug().Msg(fmt.Sprintf("[SQL-TX<%s|%d>-COMMIT]", l.Ident, txid))
return nil
}
func (l DBLogger) PreTxRollback(txid uint16) error {
func (l DBLogger) PreTxRollback(txid uint16, meta sq.PreTxRollbackMeta) error {
log.Debug().Msg(fmt.Sprintf("[SQL-TX<%s|%d>-ROLLBACK]", l.Ident, txid))
return nil
}
func (l DBLogger) PreQuery(ctx context.Context, txID *uint16, sql *string, params *sq.PP) error {
func (l DBLogger) PreQuery(ctx context.Context, txID *uint16, sql *string, params *sq.PP, meta sq.PreQueryMeta) error {
if txID == nil {
log.Debug().Msg(fmt.Sprintf("[SQL<%s>-QUERY] %s", l.Ident, fmtSQLPrint(*sql)))
} else {
@@ -50,7 +50,7 @@ func (l DBLogger) PreQuery(ctx context.Context, txID *uint16, sql *string, param
return nil
}
func (l DBLogger) PreExec(ctx context.Context, txID *uint16, sql *string, params *sq.PP) error {
func (l DBLogger) PreExec(ctx context.Context, txID *uint16, sql *string, params *sq.PP, meta sq.PreExecMeta) error {
if txID == nil {
log.Debug().Msg(fmt.Sprintf("[SQL-<%s>-EXEC] %s", l.Ident, fmtSQLPrint(*sql)))
} else {
@@ -60,27 +60,27 @@ func (l DBLogger) PreExec(ctx context.Context, txID *uint16, sql *string, params
return nil
}
func (l DBLogger) PostPing(result error) {
func (l DBLogger) PostPing(result error, meta sq.PostPingMeta) {
//
}
func (l DBLogger) PostTxBegin(txid uint16, result error) {
func (l DBLogger) PostTxBegin(txid uint16, result error, meta sq.PostTxBeginMeta) {
//
}
func (l DBLogger) PostTxCommit(txid uint16, result error) {
func (l DBLogger) PostTxCommit(txid uint16, result error, meta sq.PostTxCommitMeta) {
//
}
func (l DBLogger) PostTxRollback(txid uint16, result error) {
func (l DBLogger) PostTxRollback(txid uint16, result error, meta sq.PostTxRollbackMeta) {
//
}
func (l DBLogger) PostQuery(txID *uint16, sqlOriginal string, sqlReal string, params sq.PP) {
func (l DBLogger) PostQuery(txID *uint16, sqlOriginal string, sqlReal string, params sq.PP, result error, meta sq.PostQueryMeta) {
//
}
func (l DBLogger) PostExec(txID *uint16, sqlOriginal string, sqlReal string, params sq.PP) {
func (l DBLogger) PostExec(txID *uint16, sqlOriginal string, sqlReal string, params sq.PP, result error, meta sq.PostExecMeta) {
//
}

View File

@@ -101,23 +101,23 @@ func (pp *DBPreprocessor) Init(ctx context.Context) error {
return nil
}
func (pp *DBPreprocessor) PrePing(ctx context.Context) error {
func (pp *DBPreprocessor) PrePing(ctx context.Context, meta sq.PrePingMeta) error {
return nil
}
func (pp *DBPreprocessor) PreTxBegin(ctx context.Context, txid uint16) error {
func (pp *DBPreprocessor) PreTxBegin(ctx context.Context, txid uint16, meta sq.PreTxBeginMeta) error {
return nil
}
func (pp *DBPreprocessor) PreTxCommit(txid uint16) error {
func (pp *DBPreprocessor) PreTxCommit(txid uint16, meta sq.PreTxCommitMeta) error {
return nil
}
func (pp *DBPreprocessor) PreTxRollback(txid uint16) error {
func (pp *DBPreprocessor) PreTxRollback(txid uint16, meta sq.PreTxRollbackMeta) error {
return nil
}
func (pp *DBPreprocessor) PreQuery(ctx context.Context, txID *uint16, sql *string, params *sq.PP) error {
func (pp *DBPreprocessor) PreQuery(ctx context.Context, txID *uint16, sql *string, params *sq.PP, meta sq.PreQueryMeta) error {
sqlOriginal := *sql
pp.lock.Lock()
@@ -223,30 +223,30 @@ func (pp *DBPreprocessor) PreQuery(ctx context.Context, txID *uint16, sql *strin
return nil
}
func (pp *DBPreprocessor) PreExec(ctx context.Context, txID *uint16, sql *string, params *sq.PP) error {
func (pp *DBPreprocessor) PreExec(ctx context.Context, txID *uint16, sql *string, params *sq.PP, meta sq.PreExecMeta) error {
return nil
}
func (pp *DBPreprocessor) PostPing(result error) {
func (pp *DBPreprocessor) PostPing(result error, meta sq.PostPingMeta) {
//
}
func (pp *DBPreprocessor) PostTxBegin(txid uint16, result error) {
func (pp *DBPreprocessor) PostTxBegin(txid uint16, result error, meta sq.PostTxBeginMeta) {
//
}
func (pp *DBPreprocessor) PostTxCommit(txid uint16, result error) {
func (pp *DBPreprocessor) PostTxCommit(txid uint16, result error, meta sq.PostTxCommitMeta) {
//
}
func (pp *DBPreprocessor) PostTxRollback(txid uint16, result error) {
func (pp *DBPreprocessor) PostTxRollback(txid uint16, result error, meta sq.PostTxRollbackMeta) {
//
}
func (pp *DBPreprocessor) PostQuery(txID *uint16, sqlOriginal string, sqlReal string, params sq.PP) {
func (pp *DBPreprocessor) PostQuery(txID *uint16, sqlOriginal string, sqlReal string, params sq.PP, result error, meta sq.PostQueryMeta) {
//
}
func (pp *DBPreprocessor) PostExec(txID *uint16, sqlOriginal string, sqlReal string, params sq.PP) {
func (pp *DBPreprocessor) PostExec(txID *uint16, sqlOriginal string, sqlReal string, params sq.PP, result error, meta sq.PostExecMeta) {
//
}

View File

@@ -19,63 +19,39 @@
"parameters": [
{
"type": "string",
"example": "test",
"name": "channel",
"in": "query"
},
{
"type": "string",
"example": "This is a message",
"name": "content",
"in": "query"
},
{
"type": "string",
"example": "P3TNH8mvv14fm",
"name": "key",
"in": "query"
},
{
"type": "string",
"example": "db8b0e6a-a08c-4646",
"name": "msg_id",
"in": "query"
},
{
"enum": [
0,
1,
2
],
"type": "integer",
"example": 1,
"name": "priority",
"in": "query"
},
{
"type": "string",
"example": "example-server",
"name": "sender_name",
"in": "query"
},
{
"type": "number",
"example": 1669824037,
"name": "timestamp",
"in": "query"
},
{
"type": "string",
"example": "Hello World",
"name": "title",
"in": "query"
},
{
"type": "string",
"example": "7725",
"type": "integer",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"name": "user_key",
"in": "query"
},
{
"description": " ",
"name": "post_body",
@@ -86,62 +62,38 @@
},
{
"type": "string",
"example": "test",
"name": "channel",
"in": "formData"
},
{
"type": "string",
"example": "This is a message",
"name": "content",
"in": "formData"
},
{
"type": "string",
"example": "P3TNH8mvv14fm",
"name": "key",
"in": "formData"
},
{
"type": "string",
"example": "db8b0e6a-a08c-4646",
"name": "msg_id",
"in": "formData"
},
{
"enum": [
0,
1,
2
],
"type": "integer",
"example": 1,
"name": "priority",
"in": "formData"
},
{
"type": "string",
"example": "example-server",
"name": "sender_name",
"in": "formData"
},
{
"type": "number",
"example": 1669824037,
"name": "timestamp",
"in": "formData"
},
{
"type": "string",
"example": "Hello World",
"name": "title",
"in": "formData"
},
{
"type": "string",
"example": "7725",
"type": "integer",
"name": "user_id",
"in": "formData"
},
{
"type": "string",
"name": "user_key",
"in": "formData"
}
],
"responses": {
@@ -1372,7 +1324,7 @@
}
}
},
"patch": {
"delete": {
"tags": [
"API-v2"
],
@@ -1419,6 +1371,71 @@
}
}
}
},
"patch": {
"description": "The body-values are optional, only send the ones you want to update",
"tags": [
"API-v2"
],
"summary": "(Partially) update a user",
"operationId": "api-user-update",
"parameters": [
{
"type": "string",
"description": "UserID",
"name": "uid",
"in": "path",
"required": true
},
{
"description": "Change the username (send an empty string to clear it)",
"name": "username",
"in": "body",
"schema": {
"type": "string"
}
},
{
"description": "Send a verification of premium purchase",
"name": "pro_token",
"in": "body",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.User"
}
},
"400": {
"description": "supplied values/parameters cannot be parsed / are invalid",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"401": {
"description": "user is not authorized / has missing permissions",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"404": {
"description": "user not found",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"500": {
"description": "internal server error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
}
}
}
},
"/api/v2/users/{uid}/channels": {
@@ -2795,63 +2812,39 @@
"parameters": [
{
"type": "string",
"example": "test",
"name": "channel",
"in": "query"
},
{
"type": "string",
"example": "This is a message",
"name": "content",
"in": "query"
},
{
"type": "string",
"example": "P3TNH8mvv14fm",
"name": "key",
"in": "query"
},
{
"type": "string",
"example": "db8b0e6a-a08c-4646",
"name": "msg_id",
"in": "query"
},
{
"enum": [
0,
1,
2
],
"type": "integer",
"example": 1,
"name": "priority",
"in": "query"
},
{
"type": "string",
"example": "example-server",
"name": "sender_name",
"in": "query"
},
{
"type": "number",
"example": 1669824037,
"name": "timestamp",
"in": "query"
},
{
"type": "string",
"example": "Hello World",
"name": "title",
"in": "query"
},
{
"type": "string",
"example": "7725",
"type": "integer",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"name": "user_key",
"in": "query"
},
{
"description": " ",
"name": "post_body",
@@ -2862,62 +2855,38 @@
},
{
"type": "string",
"example": "test",
"name": "channel",
"in": "formData"
},
{
"type": "string",
"example": "This is a message",
"name": "content",
"in": "formData"
},
{
"type": "string",
"example": "P3TNH8mvv14fm",
"name": "key",
"in": "formData"
},
{
"type": "string",
"example": "db8b0e6a-a08c-4646",
"name": "msg_id",
"in": "formData"
},
{
"enum": [
0,
1,
2
],
"type": "integer",
"example": 1,
"name": "priority",
"in": "formData"
},
{
"type": "string",
"example": "example-server",
"name": "sender_name",
"in": "formData"
},
{
"type": "number",
"example": 1669824037,
"name": "timestamp",
"in": "formData"
},
{
"type": "string",
"example": "Hello World",
"name": "title",
"in": "formData"
},
{
"type": "string",
"example": "7725",
"type": "integer",
"name": "user_id",
"in": "formData"
},
{
"type": "string",
"name": "user_key",
"in": "formData"
}
],
"responses": {
@@ -2965,121 +2934,73 @@
"parameters": [
{
"type": "string",
"example": "test",
"name": "channel",
"in": "query"
},
{
"type": "string",
"example": "This is a message",
"name": "content",
"in": "query"
},
{
"type": "string",
"example": "P3TNH8mvv14fm",
"name": "key",
"in": "query"
},
{
"type": "string",
"example": "db8b0e6a-a08c-4646",
"name": "msg_id",
"in": "query"
},
{
"enum": [
0,
1,
2
],
"type": "integer",
"example": 1,
"name": "priority",
"in": "query"
},
{
"type": "string",
"example": "example-server",
"name": "sender_name",
"in": "query"
},
{
"type": "number",
"example": 1669824037,
"name": "timestamp",
"in": "query"
},
{
"type": "string",
"example": "Hello World",
"name": "title",
"in": "query"
},
{
"type": "string",
"example": "7725",
"type": "integer",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"example": "test",
"name": "channel",
"in": "formData"
"name": "user_key",
"in": "query"
},
{
"type": "string",
"example": "This is a message",
"name": "content",
"in": "formData"
},
{
"type": "string",
"example": "P3TNH8mvv14fm",
"name": "key",
"in": "formData"
},
{
"type": "string",
"example": "db8b0e6a-a08c-4646",
"name": "msg_id",
"in": "formData"
},
{
"enum": [
0,
1,
2
],
"type": "integer",
"example": 1,
"name": "priority",
"in": "formData"
},
{
"type": "string",
"example": "example-server",
"name": "sender_name",
"in": "formData"
},
{
"type": "number",
"example": 1669824037,
"name": "timestamp",
"in": "formData"
},
{
"type": "string",
"example": "Hello World",
"name": "title",
"in": "formData"
},
{
"type": "string",
"example": "7725",
"type": "integer",
"name": "user_id",
"in": "formData"
},
{
"type": "string",
"name": "user_key",
"in": "formData"
}
],
"responses": {
@@ -3135,6 +3056,7 @@
1153,
1152,
1161,
1162,
1171,
1201,
1202,
@@ -3181,6 +3103,7 @@
"BINDFAIL_URI_PARAM",
"BINDFAIL_HEADER_PARAM",
"INVALID_BODY_PARAM",
"INVALID_QUERY_PARAM",
"INVALID_ENUM_VALUE",
"NO_TITLE",
"TITLE_TOO_LONG",
@@ -3591,46 +3514,26 @@
"handler.SendMessage.combined": {
"type": "object",
"properties": {
"channel": {
"type": "string",
"example": "test"
},
"content": {
"type": "string",
"example": "This is a message"
},
"key": {
"type": "string",
"example": "P3TNH8mvv14fm"
"type": "string"
},
"msg_id": {
"type": "string",
"example": "db8b0e6a-a08c-4646"
"type": "string"
},
"priority": {
"type": "integer",
"enum": [
0,
1,
2
],
"example": 1
},
"sender_name": {
"type": "string",
"example": "example-server"
"type": "integer"
},
"timestamp": {
"type": "number",
"example": 1669824037
"type": "number"
},
"title": {
"type": "string",
"example": "Hello World"
"type": "string"
},
"user_id": {
"type": "string",
"example": "7725"
"type": "integer"
},
"user_key": {
"type": "string"
}
}
},
@@ -3659,7 +3562,7 @@
"type": "integer"
},
"scn_msg_id": {
"type": "string"
"type": "integer"
},
"success": {
"type": "boolean"

View File

@@ -16,6 +16,7 @@ definitions:
- 1153
- 1152
- 1161
- 1162
- 1171
- 1201
- 1202
@@ -62,6 +63,7 @@ definitions:
- BINDFAIL_URI_PARAM
- BINDFAIL_HEADER_PARAM
- INVALID_BODY_PARAM
- INVALID_QUERY_PARAM
- INVALID_ENUM_VALUE
- NO_TITLE
- TITLE_TOO_LONG
@@ -338,36 +340,19 @@ definitions:
type: object
handler.SendMessage.combined:
properties:
channel:
example: test
type: string
content:
example: This is a message
type: string
key:
example: P3TNH8mvv14fm
type: string
msg_id:
example: db8b0e6a-a08c-4646
type: string
priority:
enum:
- 0
- 1
- 2
example: 1
type: integer
sender_name:
example: example-server
type: string
timestamp:
example: 1669824037
type: number
title:
example: Hello World
type: string
user_id:
example: "7725"
type: integer
user_key:
type: string
type: object
handler.SendMessage.response:
@@ -387,7 +372,7 @@ definitions:
quota_max:
type: integer
scn_msg_id:
type: string
type: integer
success:
type: boolean
suppress_send:
@@ -867,90 +852,52 @@ paths:
description: All parameter can be set via query-parameter or the json body.
Only UserID, UserKey and Title are required
parameters:
- example: test
in: query
name: channel
type: string
- example: This is a message
in: query
- in: query
name: content
type: string
- example: P3TNH8mvv14fm
in: query
name: key
type: string
- example: db8b0e6a-a08c-4646
in: query
- in: query
name: msg_id
type: string
- enum:
- 0
- 1
- 2
example: 1
in: query
- in: query
name: priority
type: integer
- example: example-server
in: query
name: sender_name
type: string
- example: 1669824037
in: query
- in: query
name: timestamp
type: number
- example: Hello World
in: query
- in: query
name: title
type: string
- example: "7725"
in: query
- in: query
name: user_id
type: integer
- in: query
name: user_key
type: string
- description: ' '
in: body
name: post_body
schema:
$ref: '#/definitions/handler.SendMessage.combined'
- example: test
in: formData
name: channel
type: string
- example: This is a message
in: formData
- in: formData
name: content
type: string
- example: P3TNH8mvv14fm
in: formData
name: key
type: string
- example: db8b0e6a-a08c-4646
in: formData
- in: formData
name: msg_id
type: string
- enum:
- 0
- 1
- 2
example: 1
in: formData
- in: formData
name: priority
type: integer
- example: example-server
in: formData
name: sender_name
type: string
- example: 1669824037
in: formData
- in: formData
name: timestamp
type: number
- example: Hello World
in: formData
- in: formData
name: title
type: string
- example: "7725"
in: formData
- in: formData
name: user_id
type: integer
- in: formData
name: user_key
type: string
responses:
"200":
@@ -1760,6 +1707,39 @@ paths:
tags:
- API-v2
/api/v2/users/{uid}:
delete:
operationId: api-user-delete
parameters:
- description: UserID
in: path
name: uid
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.User'
"400":
description: supplied values/parameters cannot be parsed / are invalid
schema:
$ref: '#/definitions/ginresp.apiError'
"401":
description: user is not authorized / has missing permissions
schema:
$ref: '#/definitions/ginresp.apiError'
"404":
description: user not found
schema:
$ref: '#/definitions/ginresp.apiError'
"500":
description: internal server error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: (Self-)Deletes a user (including all entities - all messages, channels,
clients, .....)
tags:
- API-v2
get:
operationId: api-user-get
parameters:
@@ -1793,13 +1773,24 @@ paths:
tags:
- API-v2
patch:
operationId: api-user-delete
description: The body-values are optional, only send the ones you want to update
operationId: api-user-update
parameters:
- description: UserID
in: path
name: uid
required: true
type: string
- description: Change the username (send an empty string to clear it)
in: body
name: username
schema:
type: string
- description: Send a verification of premium purchase
in: body
name: pro_token
schema:
type: string
responses:
"200":
description: OK
@@ -1821,8 +1812,7 @@ paths:
description: internal server error
schema:
$ref: '#/definitions/ginresp.apiError'
summary: (Self-)Deletes a user (including all entities - all messages, channels,
clients, .....)
summary: (Partially) update a user
tags:
- API-v2
/api/v2/users/{uid}/channels:
@@ -2772,90 +2762,52 @@ paths:
description: All parameter can be set via query-parameter or the json body.
Only UserID, UserKey and Title are required
parameters:
- example: test
in: query
name: channel
type: string
- example: This is a message
in: query
- in: query
name: content
type: string
- example: P3TNH8mvv14fm
in: query
name: key
type: string
- example: db8b0e6a-a08c-4646
in: query
- in: query
name: msg_id
type: string
- enum:
- 0
- 1
- 2
example: 1
in: query
- in: query
name: priority
type: integer
- example: example-server
in: query
name: sender_name
type: string
- example: 1669824037
in: query
- in: query
name: timestamp
type: number
- example: Hello World
in: query
- in: query
name: title
type: string
- example: "7725"
in: query
- in: query
name: user_id
type: integer
- in: query
name: user_key
type: string
- description: ' '
in: body
name: post_body
schema:
$ref: '#/definitions/handler.SendMessage.combined'
- example: test
in: formData
name: channel
type: string
- example: This is a message
in: formData
- in: formData
name: content
type: string
- example: P3TNH8mvv14fm
in: formData
name: key
type: string
- example: db8b0e6a-a08c-4646
in: formData
- in: formData
name: msg_id
type: string
- enum:
- 0
- 1
- 2
example: 1
in: formData
- in: formData
name: priority
type: integer
- example: example-server
in: formData
name: sender_name
type: string
- example: 1669824037
in: formData
- in: formData
name: timestamp
type: number
- example: Hello World
in: formData
- in: formData
name: title
type: string
- example: "7725"
in: formData
- in: formData
name: user_id
type: integer
- in: formData
name: user_key
type: string
responses:
"200":
@@ -2888,85 +2840,47 @@ paths:
description: All parameter can be set via query-parameter or form-data body.
Only UserID, UserKey and Title are required
parameters:
- example: test
in: query
name: channel
type: string
- example: This is a message
in: query
- in: query
name: content
type: string
- example: P3TNH8mvv14fm
in: query
name: key
type: string
- example: db8b0e6a-a08c-4646
in: query
- in: query
name: msg_id
type: string
- enum:
- 0
- 1
- 2
example: 1
in: query
- in: query
name: priority
type: integer
- example: example-server
in: query
name: sender_name
type: string
- example: 1669824037
in: query
- in: query
name: timestamp
type: number
- example: Hello World
in: query
- in: query
name: title
type: string
- example: "7725"
in: query
- in: query
name: user_id
type: integer
- in: query
name: user_key
type: string
- example: test
in: formData
name: channel
type: string
- example: This is a message
in: formData
- in: formData
name: content
type: string
- example: P3TNH8mvv14fm
in: formData
name: key
type: string
- example: db8b0e6a-a08c-4646
in: formData
- in: formData
name: msg_id
type: string
- enum:
- 0
- 1
- 2
example: 1
in: formData
- in: formData
name: priority
type: integer
- example: example-server
in: formData
name: sender_name
type: string
- example: 1669824037
in: formData
- in: formData
name: timestamp
type: number
- example: Hello World
in: formData
- in: formData
name: title
type: string
- example: "7725"
in: formData
- in: formData
name: user_id
type: integer
- in: formData
name: user_key
type: string
responses:
"200":

View File

@@ -203,10 +203,16 @@ func TestDeleteUser(t *testing.T) {
tt.RequestAuthGet[gin.H](t, admintok, baseUrl, "/api/v2/users/"+uid)
tt.RequestAuthDeleteShouldFail(t, readtok, baseUrl, "/api/v2/users/"+uid, nil, 401, apierr.USER_AUTH_FAILED)
tt.RequestAuthDeleteShouldFail(t, readtok, baseUrl, "/api/v2/users/"+uid+"?confirm=false", nil, 401, apierr.USER_AUTH_FAILED)
tt.RequestAuthDeleteShouldFail(t, readtok, baseUrl, "/api/v2/users/"+uid+"?confirm=true", nil, 401, apierr.USER_AUTH_FAILED)
tt.RequestAuthDeleteShouldFail(t, sendtok, baseUrl, "/api/v2/users/"+uid, nil, 401, apierr.USER_AUTH_FAILED)
tt.RequestAuthDeleteShouldFail(t, sendtok, baseUrl, "/api/v2/users/"+uid+"?confirm=false", nil, 401, apierr.USER_AUTH_FAILED)
tt.RequestAuthDeleteShouldFail(t, sendtok, baseUrl, "/api/v2/users/"+uid+"?confirm=true", nil, 401, apierr.USER_AUTH_FAILED)
tt.RequestAuthDelete[tt.Void](t, admintok, baseUrl, "/api/v2/users/"+uid, nil)
tt.RequestAuthDeleteShouldFail(t, admintok, baseUrl, "/api/v2/users/"+uid, nil, 400, apierr.INVALID_QUERY_PARAM)
tt.RequestAuthDeleteShouldFail(t, admintok, baseUrl, "/api/v2/users/"+uid+"?confirm=false", nil, 400, apierr.INVALID_QUERY_PARAM)
tt.RequestAuthDelete[tt.Void](t, admintok, baseUrl, "/api/v2/users/"+uid+"?confirm=true", nil)
tt.RequestAuthGetShouldFail(t, admintok, baseUrl, "/api/v2/users/"+uid, 401, apierr.USER_AUTH_FAILED)
}