Delegation Extension

Delegation is used to authorize actions on behalf of another user.

Vocabulary

  • Delegator: The user that is delegating actions to another user. (The user that owns the key)
  • Delegate: The user that is being delegated actions. (The user that the key is pointing to)

Implementation Details

Any actions or entities created by the delegate should be attributed to the delegator user in clients transparently to end-users (e.g. showing the delegator user's name and avatar). This allows for a form of "consensual impersonation" that is authorized by the delegators and delegates.

This is useful as a way to centralize all of a user's many "alt accounts" into a single, unified feed.

Extension Definition

The Delegation extension uses an ID of pub.versia:delegation.

If the extension is present, exactly one of the fields MUST be specified:

  • Name
    delegator
    Type
    Reference
    Description

    If this user performs actions on behalf on another user, MUST have a reference to that user.

  • Name
    allowed_delegates
    Type
    Reference[]
    Description

    If other users perform actions on behalf of this user, MUST have a list of references to all such users.

Example Delegator

{
    // ...
    "type": "User",
    "id": "73cb1728-75d7-4080-8d28-4adf49bb0a0d",
    // ...
    "extensions": { 
        "pub.versia:delegation": {
            "delegator": "versia.example.com:bfb6bb39-bb08-4226-91ac-8adebc3da046"
        }
    }
}

Example Delegates List

{
    // ...
    "type": "User",
    "id": "bfb6bb39-bb08-4226-91ac-8adebc3da046",
    // ...
    "extensions": { 
        "pub.versia:delegation": {
            "allowed_delegates": [
                "versia.social:73cb1728-75d7-4080-8d28-4adf49bb0a0d"
            ]
        }
    }
}