refactor: 🚚 Add algorithm, rename fields in public keys

This commit is contained in:
Jesse Wierzbinski 2024-08-17 14:58:41 +02:00
parent f62c2b3a19
commit 290b6f96e9
No known key found for this signature in database
3 changed files with 16 additions and 7 deletions

View file

@ -32,3 +32,5 @@ This page lists changes since Working Draft 03. {{ className: 'lead' }}
- Added [Unfollow](/entities/unfollow) entity. - Added [Unfollow](/entities/unfollow) entity.
- Completely rework `ServerMetadata`, and rename to [InstanceMetadata](/entities/instance-metadata). - Completely rework `ServerMetadata`, and rename to [InstanceMetadata](/entities/instance-metadata).
- Remove Server Actors, and move instance public keys to [InstanceMetadata](/entities/instance-metadata). - Remove Server Actors, and move instance public keys to [InstanceMetadata](/entities/instance-metadata).
- Add `algorithm` to [Users](/entities/user) and [InstanceMetadata](/entities/instance-metadata)'s public keys for future use (only `ed25519` is allowed for now).
- Renamed the second `public_key` to `key`.

View file

@ -70,11 +70,13 @@ On all entities that have an `author` field, the `author` can be `null` to repre
```typescript ```typescript
type PublicKey = { type PublicKey = {
public_key: string; algorithm: string;
key: string;
} }
``` ```
- `public_key`: Public key of the instance. Must follow the [Versia Public Key](/signatures) format. - `algorithm`: Algorithm used for the public key. Can only be `ed25519` for now.
- `key`: Public key of the instance. Must follow the [Versia Public Key](/signatures) format.
</Property> </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.
@ -134,7 +136,8 @@ On all entities that have an `author` field, the `author` can be `null` to repre
} }
}, },
"public_key": { "public_key": {
"public_key": "MCowBQYDK2VwAyEA9zhEMtQZetRl4QrLcz99i7jOa6ZVjX7aLfRUsMuKByI=" "algorithm": "ed25519",
"key": "MCowBQYDK2VwAyEA9zhEMtQZetRl4QrLcz99i7jOa6ZVjX7aLfRUsMuKByI="
}, },
"banner": null, "banner": null,
"extensions": { "extensions": {

View file

@ -73,12 +73,15 @@ Instance **must** be the host of the instance the user is on (hostname with opti
<Property name="public_key" type="PublicKey" required={true}> <Property name="public_key" type="PublicKey" required={true}>
The user's public key. Must follow the [Versia Public Key](/signatures) format. `actor` may be a URI to another user's profile, in which case this key may allow the user to act on behalf of the other user (see [delegation](/delegation)). The user's public key. Must follow the [Versia Public Key](/signatures) format. `actor` may be a URI to another user's profile, in which case this key may allow the user to act on behalf of the other user (see [delegation](/delegation)).
`algorithm` must be `ed25519` for now.
```typescript ```typescript
type URI = string; type URI = string;
type PublicKey = { type PublicKey = {
actor: URI; actor: URI;
public_key: string; algorithm: string;
key: string;
} }
``` ```
</Property> </Property>
@ -181,7 +184,8 @@ Instance **must** be the host of the instance the user is on (hostname with opti
"manually_approves_followers": false, "manually_approves_followers": false,
"public_key": { "public_key": {
"actor": "https://versia.social/users/018ec082-0ae1-761c-b2c5-22275a611771", "actor": "https://versia.social/users/018ec082-0ae1-761c-b2c5-22275a611771",
"public_key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "algorithm": "ed25519",
"key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}, },
"username": "aprl" "username": "aprl"
} }