mirror of
https://github.com/versia-pub/docs.git
synced 2025-12-06 22:38:19 +01:00
refactor: 🔥 Remove Server Actors
This commit is contained in:
parent
c1e94ce128
commit
c074e6e38e
|
|
@ -31,3 +31,4 @@ This page lists changes since Working Draft 03. {{ className: 'lead' }}
|
||||||
- Renamed `Undo` to [Delete](/entities/delete).
|
- Renamed `Undo` to [Delete](/entities/delete).
|
||||||
- Added [Unfollow](/entities/unfollow) entity.
|
- Added [Unfollow](/entities/unfollow) entity.
|
||||||
- Completely rework [ServerMetadata](/entities/server-metadata).
|
- Completely rework [ServerMetadata](/entities/server-metadata).
|
||||||
|
- Remove Server Actors, and move instance public keys to [ServerMetadata](/entities/server-metadata).
|
||||||
|
|
@ -13,7 +13,7 @@ Implementations **must** ensure that the author of the `Delete` entity has the a
|
||||||
|
|
||||||
Having the authorization is defined as:
|
Having the authorization is defined as:
|
||||||
- The author is the creator of the target entity (including [delegation](/delegation)).
|
- The author is the creator of the target entity (including [delegation](/delegation)).
|
||||||
- The author is the server actor.
|
- The author is the instance.
|
||||||
|
|
||||||
## Entity Definition
|
## Entity Definition
|
||||||
|
|
||||||
|
|
@ -23,8 +23,8 @@ Having the authorization is defined as:
|
||||||
<Property name="uri" type="null" required={false}>
|
<Property name="uri" type="null" required={false}>
|
||||||
This entity does not have a URI.
|
This entity does not have a URI.
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="author" type="URI" required={true} typeLink="/types#uri">
|
<Property name="author" type="URI | null" required={true} typeLink="/types#uri">
|
||||||
URI of the `User` who is deleting the entity.
|
URI of the `User` who is deleting the entity. [Can be set to `null` to represent the instance](/entities/server-metadata#the-null-author).
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="target" type="URI" required={true} typeLink="/types#uri">
|
<Property name="target" type="URI" required={true} typeLink="/types#uri">
|
||||||
URI of the entity being deleted.
|
URI of the entity being deleted.
|
||||||
|
|
|
||||||
|
|
@ -82,4 +82,4 @@ Any field in an entity not marked as `required` may be omitted or set to `null`.
|
||||||
When serialized to a string, the JSON representation of an entity should follow the following rules:
|
When serialized to a string, the JSON representation of an entity should follow the following rules:
|
||||||
- Keys must be sorted lexicographically.
|
- Keys must be sorted lexicographically.
|
||||||
- Should use UTF-8 encoding.
|
- Should use UTF-8 encoding.
|
||||||
- Must be **signed** using the relevant [User](/entities/user)'s private key, or the [Server Actor](/entities/server-actor)'s private key if the entity is not associated with a particular user.
|
- Must be **signed** using the relevant [User](/entities/user)'s private key, or the [instance's private key](/entities/server-metadata) if the entity is not associated with a particular user.
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,14 @@ export const metadata = {
|
||||||
|
|
||||||
Contains metadata about a Versia instance, such as capabilities and endpoints. {{ className: 'lead' }}
|
Contains metadata about a Versia instance, such as capabilities and endpoints. {{ className: 'lead' }}
|
||||||
|
|
||||||
Not to be confused with [Server Actor](/entities/server-actor), which is a User representing an instance in the federation.
|
|
||||||
|
|
||||||
<Note>
|
<Note>
|
||||||
This entity is only used as part of [Server Discovery](/federation/discovery#server-discovery), and not as part of federation.
|
This entity is only used as part of [Server Discovery](/federation/discovery#server-discovery), and not as part of federation.
|
||||||
</Note>
|
</Note>
|
||||||
|
|
||||||
|
## The `null` Author
|
||||||
|
|
||||||
|
On all entities that have an `author` field, the `author` can be `null` to represent the instance itself as the author (like ActivityPub's Server Actors). In this case, the instance's public key should be used to verify the entity.
|
||||||
|
|
||||||
## Entity Definition
|
## Entity Definition
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
|
|
@ -63,6 +65,17 @@ Not to be confused with [Server Actor](/entities/server-actor), which is a User
|
||||||
<Property name="shared_inbox" type="URI" required={false}>
|
<Property name="shared_inbox" type="URI" required={false}>
|
||||||
URI to the instance's shared inbox, if supported.
|
URI to the instance's shared inbox, if supported.
|
||||||
</Property>
|
</Property>
|
||||||
|
<Property name="public_key" type="PublicKey" required={true}>
|
||||||
|
Public key of the instance.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
type PublicKey = {
|
||||||
|
public_key: string;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- `public_key`: Public key of the instance. Must follow the [Versia Public Key](/signatures) format.
|
||||||
|
</Property>
|
||||||
<Property name="moderators" type="URI" required={false}>
|
<Property name="moderators" type="URI" required={false}>
|
||||||
URI to [Collection](/structures/collection) of instance moderators.
|
URI to [Collection](/structures/collection) of instance moderators.
|
||||||
|
|
||||||
|
|
@ -120,6 +133,9 @@ Not to be confused with [Server Actor](/entities/server-actor), which is a User
|
||||||
"content": "https://social.jimjams.com/files/logo.webp"
|
"content": "https://social.jimjams.com/files/logo.webp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"public_key": {
|
||||||
|
"public_key": "MCowBQYDK2VwAyEA9zhEMtQZetRl4QrLcz99i7jOa6ZVjX7aLfRUsMuKByI="
|
||||||
|
},
|
||||||
"banner": null,
|
"banner": null,
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"example.extension:monthly_active_users": 1000
|
"example.extension:monthly_active_users": 1000
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ export const metadata = {
|
||||||
|
|
||||||
Versia uses the HTTP protocol for all communications between instances. HTTP requests must conform to certain standards to ensure compatibility between different implementations, as well as to ensure the security and integrity of the data being exchanged.
|
Versia uses the HTTP protocol for all communications between instances. HTTP requests must conform to certain standards to ensure compatibility between different implementations, as well as to ensure the security and integrity of the data being exchanged.
|
||||||
|
|
||||||
ALL kinds of HTTP requests/responses between instances **MUST** include a [Signature](/signatures), signed with either the relevant [User](/entities/user)'s private key or the [Server Actor](/entities/server-actor)'s private key.
|
ALL kinds of HTTP requests/responses between instances **MUST** include a [Signature](/signatures), signed with either the relevant [User](/entities/user)'s private key or the [instance's private key](/entities/server-metadata).
|
||||||
|
|
||||||
## Requests
|
## Requests
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ Versia uses cryptographic signatures to ensure the integrity and authenticity of
|
||||||
|
|
||||||
A signature consists of a series of headers in an HTTP request. The following headers are used:
|
A signature consists of a series of headers in an HTTP request. The following headers are used:
|
||||||
- **`X-Signature`**: The signature itself, encoded in base64.
|
- **`X-Signature`**: The signature itself, encoded in base64.
|
||||||
- **`X-Signed-By`**: URI of the user who signed the request.
|
- **`X-Signed-By`**: URI of the user who signed the request, [or the string `instance` to represent the instance](/entities/server-metadata#the-null-author).
|
||||||
- **`X-Nonce`**: A random string generated by the client. This is used to prevent replay attacks.
|
- **`X-Nonce`**: A random string generated by the client. This is used to prevent replay attacks.
|
||||||
|
|
||||||
Signatures are **required on ALL federation traffic**. If a request does not have a signature, it **MUST** be rejected. Specifically, signatures must be put on:
|
Signatures are **required on ALL federation traffic**. If a request does not have a signature, it **MUST** be rejected. Specifically, signatures must be put on:
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ Pages should be limited to a reasonable number of entities, such as 20 or 80.
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="author" type="URI" required={true} typeLink="/types#uri">
|
<Property name="author" type="URI | null" required={true} typeLink="/types#uri">
|
||||||
Author of the collection. Usually the user who owns the collection. Can be the server actor.
|
Author of the collection. Usually the user who owns the collection. [Can be set to `null` to represent the instance](/entities/server-metadata#the-null-author).
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="first" type="URI" required={true} typeLink="/types#uri">
|
<Property name="first" type="URI" required={true} typeLink="/types#uri">
|
||||||
URI to the first page of the collection. Query parameters are allowed.
|
URI to the first page of the collection. Query parameters are allowed.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue