mirror of
https://github.com/h44z/wg-portal
synced 2025-02-26 05:49:14 +00:00
api: remove IsAdmin from required attributes (#366)
This commit is contained in:
parent
5697c2b7f2
commit
43163273fa
@ -549,7 +549,6 @@ definitions:
|
||||
type: string
|
||||
required:
|
||||
- Identifier
|
||||
- IsAdmin
|
||||
type: object
|
||||
models.UserInformation:
|
||||
properties:
|
||||
|
@ -1363,6 +1363,50 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/{id}/interfaces": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Users"
|
||||
],
|
||||
"summary": "Get interfaces for the given user. Returns an empty list if self provisioning is disabled.",
|
||||
"operationId": "users_handleInterfacesGet",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "The user identifier",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/model.Interface"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.Error"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/model.Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/{id}/peers": {
|
||||
"get": {
|
||||
"produces": [
|
||||
@ -1373,6 +1417,15 @@
|
||||
],
|
||||
"summary": "Get peers for the given user.",
|
||||
"operationId": "users_handlePeersGet",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "The user identifier",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
@ -1408,6 +1461,15 @@
|
||||
],
|
||||
"summary": "Get peer stats for the given user.",
|
||||
"operationId": "users_handleStatsGet",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "The user identifier",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
|
@ -1262,9 +1262,45 @@ paths:
|
||||
summary: Enable the REST API for the given user.
|
||||
tags:
|
||||
- Users
|
||||
/user/{id}/interfaces:
|
||||
get:
|
||||
operationId: users_handleInterfacesGet
|
||||
parameters:
|
||||
- description: The user identifier
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/model.Interface'
|
||||
type: array
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/model.Error'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/model.Error'
|
||||
summary: Get interfaces for the given user. Returns an empty list if self provisioning
|
||||
is disabled.
|
||||
tags:
|
||||
- Users
|
||||
/user/{id}/peers:
|
||||
get:
|
||||
operationId: users_handlePeersGet
|
||||
parameters:
|
||||
- description: The user identifier
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
@ -1288,6 +1324,12 @@ paths:
|
||||
/user/{id}/stats:
|
||||
get:
|
||||
operationId: users_handleStatsGet
|
||||
parameters:
|
||||
- description: The user identifier
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
|
@ -1998,8 +1998,7 @@
|
||||
"models.User": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"Identifier",
|
||||
"IsAdmin"
|
||||
"Identifier"
|
||||
],
|
||||
"properties": {
|
||||
"ApiEnabled": {
|
||||
|
@ -549,7 +549,6 @@ definitions:
|
||||
type: string
|
||||
required:
|
||||
- Identifier
|
||||
- IsAdmin
|
||||
type: object
|
||||
models.UserInformation:
|
||||
properties:
|
||||
|
@ -17,7 +17,7 @@ type User struct {
|
||||
// The name of the authentication provider. This field is read-only.
|
||||
ProviderName string `json:"ProviderName,omitempty" readonly:"true" example:""`
|
||||
// If this field is set, the user is an admin.
|
||||
IsAdmin bool `json:"IsAdmin" binding:"required" example:"false"`
|
||||
IsAdmin bool `json:"IsAdmin" example:"false"`
|
||||
|
||||
// The first name of the user. This field is optional.
|
||||
Firstname string `json:"Firstname" example:"Max"`
|
||||
|
Loading…
Reference in New Issue
Block a user