Skip to content
Merged
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
35 changes: 28 additions & 7 deletions openapi/components/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,34 @@ userId:
required: true
schema:
type: string
userIdQuery:
name: userId
in: query
required: false
schema:
type: string
description: Filter by UserID.
excludeUserId:
name: excludeUserId
in: query
required: false
schema:
type: string
description: Exclude by UserID.
displayName:
name: displayName
in: query
required: false
schema:
type: string
description: Filter by displayName.
email:
name: email
in: query
required: false
schema:
type: string
description: Filter by email.
maxUnityVersion:
name: maxUnityVersion
in: query
Expand Down Expand Up @@ -153,13 +181,6 @@ search:
schema:
type: string
description: Filters by world name.
userIdQuery:
name: userId
in: query
required: false
schema:
type: string
description: Filter by author UserID
featured:
name: featured
in: query
Expand Down
2 changes: 2 additions & 0 deletions openapi/components/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
$ref: ./paths/authentication.yaml#/paths/~1logout
/auth/user:
$ref: ./paths/authentication.yaml#/paths/~1auth~1user
/auth/exists:
$ref: ./paths/authentication.yaml#/paths/~1auth~1exists
/auth/twofactorauth/totp/verify:
$ref: ./paths/authentication.yaml#/paths/~1auth~1twofactorauth~1totp~1verify
/auth/twofactorauth/otp/verify:
Expand Down
22 changes: 22 additions & 0 deletions openapi/components/paths/authentication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,28 @@ paths:
- authHeader: []
twoFactorAuthCookie: []
- authCookie: []
/auth/exists:
get:
summary: Check User Exists
tags:
- authentication
responses:
'200':
$ref: ../responses/authentication/UserExistsResponse.yaml
'400':
$ref: ../responses/authentication/MissingParameterError.yaml
operationId: checkUserExists
parameters:
- $ref: ../parameters.yaml#/email
- $ref: ../parameters.yaml#/displayName
- $ref: ../parameters.yaml#/userIdQuery
- $ref: ../parameters.yaml#/excludeUserId
description: |-
Checks if a user by a given `username`, `displayName` or `email` exist. This is used during registration to check if a username has already been taken, during change of displayName to check if a displayName is available, and during change of email to check if the email is already used. In the later two cases the `excludeUserId` is used to exclude oneself, otherwise the result would always be true.

It is **REQUIRED** to include **AT LEAST** `username`, `displayName` **or** `email` query parameter. Although they can be combined - in addition with `excludeUserId` (generally to exclude yourself) - to further fine-tune the search.
security:
- apiKeyCookie: []
/auth/twofactorauth/totp/verify:
post:
summary: Verify 2FA code
Expand Down
2 changes: 2 additions & 0 deletions openapi/components/paths/worlds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ paths:
'404':
$ref: ../responses/worlds/WorldNotFoundError.yaml
description: Get information about a specific World.
security:
- apiKeyCookie: []
put:
summary: Update World
operationId: updateWorld
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Error response when missing at least 1 of the required parameters.
content:
application/json:
schema:
$ref: ../../schemas/Error.yaml
examples:
400 At Least One Parameter Required:
value:
error:
message: "\"username, email, or displayName required\""
status_code: 400
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Returns a response if a user exists or not.
content:
application/json:
schema:
$ref: ../../schemas/UserExists.yaml
10 changes: 10 additions & 0 deletions openapi/components/schemas/UserExists.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: UserExists
type: object
description: 'Status object representing if a queried user by username or userId exists or not. This model is primarily used by the `/auth/exists` endpoint, which in turn is used during registration. Please see the documentation on that endpoint for more information on usage.'
properties:
userExists:
type: boolean
description: Status if a user exist with that username or userId.
default: false
required:
- userExists