Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into one-time-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Apr 30, 2024
2 parents 3e81ec2 + 1fc25d8 commit 9578479
Show file tree
Hide file tree
Showing 28 changed files with 206 additions and 71 deletions.
1 change: 1 addition & 0 deletions .github/_typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ au1ba7o = "au1ba7o"
[default.extend-words]
Appy = "Appy"
fo = "fo"
Iy = "Iy"
54 changes: 28 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
- name: "📥 Source checkout"
uses: actions/checkout@v4
- name: "➕ Setup Node"
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- name: "🔎 Run validator"
run: |
npx @redocly/cli@latest lint data/api/*/*.yaml
Expand All @@ -34,7 +34,7 @@ jobs:
- name: "📥 Source checkout"
uses: actions/checkout@v4
- name: "➕ Setup Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
Expand All @@ -51,9 +51,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "📥 Source checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "➕ Setup Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
Expand All @@ -70,9 +70,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "📥 Source checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "➕ Setup Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
Expand All @@ -99,11 +99,11 @@ jobs:
# the asterisk matching behaviour, not the literal string.
run: |
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
echo ::set-output name=baseURL::/
echo "baseURL=/" >> "$GITHUB_OUTPUT"
elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo ::set-output name=baseURL::"/${GITHUB_REF/refs\/tags\//}"
echo "baseURL=/${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT"
else
echo ::set-output name=baseURL::/unstable
echo "baseURL=/unstable" >> "$GITHUB_OUTPUT"
fi
build-openapi:
Expand All @@ -114,7 +114,7 @@ jobs:
- name: "📥 Source checkout"
uses: actions/checkout@v4
- name: "➕ Setup Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
-o spec/server-server-api/api.json
tar -czf openapi.tar.gz spec
- name: "📤 Artifact upload"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openapi-artifact
path: openapi.tar.gz
Expand All @@ -166,13 +166,15 @@ jobs:
- name: "📥 Source checkout"
uses: actions/checkout@v4
- name: "➕ Setup Python"
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: "➕ Install towncrier"
run: "pip install 'towncrier'"
- name: "Generate changelog"
run: ./scripts/generate-changelog.sh vUNSTABLE
- name: "📤 Artifact upload"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: changelog-artifact
path: content/changelog/vUNSTABLE.md
Expand All @@ -185,11 +187,11 @@ jobs:
if: ${{ always() }}
steps:
- name: "➕ Setup Node"
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- name: "➕ Setup Hugo"
uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
with:
hugo-version: '0.113.0'
extended: true
Expand All @@ -201,7 +203,7 @@ jobs:
npm run get-proposals
- name: "📥 Download generated changelog"
if: "needs.generate-changelog.result == 'success'"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: changelog-artifact
path: content/changelog
Expand All @@ -212,7 +214,7 @@ jobs:
# https://spec.matrix.org/latest/client-server-api/api.json
# Works for /unstable/ and /v1.1/ as well.
- name: "📥 Spec definition download"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: openapi-artifact
- name: "📝 Unpack the OpenAPI definitions in the right location"
Expand All @@ -222,7 +224,7 @@ jobs:
- name: "📦 Tarball creation"
run: tar -czf spec.tar.gz spec
- name: "📤 Artifact upload"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: spec-artifact
path: spec.tar.gz
Expand All @@ -236,7 +238,7 @@ jobs:
uses: actions/checkout@v4

- name: "📥 Fetch built spec"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: spec-artifact

Expand All @@ -262,11 +264,11 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: "➕ Setup Node"
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- name: "➕ Setup Hugo"
uses: peaceiris/actions-hugo@16361eb4acea8698b220b76c0d4e84e1fd22c61d
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
with:
# Cannot build the spec with Hugo 0.125.0 because of https://github.com/google/docsy/issues/1930
hugo-version: '0.124.1'
Expand All @@ -284,7 +286,7 @@ jobs:
hugo --config config.toml,historical.toml --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec"
- name: "📥 Spec definition download"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: openapi-artifact
- name: "📝 Unpack the OpenAPI definitions in the right location"
Expand All @@ -294,7 +296,7 @@ jobs:
- name: "📦 Tarball creation"
run: tar -czf spec-historical.tar.gz spec
- name: "📤 Artifact upload"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: spec-historical-artifact
path: spec-historical.tar.gz
7 changes: 3 additions & 4 deletions .github/workflows/netlify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
pr_number=$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" |
jq -r '.[] | .number')
echo "PR number: $pr_number"
echo "::set-output name=prnumber::$pr_number"
echo "prnumber=$pr_number" >> "$GITHUB_OUTPUT"
- name: '📥 Download artifact'
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4
with:
workflow: main.yaml
run_id: ${{ github.event.workflow_run.id }}
Expand All @@ -46,8 +46,7 @@ jobs:

- name: "📤 Deploy to Netlify"
id: netlify
# v2.1.0
uses: nwtgck/actions-netlify@7a92f00dde8c92a5a9e8385ec2919775f7647352
uses: nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654 # v3.0.0
with:
publish-dir: spec
deploy-message: "Deploy from GitHub Actions"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4

- name: 🔧 Yarn cache
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
cache: "yarn"
cache-dependency-path: packages/npm/yarn.lock
Expand All @@ -34,7 +34,7 @@ jobs:

- name: 🚀 Publish to npm
id: npm-publish
uses: JS-DevTools/npm-publish@5a85faf05d2ade2d5b6682bfe5359915d5159c6c # v2.2.1
uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1
with:
token: ${{ secrets.NPM_TOKEN }}
package: packages/npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/spell-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
uses: actions/checkout@v4

- name: Check spelling of proposals
uses: crate-ci/typos@ff3f309513469397e1094520fb7a054e057589e1
uses: crate-ci/typos@f2c1f08a7b3c1b96050cb786baaa2a94797bdb7d # v1.20.10
with:
config: ${{github.workspace}}/.github/_typos.toml
config: ${{github.workspace}}/.github/_typos.toml
1 change: 1 addition & 0 deletions changelogs/client_server/newsfragments/1808.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate authentication via a query string, as per [MSC4126](https://github.com/matrix-org/matrix-spec-proposals/issues/4126).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecate authentication via a query string, as per [MSC4126](https://github.com/matrix-org/matrix-spec-proposals/issues/4126).
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1796.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for pattern formats for `patternProperties`.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1799.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix anchors for schemas under `oneOf`.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1801.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not use the `title` of objects containing only `additionalProperties` or `patternProperties`.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1802.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add anchors in `definition` shortcode.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1803.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update most CI actions.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1804.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update typos CI action.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1805.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set python version for the Towncrier CI job.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1806.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace `set-output` with environment files in CI.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1809.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Render response headers.
22 changes: 12 additions & 10 deletions content/client-server-api/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,7 @@ specify parameter values. The flow for this method is as follows:
## Client Authentication

Most API endpoints require the user to identify themselves by presenting
previously obtained credentials in the form of an `access_token` query
parameter or through an Authorization Header of `Bearer $access_token`.
previously obtained credentials in the form of an access token.
An access token is typically obtained via the [Login](#login) or
[Registration](#account-registration-and-management) processes. Access tokens
can expire; a new access token can be generated by using a refresh token.
Expand All @@ -405,16 +404,19 @@ investigate [macaroons](http://research.google.com/pubs/pub41892.html).

### Using access tokens

Access tokens may be provided in two ways, both of which the homeserver
MUST support:
Access tokens may be provided via a request header, using the Authentication
Bearer scheme: `Authorization: Bearer TheTokenHere`.

1. Via a query string parameter, `access_token=TheTokenHere`.
2. Via a request header, `Authorization: Bearer TheTokenHere`.
Clients may alternatively provide the access token via a query string parameter:
`access_token=TheTokenHere`. This method is deprecated to prevent the access
token being leaked in access/HTTP logs and SHOULD NOT be used by clients.

Clients are encouraged to use the `Authorization` header where possible
to prevent the access token being leaked in access/HTTP logs. The query
string should only be used in cases where the `Authorization` header is
inaccessible for the client.
Homeservers MUST support both methods.

{{% boxes/note %}}
{{% changed-in v="1.11" %}}
Sending the access token as a query string parameter is now deprecated.
{{% /boxes/note %}}

When credentials are required but missing or invalid, the HTTP call will
return with a status of 401 and the error code, `M_MISSING_TOKEN` or
Expand Down
19 changes: 12 additions & 7 deletions content/identity-service-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,20 @@ of access tokens to authenticate users. The access tokens provided by an
Identity Server cannot be used to authenticate Client-Server API
requests.

An access token is provided to an endpoint in one of two ways:
Access tokens may be provided via a request header, using the
Authentication Bearer scheme: `Authorization: Bearer TheTokenHere`.

1. Via a query string parameter, `access_token=TheTokenHere`.
2. Via a request header, `Authorization: Bearer TheTokenHere`.
Clients may alternatively provide the access token via a query string
parameter: `access_token=TheTokenHere`. This method is deprecated to
prevent the access token being leaked in access/HTTP logs and SHOULD NOT
be used by clients.

Clients are encouraged to the use the `Authorization` header where
possible to prevent the access token being leaked in access/HTTP logs.
The query string should only be used in cases where the `Authorization`
header is inaccessible for the client.
Identity Servers MUST support both methods.

{{% boxes/note %}}
{{% changed-in v="1.11" %}}
Sending the access token as a query string parameter is now deprecated.
{{% /boxes/note %}}

When credentials are required but missing or invalid, the HTTP call will
return with a status of 401 and the error code `M_UNAUTHORIZED`.
Expand Down
5 changes: 3 additions & 2 deletions data/api/client-server/definitions/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
accessTokenQuery:
type: apiKey
description: |-
The `access_token` returned by a call to `/login` or `/register`, as a query
**Deprecated.** The `access_token` returned by a call to `/login` or `/register`, as a query
parameter.
It can also be the `as_token` of an application service.
Expand All @@ -33,7 +33,8 @@ accessTokenBearer:
appserviceAccessTokenQuery:
type: apiKey
description: |-
The `as_token` of an application service, as a query parameter.
**Deprecated.** The `as_token` of an application service, as a query
parameter.
name: access_token
in: query
appserviceAccessTokenBearer:
Expand Down
3 changes: 2 additions & 1 deletion data/api/identity/definitions/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
accessTokenQuery:
type: apiKey
description: |-
The `access_token` returned by a call to `/register`, as a query parameter.
**Deprecated.** The `access_token` returned by a call to `/register`, as a
query parameter.
name: access_token
in: query
accessTokenBearer:
Expand Down
33 changes: 33 additions & 0 deletions data/custom-formats.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2024 Commaille Kévin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This file contains the list of custom formats supported for the `format` key
# and the `x-pattern-format` extension (see `openapi_extensions.md` for more
# details).
#
# Each entry must use the `mx-` prefix and have the form:
#
# mx-custom-key:
# title: The title rendered in the specification
# url: /url/to#definition

mx-user-id:
title: User ID
url: /appendices#user-identifiers
# regex: "^@"

mx-event-id:
title: Event ID
url: /appendices#event-ids
# regex: "^\\$"
2 changes: 1 addition & 1 deletion data/event-schemas/schema/m.ignored_user_list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ properties:
"^@":
type: "object"
description: "An empty object for future enhancement"
x-pattern: "$USER_ID"
x-pattern-format: "mx-user-id"
required:
- ignored_users
type:
Expand Down
Loading

0 comments on commit 9578479

Please sign in to comment.