Skip to content

Commit 77cfbf5

Browse files
Authentication and User Update properties
Addresses #427
1 parent a1cf48e commit 77cfbf5

10 files changed

Lines changed: 81 additions & 1 deletion

File tree

openapi/components/codeSamples/authentication.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
-H "Content-Type: application/json" \
3030
-b "auth={authCookie}" \
3131
--data '{"code": "string"}'
32+
/auth/twofactorauth/otp:
33+
get:
34+
- lang: cURL
35+
source: >-
36+
curl -X GET "https://api.vrchat.cloud/api/1/auth/twofactorauth/otp" \
37+
-H "Content-Type: application/json" \
38+
-b "auth={authCookie}"
3239
/auth/twofactorauth/otp/verify:
3340
post:
3441
- lang: cURL

openapi/components/paths.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
$ref: "./paths/authentication.yaml#/paths/~1auth~1user"
1111
"/auth/twofactorauth/totp/verify":
1212
$ref: "./paths/authentication.yaml#/paths/~1auth~1twofactorauth~1totp~1verify"
13+
"/auth/twofactorauth/otp":
14+
$ref: "./paths/authentication.yaml#/paths/~1auth~1twofactorauth~1otp"
1315
"/auth/twofactorauth/otp/verify":
1416
$ref: "./paths/authentication.yaml#/paths/~1auth~1twofactorauth~1otp~1verify"
1517
"/auth/twofactorauth/emailotp/verify":

openapi/components/paths/authentication.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,22 @@ paths:
112112
security:
113113
- authCookie: []
114114
parameters: []
115+
/auth/twofactorauth/otp:
116+
get:
117+
summary: Get 2FA Recovery codes
118+
operationId: getRecoveryCodes
119+
x-codeSamples:
120+
$ref: "../codeSamples/authentication.yaml#/~1auth~1twofactorauth~1otp/get"
121+
responses:
122+
'200':
123+
$ref: ../responses/authentication/Get2FARecoveryCodesResponse.yaml
124+
'401':
125+
$ref: ../responses/MissingCredentialsError.yaml
126+
description: Gets the OTP (One Time Password) recovery codes for accounts with 2FA-protection enabled.
127+
tags:
128+
- authentication
129+
security:
130+
- authCookie: []
115131
/auth/twofactorauth/otp/verify:
116132
post:
117133
summary: Verify 2FA code with Recovery code

openapi/components/paths/instances.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ paths:
7171
description: |-
7272
Close an instance or update the closedAt time when it will be closed.
7373
74-
You can only close an instance if the ownerId is yourself or if the instance owner is a group and you have the `group-instance-moderate` permission.
74+
You can only close an instance if the ownerId is yourself or if the instance owner is a group and you have the `group-instance-manage` permission.
7575
responses:
7676
'200':
7777
$ref: ../responses/instances/InstanceResponse.yaml

openapi/components/paths/users.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ paths:
9090
responses:
9191
'200':
9292
$ref: ../responses/users/CurrentUserResponse.yaml
93+
'400':
94+
$ref: ../responses/users/CurrentPasswordRequiredError.yaml
9395
'401':
9496
$ref: ../responses/MissingCredentialsError.yaml
9597
description: Update a users information such as the email and birthday.

openapi/components/requests/UpdateUserRequest.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ type: object
33
properties:
44
email:
55
type: string
6+
unsubscribe:
7+
type: boolean
68
birthday:
79
type: string
810
format: date
@@ -35,3 +37,19 @@ properties:
3537
description: MUST be a valid VRChat /file/ url.
3638
example: 'https://api.vrchat.cloud/api/1/file/file_76dc2964-0ce8-41df-b2e7-8edf994fee31/1'
3739
minLength: 0
40+
contentFilters:
41+
description: These tags begin with `content_` and control content gating
42+
type: array
43+
items:
44+
$ref: ./Tag.yaml
45+
displayName:
46+
description: MUST specify currentPassword as well to change display name
47+
type: string
48+
revertDisplayName:
49+
description: MUST specify currentPassword as well to revert display name
50+
type: boolean
51+
password:
52+
description: MUST specify currentPassword as well to change password
53+
type: string
54+
currentPassword:
55+
type: string
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Returns the two factor recovery codes
2+
content:
3+
application/json:
4+
schema:
5+
$ref: ../../schemas/TwoFactorRecoveryCodes.yaml
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Error response when a user attempts to change a property without supplying their current password.
2+
content:
3+
application/json:
4+
schema:
5+
$ref: ../../schemas/Error.yaml

openapi/components/schemas/CurrentUser.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ properties:
4242
type: array
4343
items:
4444
type: string
45+
contentFilters:
46+
description: These tags begin with `content_` and control content gating
47+
type: array
48+
items:
49+
$ref: ./Tag.yaml
4550
currentAvatar:
4651
$ref: ./AvatarID.yaml
4752
currentAvatarImageUrl:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
title: TwoFactorRecoveryCodes
2+
type: object
3+
properties:
4+
requiresTwoFactorAuth:
5+
type: array
6+
items:
7+
type: string
8+
otp:
9+
type: array
10+
items:
11+
type: object
12+
required:
13+
- code
14+
- used
15+
properties:
16+
code:
17+
type: string
18+
used:
19+
type: boolean
20+

0 commit comments

Comments
 (0)