-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swaggerify /account #190
Merged
Merged
Swaggerify /account #190
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
swagger: '2.0' | ||
info: | ||
title: "Matrix Client-Server v1 Account Administrative Contact API" | ||
version: "1.0.0" | ||
host: localhost:8008 | ||
schemes: | ||
- https | ||
- http | ||
basePath: /_matrix/client/v2_alpha | ||
consumes: | ||
- application/json | ||
produces: | ||
- application/json | ||
securityDefinitions: | ||
accessToken: | ||
type: apiKey | ||
description: The user_id or application service access_token | ||
name: access_token | ||
in: query | ||
paths: | ||
"/account/password": | ||
post: | ||
summary: Changes a user's password. | ||
description: |- | ||
This API endpoint uses the User-Interactive Authentication API. | ||
An access token should be submitted to this endpoint if the client has | ||
an active session. | ||
The Home Server may change the flows available depending on whether a | ||
valid access token is provided. | ||
security: | ||
- accessToken: [] | ||
parameters: | ||
- in: body | ||
name: body | ||
schema: | ||
type: object | ||
example: |- | ||
{ | ||
"new_password": "ihatebananas" | ||
} | ||
properties: | ||
new_password: | ||
type: string | ||
description: The new password for the account. | ||
required: ["new_password"] | ||
responses: | ||
200: | ||
description: The password has been changed. | ||
examples: | ||
application/json: "{}" | ||
schema: | ||
type: object | ||
429: | ||
description: This request was rate-limited. | ||
schema: | ||
"$ref": "definitions/error.yaml" | ||
"/account/3pid": | ||
get: | ||
summary: Gets a list of a user's third party identifiers. | ||
description: |- | ||
Gets a list of the third party identifiers that the homeserver has | ||
associated with the user's account. | ||
|
||
This is *not* the same as the list of third party identifiers bound to | ||
the user's Matrix ID in Identity Servers. | ||
|
||
Identifiers in this list may be used by the Home Server as, for example, | ||
identifiers that it will accept to reset the user's account password. | ||
security: | ||
- accessToken: [] | ||
responses: | ||
200: | ||
description: The lookup was successful. | ||
examples: | ||
application/json: |- | ||
{ | ||
"threepids": [ | ||
{ | ||
"medium": "email", | ||
"address": "[email protected]" | ||
} | ||
] | ||
} | ||
schema: | ||
type: object | ||
properties: | ||
threepids: | ||
type: array | ||
items: | ||
type: object | ||
title: Third party identifier | ||
properties: | ||
medium: | ||
type: string | ||
description: The medium of the third party identifier. | ||
enum: ["email"] | ||
address: | ||
type: string | ||
description: The third party identifier address. | ||
post: | ||
summary: Adds contact information to the user's account. | ||
description: Adds contact information to the user's account. | ||
security: | ||
- accessToken: [] | ||
parameters: | ||
- in: body | ||
name: body | ||
schema: | ||
type: object | ||
properties: | ||
threePidCreds: | ||
title: "ThreePidCredentials" | ||
type: object | ||
description: The third party credentials to associate with the account. | ||
properties: | ||
client_secret: | ||
type: string | ||
description: The client secret used in the session with the Identity Server. | ||
id_server: | ||
type: string | ||
description: The Identity Server to use. | ||
sid: | ||
type: string | ||
description: The session identifier given by the Identity Server. | ||
required: ["client_secret", "id_server", "sid"] | ||
bind: | ||
type: boolean | ||
description: |- | ||
Whether the home server should also bind this third party | ||
identifier to the account's Matrix ID with the passed identity | ||
server. Default: ``false``. | ||
x-example: true | ||
required: ["threePidCreds"] | ||
example: |- | ||
{ | ||
"threePidCreds": { | ||
"id_server": "matrix.org", | ||
"sid": "abc123987", | ||
"client_secret": "d0n'tT3ll" | ||
}, | ||
"bind": false | ||
} | ||
responses: | ||
200: | ||
description: The addition was successful. | ||
examples: | ||
application/json: "{}" | ||
schema: | ||
type: object | ||
403: | ||
description: The credentials could not be verified with the identity server. | ||
examples: | ||
application/json: |- | ||
{ | ||
"errcode": "M_THREEPID_AUTH_FAILED", | ||
"error": "The third party credentials could not be verified by the identity server." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this should be marked as an enum of just
["email"]
currently.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not our job to tell people they shouldn't use SMS for password reset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to be in a place where we can say:
email
. Address: "the email address"sms
. Address: "the MSISDN"We are not in that place. We only support
email
. If and when we add more, we can add it them.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done