mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
Merge branch 'main' into versions/5.0.0
# Conflicts: # RELEASE_NOTES.md # config/quota-file.json
This commit is contained in:
commit
affcb7a7b3
55
.github/workflows/ci.yml
vendored
55
.github/workflows/ci.yml
vendored
@ -180,8 +180,20 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Build and export to docker
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
load: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
- name: "Test docker image 'latest'"
|
||||||
|
run: |
|
||||||
|
docker run --rm solidproject/community-server:latest --version
|
||||||
|
- name: "Test docker image 'edge'"
|
||||||
|
run: |
|
||||||
|
docker run --rm solidproject/community-server:edge --version
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@ -221,8 +233,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Build and export to docker
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
load: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
- name: "Test docker image 'next'"
|
||||||
|
run: |
|
||||||
|
docker run --rm solidproject/community-server:next --version
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@ -230,7 +251,7 @@ jobs:
|
|||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
docs:
|
typedocs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -238,7 +259,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
- run: npm ci --ignore-scripts
|
- run: npm ci --ignore-scripts
|
||||||
- run: npm run docs
|
- run: npm run typedocs
|
||||||
- name: Save docs
|
- name: Save docs
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@ -246,9 +267,28 @@ jobs:
|
|||||||
path: docs
|
path: docs
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
mkdocs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
needs:
|
||||||
|
- typedocs
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- id: get_version
|
||||||
|
uses: battila7/get-version-action@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
- run: pip install mkdocs-material
|
||||||
|
- run: pip install mike
|
||||||
|
- run: git config user.name ci-bot
|
||||||
|
- run: git config user.email ci-bot@example.com
|
||||||
|
- run: git fetch origin gh-pages --depth=1
|
||||||
|
- run: cd documentation && mike deploy --push --update-aliases ${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}} latest
|
||||||
|
|
||||||
publish-docs:
|
publish-docs:
|
||||||
needs:
|
needs:
|
||||||
- docs
|
- mkdocs
|
||||||
- lint
|
- lint
|
||||||
- test-unit
|
- test-unit
|
||||||
- test-integration
|
- test-integration
|
||||||
@ -261,7 +301,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: docs
|
name: docs
|
||||||
path: docs
|
path: docs
|
||||||
|
- id: get_version
|
||||||
|
uses: battila7/get-version-action@v2
|
||||||
- uses: peaceiris/actions-gh-pages@v3
|
- uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: .
|
publish_dir: ./docs
|
||||||
|
destination_dir: ${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}}/docs
|
||||||
|
1
CODE_OF_CONDUCT.md
Normal file
1
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
We follow and adhere to the Solid [Code of Conduct](https://github.com/solid/process/blob/main/code-of-conduct.md).
|
@ -1,12 +1,9 @@
|
|||||||
# Build stage
|
# Build stage
|
||||||
FROM node:lts AS build
|
FROM node:lts-alpine AS build
|
||||||
|
|
||||||
## Set current working directory
|
## Set current working directory
|
||||||
WORKDIR /community-server
|
WORKDIR /community-server
|
||||||
|
|
||||||
## Copy the package.json for audit
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
## Copy the dockerfile's context's community server files
|
## Copy the dockerfile's context's community server files
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
@ -15,12 +12,11 @@ RUN npm ci --unsafe-perm && npm run build
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Runtime stage
|
# Runtime stage
|
||||||
FROM node:lts-alpine
|
FROM node:lts-alpine
|
||||||
|
|
||||||
## Add contact informations for questions about the container
|
## Add contact informations for questions about the container
|
||||||
LABEL maintainer="Solid Community Server Docker Image Maintainer <matthieubosquet@gmail.com>"
|
LABEL maintainer="Solid Community Server Docker Image Maintainer <thomas.dupont@ugent.be>"
|
||||||
|
|
||||||
## Container config & data dir for volume sharing
|
## Container config & data dir for volume sharing
|
||||||
## Defaults to filestorage with /data directory (passed through CMD below)
|
## Defaults to filestorage with /data directory (passed through CMD below)
|
||||||
|
@ -52,7 +52,7 @@ These changes are relevant if you wrote custom modules for the server that depen
|
|||||||
|
|
||||||
A new interface `SingleThreaded` has been added. This empty interface can be implemented to mark a component as not-threadsafe. When the CSS starts in multithreaded mode, it will error and halt if any SingleThreaded components are instantiated.
|
A new interface `SingleThreaded` has been added. This empty interface can be implemented to mark a component as not-threadsafe. When the CSS starts in multithreaded mode, it will error and halt if any SingleThreaded components are instantiated.
|
||||||
|
|
||||||
## V4.0.1
|
## v4.0.1
|
||||||
Freezes the `oidc-provider` dependency to prevent a potential issue with the solid authn client
|
Freezes the `oidc-provider` dependency to prevent a potential issue with the solid authn client
|
||||||
as described in https://github.com/inrupt/solid-client-authn-js/issues/2103.
|
as described in https://github.com/inrupt/solid-client-authn-js/issues/2103.
|
||||||
|
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"comment": "This is an example of what an actual email sender configuration would look like.",
|
"comment": "This is an example of what an actual email sender configuration would look like.",
|
||||||
"@id": "urn:solid-server:default:EmailSender",
|
"@id": "urn:solid-server:default:EmailSender",
|
||||||
"@type": "BaseEmailSender",
|
"@type": "BaseEmailSender",
|
||||||
"args_senderName": "Solid Server",
|
"args_senderName": "Community Solid Server <solid@example.email>",
|
||||||
"args_emailConfig_host": "smtp.example.email",
|
"args_emailConfig_host": "smtp.example.email",
|
||||||
"args_emailConfig_port": 587,
|
"args_emailConfig_port": 587,
|
||||||
"args_emailConfig_auth_user": "alice@example.email",
|
"args_emailConfig_auth_user": "solid@example.email",
|
||||||
"args_emailConfig_auth_pass": "NYEaCsqV7aVStRCbmC"
|
"args_emailConfig_auth_pass": "NYEaCsqV7aVStRCbmC"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
"css:config/identity/pod/static.json",
|
"css:config/identity/pod/static.json",
|
||||||
"css:config/identity/registration/enabled.json",
|
"css:config/identity/registration/enabled.json",
|
||||||
"css:config/ldp/authentication/dpop-bearer.json",
|
"css:config/ldp/authentication/dpop-bearer.json",
|
||||||
"css:config/ldp/authorization/allow-all.json",
|
"css:config/ldp/authorization/webacl.json",
|
||||||
"css:config/ldp/handler/default.json",
|
"css:config/ldp/handler/default.json",
|
||||||
"css:config/ldp/metadata-parser/default.json",
|
"css:config/ldp/metadata-parser/default.json",
|
||||||
"css:config/ldp/metadata-writer/default.json",
|
"css:config/ldp/metadata-writer/default.json",
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
# Documentation
|
---
|
||||||
|
hide:
|
||||||
|
- navigation
|
||||||
|
---
|
||||||
|
|
||||||
|
# Welcome
|
||||||
|
|
||||||
Welcome to the Community Solid Server!
|
Welcome to the Community Solid Server!
|
||||||
Here we will cover many aspects of the server,
|
Here we will cover many aspects of the server,
|
@ -69,5 +69,5 @@ The `ErrorHandler` will convert the error to an HTTP response to be returned.
|
|||||||
Below are sections that go deeper into the specific steps.
|
Below are sections that go deeper into the specific steps.
|
||||||
Not all steps are covered yet and will be added in the future.
|
Not all steps are covered yet and will be added in the future.
|
||||||
|
|
||||||
[How authentication and authorization work](authorization.md)
|
* [How authentication and authorization work](authorization.md)
|
||||||
[What the `ResourceStore` looks like](resource-store.md)
|
* [What the `ResourceStore` looks like](resource-store.md)
|
89
documentation/mkdocs.yml
Normal file
89
documentation/mkdocs.yml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
docs_dir: markdown
|
||||||
|
|
||||||
|
theme:
|
||||||
|
name: 'material'
|
||||||
|
custom_dir: overrides
|
||||||
|
icon:
|
||||||
|
repo: fontawesome/brands/github
|
||||||
|
palette:
|
||||||
|
- media: "(prefers-color-scheme: light)"
|
||||||
|
scheme: default
|
||||||
|
toggle:
|
||||||
|
icon: material/weather-night
|
||||||
|
name: Switch to dark mode
|
||||||
|
primary: deep purple
|
||||||
|
accent: deep orange
|
||||||
|
|
||||||
|
# Palette toggle for dark mode
|
||||||
|
- media: "(prefers-color-scheme: dark)"
|
||||||
|
scheme: slate
|
||||||
|
toggle:
|
||||||
|
icon: material/weather-sunny
|
||||||
|
name: Switch to light mode
|
||||||
|
primary: deep purple
|
||||||
|
accent: deep orange
|
||||||
|
features:
|
||||||
|
- navigation.instant
|
||||||
|
- navigation.tabs
|
||||||
|
- navigation.top
|
||||||
|
- navigation.indexes
|
||||||
|
|
||||||
|
site_name: 'Community Solid Server'
|
||||||
|
site_url: https://communitysolidserver.github.io/CommunitySolidServer
|
||||||
|
|
||||||
|
repo_url: https://github.com/CommunitySolidServer/CommunitySolidServer
|
||||||
|
repo_name: CommunitySolidServer
|
||||||
|
edit_uri: ""
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- search
|
||||||
|
|
||||||
|
markdown_extensions:
|
||||||
|
- admonition
|
||||||
|
- def_list
|
||||||
|
- footnotes
|
||||||
|
- meta
|
||||||
|
- tables
|
||||||
|
- toc:
|
||||||
|
permalink: true
|
||||||
|
- pymdownx.betterem:
|
||||||
|
smart_enable: all
|
||||||
|
- pymdownx.caret
|
||||||
|
- pymdownx.tilde
|
||||||
|
- pymdownx.details
|
||||||
|
- pymdownx.highlight
|
||||||
|
- pymdownx.superfences
|
||||||
|
- pymdownx.smartsymbols
|
||||||
|
|
||||||
|
|
||||||
|
extra:
|
||||||
|
version:
|
||||||
|
provider: mike
|
||||||
|
social:
|
||||||
|
- icon: fontawesome/brands/github
|
||||||
|
link: https://github.com/CommunitySolidServer/CommunitySolidServer
|
||||||
|
- icon: fontawesome/brands/docker
|
||||||
|
link: https://hub.docker.com/r/solidproject/community-server
|
||||||
|
- icon: fontawesome/brands/npm
|
||||||
|
link: https://www.npmjs.com/package/@solid/community-server
|
||||||
|
- icon: fontawesome/brands/gitter
|
||||||
|
link: https://gitter.im/CommunitySolidServer/community
|
||||||
|
|
||||||
|
nav:
|
||||||
|
- Welcome:
|
||||||
|
- README.md
|
||||||
|
- Usage:
|
||||||
|
- 'Example request': example-requests.md
|
||||||
|
- 'Identity provider': identity-provider.md
|
||||||
|
- 'Client credentials': client-credentials.md
|
||||||
|
- 'Seeding Pods': seeding-pods.md
|
||||||
|
- Architecture:
|
||||||
|
- Architecture: architecture.md
|
||||||
|
- Dependency injection: dependency-injection.md
|
||||||
|
- Contributing:
|
||||||
|
- Pull requests: making-changes.md
|
||||||
|
- Releases: release.md
|
||||||
|
- API: ./docs/" target="_blank
|
||||||
|
|
||||||
|
# To write documentation locally, execute the next line and browse to http://localhost:8000
|
||||||
|
# docker run --rm -it -p 8000:8000 -v ${PWD}/documentation:/docs squidfunk/mkdocs-material
|
8
documentation/overrides/main.html
Normal file
8
documentation/overrides/main.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block outdated %}
|
||||||
|
You're not viewing the latest version.
|
||||||
|
<a href="{{ '../' ~ base_url }}">
|
||||||
|
<strong>Click here to go to latest.</strong>
|
||||||
|
</a>
|
||||||
|
{% endblock %}
|
4
documentation/typedoc.css
Normal file
4
documentation/typedoc.css
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.tsd-page-toolbar,
|
||||||
|
.tsd-page-title {
|
||||||
|
background-color: #7E56C2;
|
||||||
|
}
|
12
package-lock.json
generated
12
package-lock.json
generated
@ -13788,9 +13788,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/semver-regex": {
|
"node_modules/semver-regex": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz",
|
||||||
"integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==",
|
"integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
@ -26756,9 +26756,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"semver-regex": {
|
"semver-regex": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.4.tgz",
|
||||||
"integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==",
|
"integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"set-blocking": {
|
"set-blocking": {
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
],
|
],
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Joachim Van Herwegen <joachim.vanherwegen@ugent.be>",
|
"Joachim Van Herwegen <joachim.vanherwegen@ugent.be>",
|
||||||
|
"Thomas Dupont <thomas.dupont@ugent.be>",
|
||||||
|
"Wannes Kerckhove <wannes.kerckhove@ugent.be>",
|
||||||
|
"Jasper Vaneessen <jasper.vaneessen@ugent.be>",
|
||||||
"Ruben Taelman <ruben.taelman@ugent.be> (https://www.rubensworks.net/)",
|
"Ruben Taelman <ruben.taelman@ugent.be> (https://www.rubensworks.net/)",
|
||||||
"Ruben Verborgh <ruben.verborgh@ugent.be> (https://ruben.verborgh.org/)"
|
"Ruben Verborgh <ruben.verborgh@ugent.be> (https://ruben.verborgh.org/)"
|
||||||
],
|
],
|
||||||
@ -47,7 +50,7 @@
|
|||||||
"docker:setup": "./test/docker/docker-setup.sh",
|
"docker:setup": "./test/docker/docker-setup.sh",
|
||||||
"docker:start": "./test/docker/docker-start.sh",
|
"docker:start": "./test/docker/docker-start.sh",
|
||||||
"docker:stop": "./test/docker/docker-stop.sh",
|
"docker:stop": "./test/docker/docker-stop.sh",
|
||||||
"docs": "typedoc",
|
"typedocs": "typedoc --customCss ./documentation/typedoc.css",
|
||||||
"jest": "jest --coverageReporters text-summary --",
|
"jest": "jest --coverageReporters text-summary --",
|
||||||
"lint": "eslint . --cache --ignore-path .gitignore --max-warnings 0",
|
"lint": "eslint . --cache --ignore-path .gitignore --max-warnings 0",
|
||||||
"prepare": "npm run build",
|
"prepare": "npm run build",
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
|
import type { TLSSocket } from 'tls';
|
||||||
import type { WebSocket } from 'ws';
|
import type { WebSocket } from 'ws';
|
||||||
import { getLoggerFor } from '../logging/LogUtil';
|
import { getLoggerFor } from '../logging/LogUtil';
|
||||||
import type { HttpRequest } from '../server/HttpRequest';
|
import type { HttpRequest } from '../server/HttpRequest';
|
||||||
@ -47,7 +48,7 @@ class WebSocketListener extends EventEmitter {
|
|||||||
// Store the HTTP host and protocol
|
// Store the HTTP host and protocol
|
||||||
const forwarded = parseForwarded(headers);
|
const forwarded = parseForwarded(headers);
|
||||||
this.host = forwarded.host ?? headers.host ?? 'localhost';
|
this.host = forwarded.host ?? headers.host ?? 'localhost';
|
||||||
this.protocol = forwarded.proto === 'https' || (socket as any).secure ? 'https:' : 'http:';
|
this.protocol = forwarded.proto === 'https' || (socket as TLSSocket).encrypted ? 'https:' : 'http:';
|
||||||
}
|
}
|
||||||
|
|
||||||
private stop(): void {
|
private stop(): void {
|
||||||
@ -91,10 +92,10 @@ class WebSocketListener extends EventEmitter {
|
|||||||
// Resolve and verify the URL
|
// Resolve and verify the URL
|
||||||
const resolved = new URL(path, `${this.protocol}${this.host}`);
|
const resolved = new URL(path, `${this.protocol}${this.host}`);
|
||||||
if (resolved.host !== this.host) {
|
if (resolved.host !== this.host) {
|
||||||
throw new Error(`Mismatched host: ${resolved.host} instead of ${this.host}`);
|
throw new Error(`Mismatched host: expected ${this.host} but got ${resolved.host}`);
|
||||||
}
|
}
|
||||||
if (resolved.protocol !== this.protocol) {
|
if (resolved.protocol !== this.protocol) {
|
||||||
throw new Error(`Mismatched protocol: ${resolved.protocol} instead of ${this.protocol}`);
|
throw new Error(`Mismatched protocol: expected ${this.protocol} but got ${resolved.protocol}`);
|
||||||
}
|
}
|
||||||
// Subscribe to the URL
|
// Subscribe to the URL
|
||||||
const url = resolved.href;
|
const url = resolved.href;
|
||||||
|
@ -13,7 +13,10 @@ import type { RepresentationConverterArgs } from './RepresentationConverter';
|
|||||||
*/
|
*/
|
||||||
export class RdfToQuadConverter extends BaseTypedRepresentationConverter {
|
export class RdfToQuadConverter extends BaseTypedRepresentationConverter {
|
||||||
public constructor() {
|
public constructor() {
|
||||||
super(rdfParser.getContentTypes(), INTERNAL_QUADS);
|
const inputTypes = rdfParser.getContentTypes()
|
||||||
|
// ContentType application/json MAY NOT be converted to Quad.
|
||||||
|
.then((types): string[] => types.filter((type): boolean => type !== 'application/json'));
|
||||||
|
super(inputTypes, INTERNAL_QUADS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async handle({ representation, identifier }: RepresentationConverterArgs): Promise<Representation> {
|
public async handle({ representation, identifier }: RepresentationConverterArgs): Promise<Representation> {
|
||||||
|
@ -25,7 +25,7 @@ describe('An UnsecureWebSocketsProtocol', (): void => {
|
|||||||
'sec-websocket-protocol': 'solid-0.1, other/1.0.0',
|
'sec-websocket-protocol': 'solid-0.1, other/1.0.0',
|
||||||
},
|
},
|
||||||
socket: {
|
socket: {
|
||||||
secure: true,
|
encrypted: true,
|
||||||
},
|
},
|
||||||
} as any as HttpRequest;
|
} as any as HttpRequest;
|
||||||
await protocol.handle({ webSocket, upgradeRequest } as any);
|
await protocol.handle({ webSocket, upgradeRequest } as any);
|
||||||
@ -101,7 +101,7 @@ describe('An UnsecureWebSocketsProtocol', (): void => {
|
|||||||
it('send an error message.', (): void => {
|
it('send an error message.', (): void => {
|
||||||
expect(webSocket.messages).toHaveLength(1);
|
expect(webSocket.messages).toHaveLength(1);
|
||||||
expect(webSocket.messages.shift())
|
expect(webSocket.messages.shift())
|
||||||
.toBe('error Mismatched host: wrong.example instead of mypod.example');
|
.toBe('error Mismatched host: expected mypod.example but got wrong.example');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ describe('An UnsecureWebSocketsProtocol', (): void => {
|
|||||||
it('send an error message.', (): void => {
|
it('send an error message.', (): void => {
|
||||||
expect(webSocket.messages).toHaveLength(1);
|
expect(webSocket.messages).toHaveLength(1);
|
||||||
expect(webSocket.messages.shift())
|
expect(webSocket.messages.shift())
|
||||||
.toBe('error Mismatched protocol: http: instead of https:');
|
.toBe('error Mismatched protocol: expected https: but got http:');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -18,12 +18,17 @@ describe('A RdfToQuadConverter', (): void => {
|
|||||||
const identifier: ResourceIdentifier = { path: 'path' };
|
const identifier: ResourceIdentifier = { path: 'path' };
|
||||||
|
|
||||||
it('supports serializing as quads.', async(): Promise<void> => {
|
it('supports serializing as quads.', async(): Promise<void> => {
|
||||||
const types = await rdfParser.getContentTypes();
|
const types = rdfParser.getContentTypes()
|
||||||
for (const type of types) {
|
.then((inputTypes): string[] => inputTypes.filter((type): boolean => type !== 'application/json'));
|
||||||
|
for (const type of await types) {
|
||||||
await expect(converter.getOutputTypes(type)).resolves.toEqual({ [INTERNAL_QUADS]: 1 });
|
await expect(converter.getOutputTypes(type)).resolves.toEqual({ [INTERNAL_QUADS]: 1 });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('may not handle application/json to quad conversion.', async(): Promise<void> => {
|
||||||
|
await expect(converter.getOutputTypes('application/json')).resolves.toEqual({ });
|
||||||
|
});
|
||||||
|
|
||||||
it('can handle turtle to quad conversions.', async(): Promise<void> => {
|
it('can handle turtle to quad conversions.', async(): Promise<void> => {
|
||||||
const metadata = new RepresentationMetadata('text/turtle');
|
const metadata = new RepresentationMetadata('text/turtle');
|
||||||
const representation = { metadata } as Representation;
|
const representation = { metadata } as Representation;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user