Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openapi/components/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@
$ref: "./paths/inventory.yaml#/paths/~1user~1{userId}~1inventory~1{inventoryItemId}"
"/user/{userId}/listings":
$ref: "./paths/economy.yaml#/paths/~1user~1{userId}~1listings"
"/user/{userId}/moderations":
$ref: "./paths/users.yaml#/paths/~1user~1{userId}~1moderations"
"/user/{userId}/products":
$ref: "./paths/economy.yaml#/paths/~1user~1{userId}~1products"
"/user/{userId}/tilia/kyc":
Expand Down
30 changes: 30 additions & 0 deletions openapi/components/paths/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,36 @@ paths:
$ref: ../responses/users/PrivateProfileResponse.yaml
"401":
$ref: ../responses/MissingCredentialsError.yaml
"/user/{userId}/moderations":
parameters:
- $ref: ../parameters.yaml#/userId
post:
operationId: createUserModeration
summary: Create User Moderation
description: With `type` `kick`, bans the user in the path from the instance given by `worldId` and `instanceId`. The user is not removed from the instance, but cannot join it again, even by invite.
tags:
- users
requestBody:
required: true
content:
application/json:
schema:
$ref: ../requests/CreateUserModerationRequest.yaml
security:
- authCookie: []
responses:
"200":
$ref: ../responses/users/CreateUserModerationResponse.yaml
"400":
$ref: ../responses/RequestValidationError.yaml
"401":
$ref: ../responses/MissingCredentialsError.yaml
"403":
$ref: ../responses/users/CreateUserModerationForbiddenError.yaml
"404":
$ref: ../responses/ResourceNotFoundError.yaml
"429":
$ref: ../responses/users/CreateUserModerationRateLimitError.yaml
/userNotes:
get:
operationId: getUserNotes
Expand Down
19 changes: 19 additions & 0 deletions openapi/components/requests/CreateUserModerationRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: CreateUserModerationRequest
type: object
properties:
expires:
type: string
format: date-time
instanceId:
$ref: ../schemas/InstanceID.yaml
isPermanent:
type: boolean
reason:
type: string
type:
$ref: ../schemas/CreateUserModerationRequestType.yaml
worldId:
$ref: ../schemas/WorldID.yaml
required:
- reason
- type
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Error response when the user in the path can't be moderated, such as when they aren't in the instance given by `worldId` and `instanceId`, either of those is missing, or the user is you.
content:
application/json:
examples:
Cannot Moderate User:
value:
error:
message: You cannot moderate this user․
status_code: 403
schema:
$ref: ../../schemas/Error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Error response when moderating the same user too often.
content:
application/json:
examples:
Too Many Moderations:
value:
error:
message: Too many moderations being created at one player․
status_code: 429
schema:
$ref: ../../schemas/Error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Returns the ID of the created moderation.
content:
application/json:
schema:
$ref: ../../schemas/CreateUserModerationResponse.yaml
25 changes: 25 additions & 0 deletions openapi/components/schemas/CreateUserModerationRequestType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
title: CreateUserModerationRequestType
enum:
- avatar
- ban
- banpubliconly
- chat
- emoji
- event
- gallery
- group
- hardban
- icon
- kick
- note
- nuisance
- print
- profile
- publicinstance
- sticker
- voice
- warn
- warning
- world
examples:
- kick
7 changes: 7 additions & 0 deletions openapi/components/schemas/CreateUserModerationResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: CreateUserModerationResponse
type: object
properties:
id:
$ref: ./ModerationID.yaml
required:
- id
4 changes: 4 additions & 0 deletions openapi/components/schemas/ModerationID.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: ModerationID
type: string
examples:
- mod_f862716d-23bf-49e0-a931-a08759450834
100 changes: 100 additions & 0 deletions test/arazzo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14025,6 +14025,106 @@ workflows:
successCriteria:
- condition: $statusCode == 401

- workflowId: create-user-moderation-invalid-type
summary: createUserModeration refuses a type it does not know
parameters:
- reference: $components.parameters.userAgent
x-security:
- schemeName: authCookie
values:
apiKey: $workflows.session.outputs.sessionToken
steps:
- stepId: create-user-moderation
operationId: $sourceDescriptions.default.createUserModeration
parameters:
- name: userId
in: path
value: usr_00000000-0000-0000-0000-000000000000
requestBody:
contentType: application/json
payload:
reason: x
type: x
successCriteria:
- condition: $statusCode == 400
- condition: $response.body#/error/message == 'type must be one of ["ban"‚"note"‚"warning"‚"nuisance"‚"hardban"‚"kick"‚"warn"‚"banpubliconly"‚"publicinstance"‚"avatar"‚"world"‚"event"‚"group"‚"voice"‚"chat"‚"profile"‚"sticker"‚"emoji"‚"gallery"‚"print"‚"icon"]‚ not "x"'

- workflowId: create-user-moderation-not-found
summary: createUserModeration refuses a user that does not exist
parameters:
- reference: $components.parameters.userAgent
x-security:
- schemeName: authCookie
values:
apiKey: $workflows.session.outputs.sessionToken
steps:
- stepId: create-user-moderation
operationId: $sourceDescriptions.default.createUserModeration
parameters:
- name: userId
in: path
value: usr_00000000-0000-0000-0000-000000000000
requestBody:
contentType: application/json
payload:
reason: x
type: kick
successCriteria:
- condition: $statusCode == 404

- workflowId: create-user-moderation-self
summary: createUserModeration refuses the caller as its target, and rate limits a second attempt
parameters:
- reference: $components.parameters.userAgent
x-security:
- schemeName: authCookie
values:
apiKey: $workflows.session.outputs.sessionToken
steps:
- stepId: create-user-moderation
operationId: $sourceDescriptions.default.createUserModeration
parameters:
- name: userId
in: path
value: $workflows.session.outputs.userId
requestBody:
contentType: application/json
payload:
reason: x
type: kick
successCriteria:
- condition: $statusCode == 403
- condition: $response.body#/error/message == 'You cannot moderate this user․'

- stepId: create-user-moderation-rate-limited
operationId: $sourceDescriptions.default.createUserModeration
parameters:
- name: userId
in: path
value: $workflows.session.outputs.userId
requestBody:
contentType: application/json
payload:
reason: x
type: kick
successCriteria:
- condition: $statusCode == 429
- condition: $response.body#/error/message == 'Too many moderations being created at one player․'

- workflowId: create-user-moderation-unauthenticated
summary: createUserModeration refuses an anonymous caller
parameters:
- reference: $components.parameters.userAgent
steps:
- stepId: create-user-moderation
operationId: $sourceDescriptions.default.createUserModeration
parameters:
- name: userId
in: path
value: usr_00000000-0000-0000-0000-000000000000
successCriteria:
- condition: $statusCode == 401

- workflowId: delete-all-user-persistence-data-unauthenticated
summary: deleteAllUserPersistenceData refuses an anonymous caller
parameters:
Expand Down