Skip to content

V2: Administration & Internal Endpoints #9

@sylv256

Description

@sylv256

We need commands to manage the backend, so for now, these will be implemented via the authentication system.

These are internal, so regular users shouldn't be using these. All endpoints are assumed to use the /internal/* path. Additionally, any of these endpoints MAY change at any time, and API is not 100% guaranteed.

  • POST /event/{event_slug}/create - Creates an event.
    • Requires an event name display_name, discord_role_id, minecraft_version, mod loader loader, registration_time, start_time, and end_time within an application/json body.
  • PUT /event/{event}/modify - Modifies an event's properties.
    • Requires any above properties within an application/json body.
  • POST /db/eval - Evaluates an SQL expression and returns the result.
    • Requires an expression within an application/json body.

POST Create User (Auth)

/user/create

{
    "username": "tiny_pineapple",
    "roles": [
        "abcde"
    ]
}

POST Create User Role (Auth)

/user/role/create

{
    "name": "Pineapple",
    "permissions": "1", // The user cannot add permissions they do not have, the server MUST refuse this request
    "integrations": {
        "discord": {
            "color": "ABCDEF",
            "permissions": "1" // Discord permissions
        }
    }
}

PUT Update User Role (Auth)

Any fields provided will override existing values.

Response

{
    "name": "Pineapple",
    "permissions": "1", // The user cannot add permissions they do not have, the server MUST refuse this request
    "integrations": {
        "discord": {
            "color": "ABCDEF",
            "permissions": "1" // Discord permissions
        }
    }
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions