Merge remote-tracking branch 'matrix-org/master' into travis/cors
This commit is contained in:
commit
67e74bd8c5
6 changed files with 53 additions and 9 deletions
|
@ -100,6 +100,7 @@ paths:
|
|||
name: allow_remote
|
||||
x-example: false
|
||||
required: false
|
||||
default: true
|
||||
description: |
|
||||
Indicates to the server that it should not attempt to fetch the media if it is deemed
|
||||
remote. This is to prevent routing loops where the server contacts itself. Defaults to
|
||||
|
@ -154,6 +155,7 @@ paths:
|
|||
name: allow_remote
|
||||
x-example: false
|
||||
required: false
|
||||
default: true
|
||||
description: |
|
||||
Indicates to the server that it should not attempt to fetch the media if it is deemed
|
||||
remote. This is to prevent routing loops where the server contacts itself. Defaults to
|
||||
|
@ -221,6 +223,7 @@ paths:
|
|||
name: allow_remote
|
||||
x-example: false
|
||||
required: false
|
||||
default: true
|
||||
description: |
|
||||
Indicates to the server that it should not attempt to fetch the media if it is deemed
|
||||
remote. This is to prevent routing loops where the server contacts itself. Defaults to
|
||||
|
|
|
@ -28,6 +28,42 @@ securityDefinitions:
|
|||
$ref: definitions/security.yaml
|
||||
paths:
|
||||
"/login":
|
||||
get:
|
||||
summary: Get the supported login types to authenticate users
|
||||
description: |-
|
||||
Gets the homeserver's supported login types to authenticate users. Clients
|
||||
should pick one of these and supply it as the ``type`` when logging in.
|
||||
operationId: getLoginFlows
|
||||
responses:
|
||||
200:
|
||||
description: The login types the homeserver supports
|
||||
examples:
|
||||
application/json: {
|
||||
"flows": [
|
||||
{"type": "m.login.password"}
|
||||
]
|
||||
}
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
flows:
|
||||
type: array
|
||||
description: The homeserver's supported login types
|
||||
items:
|
||||
type: object
|
||||
title: LoginFlow
|
||||
properties:
|
||||
type:
|
||||
description: |-
|
||||
The login type. This is supplied as the ``type`` when
|
||||
logging in.
|
||||
type: string
|
||||
429:
|
||||
description: This request was rate-limited.
|
||||
schema:
|
||||
"$ref": "definitions/error.yaml"
|
||||
tags:
|
||||
- Session management
|
||||
post:
|
||||
summary: Authenticates the user.
|
||||
description: |-
|
||||
|
|
|
@ -15,6 +15,8 @@ Unreleased changes
|
|||
- Sticker messages:
|
||||
- Add sticker message event definition.
|
||||
(`#1158 <https://github.com/matrix-org/matrix-doc/pull/1158>`_).
|
||||
- Document the GET version of ``/login``
|
||||
(`#1361 <https://github.com/matrix-org/matrix-doc/pull/1361>`_).
|
||||
- Document the CORS/preflight headers
|
||||
(`#1365 <https://github.com/matrix-org/matrix-doc/pull/1365>`_).
|
||||
|
||||
|
|
|
@ -98,8 +98,10 @@ func makeWalker(base string, w *fsnotify.Watcher) filepath.WalkFunc {
|
|||
log.Fatalf("Failed to get relative path of %s: %v", path, err)
|
||||
}
|
||||
|
||||
// Normalize slashes
|
||||
rel = filepath.ToSlash(rel)
|
||||
|
||||
// skip a few things that we know don't form part of the spec
|
||||
rel = strings.Replace(rel, "\\", "/", -1) // normalize slashes (thanks to windows)
|
||||
if rel == "api/node_modules" ||
|
||||
rel == "scripts/gen" ||
|
||||
rel == "scripts/tmp" {
|
||||
|
@ -127,7 +129,7 @@ func filter(e fsnotify.Event) bool {
|
|||
}
|
||||
|
||||
// Forcefully ignore directories we don't care about (Windows, at least, tries to notify about some directories)
|
||||
filePath := strings.Replace(e.Name, "\\", "/", -1) // normalize slashes (thanks to windows)
|
||||
filePath := filepath.ToSlash(e.Name) // normalize slashes
|
||||
if strings.Contains(filePath, "/scripts/tmp") ||
|
||||
strings.Contains(filePath, "/scripts/gen") ||
|
||||
strings.Contains(filePath, "/api/node_modules") {
|
||||
|
@ -156,11 +158,7 @@ func serve(w http.ResponseWriter, req *http.Request) {
|
|||
if file[0] == '/' {
|
||||
file = file[1:]
|
||||
}
|
||||
b, ok = m.bytes[file]
|
||||
|
||||
if !ok {
|
||||
b, ok = m.bytes[strings.Replace(file, "/", "\\", -1)] // Attempt a Windows lookup
|
||||
}
|
||||
b, ok = m.bytes[filepath.FromSlash(file)] // de-normalize slashes
|
||||
|
||||
if ok && file == "api-docs.json" {
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
|
|
|
@ -8,8 +8,11 @@ cd `dirname $0`/..
|
|||
|
||||
mkdir -p assets
|
||||
|
||||
if [ "$TRAVIS" != "true" ]
|
||||
then
|
||||
# generate specification/proposals.rst
|
||||
./scripts/proposals.py
|
||||
fi
|
||||
|
||||
# generate the spec docs
|
||||
./scripts/gendoc.py -d assets/spec
|
||||
|
|
|
@ -713,6 +713,8 @@ func main() {
|
|||
"ara4n": true,
|
||||
"leonerd": true,
|
||||
"rxl881": true,
|
||||
"uhoreg": true,
|
||||
"turt2live": true,
|
||||
}
|
||||
if err := initCache(); err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue