[462] | 1 | openapi: 3.1.0
|
---|
| 2 | info:
|
---|
| 3 | title: Whitelist
|
---|
| 4 | version: '1'
|
---|
| 5 |
|
---|
| 6 | components:
|
---|
| 7 | schemas:
|
---|
| 8 | WhitelistUserElement:
|
---|
| 9 | type: object
|
---|
| 10 | properties:
|
---|
| 11 | name:
|
---|
| 12 | type: string
|
---|
| 13 | examples:
|
---|
| 14 | - TheFunPimp
|
---|
| 15 | description: Name of the banned player for display purposes. Can be empty.
|
---|
| 16 | userId:
|
---|
| 17 | $ref: './openapi.yaml#/components/schemas/TypeUserIdObject'
|
---|
| 18 | required:
|
---|
| 19 | - name
|
---|
| 20 | - userId
|
---|
| 21 |
|
---|
| 22 | WhitelistUserList:
|
---|
| 23 | type: array
|
---|
| 24 | items:
|
---|
| 25 | $ref: '#/components/schemas/WhitelistUserElement'
|
---|
| 26 |
|
---|
| 27 | WhiteListGroupElement:
|
---|
| 28 | type: object
|
---|
| 29 | properties:
|
---|
| 30 | name:
|
---|
| 31 | type: string
|
---|
| 32 | examples:
|
---|
| 33 | - Steam Universe
|
---|
| 34 | description: Name of the group for display purposes. Can be empty.
|
---|
| 35 | groupId:
|
---|
| 36 | type: string
|
---|
| 37 | examples:
|
---|
| 38 | - '103582791434672565'
|
---|
| 39 | required:
|
---|
| 40 | - name
|
---|
| 41 | - groupId
|
---|
| 42 |
|
---|
| 43 | WhiteListGroupList:
|
---|
| 44 | type: array
|
---|
| 45 | items:
|
---|
| 46 | $ref: '#/components/schemas/WhiteListGroupElement'
|
---|
| 47 |
|
---|
| 48 | UserPermissionsObject:
|
---|
| 49 | type: object
|
---|
| 50 | properties:
|
---|
| 51 | users:
|
---|
| 52 | $ref: '#/components/schemas/WhitelistUserList'
|
---|
| 53 | groups:
|
---|
| 54 | $ref: '#/components/schemas/WhiteListGroupList'
|
---|
| 55 | required:
|
---|
| 56 | - users
|
---|
| 57 | - groups
|
---|
| 58 |
|
---|
| 59 | TypeGroupIdString:
|
---|
| 60 | type: string
|
---|
| 61 | examples:
|
---|
| 62 | - '103582791434672565'
|
---|
| 63 |
|
---|
| 64 | UserPermissionPostBodyObject:
|
---|
| 65 | type: object
|
---|
| 66 | properties:
|
---|
| 67 | name:
|
---|
| 68 | type: string
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | parameters:
|
---|
| 72 | UserIdParameter:
|
---|
| 73 | name: id
|
---|
| 74 | in: path
|
---|
| 75 | required: true
|
---|
| 76 | schema:
|
---|
| 77 | $ref: './openapi.yaml#/components/schemas/TypeUserIdString'
|
---|
| 78 |
|
---|
| 79 | GroupIdParameter:
|
---|
| 80 | name: id
|
---|
| 81 | in: path
|
---|
| 82 | required: true
|
---|
| 83 | schema:
|
---|
| 84 | $ref: '#/components/schemas/TypeGroupIdString'
|
---|
| 85 |
|
---|
| 86 |
|
---|
| 87 | requestBodies:
|
---|
| 88 | WhitelistBodyIn:
|
---|
| 89 | content:
|
---|
| 90 | application/json:
|
---|
| 91 | schema:
|
---|
| 92 | $ref: '#/components/schemas/UserPermissionPostBodyObject'
|
---|
| 93 | required: true
|
---|
| 94 |
|
---|
| 95 |
|
---|
| 96 | paths:
|
---|
| 97 | /api/whitelist:
|
---|
| 98 | get:
|
---|
| 99 | tags:
|
---|
| 100 | - Permissions
|
---|
| 101 | summary: Whitelist list
|
---|
| 102 | description: Fetch a list of all whitelisted users / groups
|
---|
| 103 | operationId: Whitelist.get
|
---|
| 104 | responses:
|
---|
| 105 | 200:
|
---|
| 106 | description: List of whitelist entries
|
---|
| 107 | content:
|
---|
| 108 | application/json:
|
---|
| 109 | schema:
|
---|
| 110 | type: object
|
---|
| 111 | properties:
|
---|
| 112 | data:
|
---|
| 113 | $ref: '#/components/schemas/UserPermissionsObject'
|
---|
| 114 | meta:
|
---|
| 115 | $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
|
---|
| 116 | required:
|
---|
| 117 | - data
|
---|
| 118 | - meta
|
---|
| 119 | 403:
|
---|
| 120 | $ref: './openapi.yaml#/components/responses/Unauthorized'
|
---|
| 121 | security:
|
---|
| 122 | - apiTokenName: [ ]
|
---|
| 123 | apiTokenSecret: [ ]
|
---|
| 124 | - sessionCookie: [ ]
|
---|
| 125 |
|
---|
| 126 |
|
---|
| 127 | /api/whitelist/user/{id}:
|
---|
| 128 | post:
|
---|
| 129 | tags:
|
---|
| 130 | - Permissions
|
---|
| 131 | summary: Whitelist user create
|
---|
| 132 | description: Create or update a whitelist user
|
---|
| 133 | operationId: Whitelist.post.user.id
|
---|
| 134 | parameters:
|
---|
| 135 | - $ref: '#/components/parameters/UserIdParameter'
|
---|
| 136 | requestBody:
|
---|
| 137 | $ref: '#/components/requestBodies/WhitelistBodyIn'
|
---|
| 138 | responses:
|
---|
| 139 | 201:
|
---|
| 140 | description: Whitelist user created or updated
|
---|
| 141 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 142 | 400:
|
---|
| 143 | description: Invalid request, errorCode will be one of 'NO_USER_OR_GROUP' or 'INVALID_USER'
|
---|
| 144 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 145 | 403:
|
---|
| 146 | $ref: './openapi.yaml#/components/responses/Unauthorized'
|
---|
| 147 | security:
|
---|
| 148 | - apiTokenName: []
|
---|
| 149 | apiTokenSecret: []
|
---|
| 150 | - sessionCookie: []
|
---|
| 151 |
|
---|
| 152 | delete:
|
---|
| 153 | tags:
|
---|
| 154 | - Permissions
|
---|
| 155 | summary: Whitelist user delete
|
---|
| 156 | description: Delete a single whitelist user
|
---|
| 157 | operationId: Whitelist.delete.user.id
|
---|
| 158 | parameters:
|
---|
| 159 | - $ref: '#/components/parameters/UserIdParameter'
|
---|
| 160 | responses:
|
---|
| 161 | 204:
|
---|
| 162 | description: Deleted whitelist user
|
---|
| 163 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 164 | 400:
|
---|
| 165 | description: Invalid request, errorCode will be one of 'NO_USER_OR_GROUP' or 'INVALID_USER'
|
---|
| 166 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 167 | 404:
|
---|
| 168 | description: User ID not found
|
---|
| 169 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 170 | 403:
|
---|
| 171 | $ref: './openapi.yaml#/components/responses/Unauthorized'
|
---|
| 172 | security:
|
---|
| 173 | - apiTokenName: []
|
---|
| 174 | apiTokenSecret: []
|
---|
| 175 | - sessionCookie: []
|
---|
| 176 |
|
---|
| 177 |
|
---|
| 178 | /api/whitelist/group/{id}:
|
---|
| 179 | post:
|
---|
| 180 | tags:
|
---|
| 181 | - Permissions
|
---|
| 182 | summary: Whitelist group create
|
---|
| 183 | description: Create or update a whitelist group
|
---|
| 184 | operationId: Whitelist.post.group.id
|
---|
| 185 | parameters:
|
---|
| 186 | - $ref: '#/components/parameters/GroupIdParameter'
|
---|
| 187 | requestBody:
|
---|
| 188 | $ref: '#/components/requestBodies/WhitelistBodyIn'
|
---|
| 189 | responses:
|
---|
| 190 | 201:
|
---|
| 191 | description: Whitelist group created or updated
|
---|
| 192 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 193 | 400:
|
---|
| 194 | description: Invalid request, errorCode will be one of 'NO_USER_OR_GROUP' or 'INVALID_GROUP'
|
---|
| 195 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 196 | 403:
|
---|
| 197 | $ref: './openapi.yaml#/components/responses/Unauthorized'
|
---|
| 198 | security:
|
---|
| 199 | - apiTokenName: []
|
---|
| 200 | apiTokenSecret: []
|
---|
| 201 | - sessionCookie: []
|
---|
| 202 |
|
---|
| 203 | delete:
|
---|
| 204 | tags:
|
---|
| 205 | - Permissions
|
---|
| 206 | summary: Whitelist group delete
|
---|
| 207 | description: Delete a single whitelist group
|
---|
| 208 | operationId: Whitelist.delete.group.id
|
---|
| 209 | parameters:
|
---|
| 210 | - $ref: '#/components/parameters/GroupIdParameter'
|
---|
| 211 | responses:
|
---|
| 212 | 204:
|
---|
| 213 | description: Deleted whitelist group
|
---|
| 214 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 215 | 400:
|
---|
| 216 | description: Invalid request, errorCode will be one of 'NO_USER_OR_GROUP', 'INVALID_GROUP'
|
---|
| 217 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 218 | 404:
|
---|
| 219 | description: Group ID not found
|
---|
| 220 | $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
|
---|
| 221 | 403:
|
---|
| 222 | $ref: './openapi.yaml#/components/responses/Unauthorized'
|
---|
| 223 | security:
|
---|
| 224 | - apiTokenName: []
|
---|
| 225 | apiTokenSecret: []
|
---|
| 226 | - sessionCookie: []
|
---|