Skip to content
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

GET media/config #1189

Merged
merged 18 commits into from
Jul 6, 2018
Merged
Changes from 3 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
30 changes: 30 additions & 0 deletions api/client-server/content-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,33 @@ paths:
"$ref": "definitions/error.yaml"
tags:
- Media
"/limits":
get:
summary: Get limits on what can be uploaded to the content repository.
Clients SHOULD use this as a guide when uploading content.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs to clarify what it's talking about now, since this is now a generic /config API.

Edit: in fact this probably just needs to move to m.upload.size below

All values are intentionally left optional, the client MUST assume
that any field not given is not limited.

**NOTE:** Reverse proxies may apply their own limits.

If auth is not supplied, this endpoint gives the global limit of the server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gives the s/limit/configuration of the server

likewise below: Otherwise it should give the s/limits/configuration for the authenticated user.

and again: full words would be nice (authorization vs auth)

Otherwise it should give the limits applied to the authenticated user.
operationId: getLimits
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be updated

produces: ["application/json"]
security:
- accessToken: []
responses:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a 429 should be added to indicate rate limiting:

         429:
           description: This request was rate-limited.
           schema:
             "$ref": "definitions/error.yaml"

200:
description: The limits exposed by the matrix server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this endpoint is generic now, the general description should probably be generic as well.

How does "The public content repository configuration for the matrix server." sound to you?

schema:
type: object
properties:
upload_size:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proposal calls for m.upload.size btw (same with the example later on)

type: number
description: "The maximum size a upload can be in bytes."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an upload

examples:
application/json: {
"upload_size": 50000000
}
tags:
- Media