MMOframework
Why AI Playground Libraries Developers Agency
FR EN
Build a project live
Index

mmo-api-tokens

1 symbol · generated 30 Nov 2026

element

mmo-api-tokens

mmo-api-tokens.jhs:1

« Tokens » of the API console (mmo-api-console): the API clients acting as the account -- credentials of an account for its own code (mmo.oauth's ApiClient: its rights among the account's, its perimeter, an expiry) --, renewing one (a new secret, shown once) and revoking one; an administrator (apiClientsManage) makes them, for an account (a label, the rights given, an expiry within the site's longest; its secret shown once, with the call that exchanges it for a token), and sees apart, in « All the clients » (?all=1), those of the accounts they manage. The routes are the page's (MMO.config.user.accounts: apiClients, apiClientRenew, apiClientRevoke, clientToken, the session's token): a site without them says so. Any other account makes one of its own only, with the rights the site lets it give (apiClientsOwn, the list's own: mmo.oauth's AccessController::$apiClientOwnScopes, the MCP's).

<mmo-api-tokens scopes label></mmo-api-tokens>
Extends
CustomShadowElement
Given `scopes` (`mcp.data mcp.internals`: a page of its own, my.oviepro's MCP guide), it loads by itself and keeps to the clients holding one of them, its form made for the account itself, the first ticked and `label` its own.
<mmo-api-tokens scopes="mcp.data mcp.internals" label="AI assistant (MCP)"></mmo-api-tokens>

Index

scopes
label
init()
preset()
isPreset(client)
h(tag, attrs, children)
t(text, vars)
accounts()
call(url, method, body) async
load() asyncDraw the tab.
clients(clients, manage)
form(scopes, maxDays, own)
secret(created)
renew(client) asyncRenew a client, once confirmed: a new secret (shown once, as at its making) and a new expiry, the old secret ended.
revoke(client) asyncRevoke a client, once confirmed: archived, its tokens ended.

Attributes2

Methods13

preset()

mmo-api-tokens.jhs:29
preset()
returnsstring[]the rights a client of this page holds (scopes): none in the console

isPreset(client)

mmo-api-tokens.jhs:35
isPreset(client)
client
returnsbooleantrue if $client holds one of the preset rights, or a right above one (mcp for mcp.data)

h(tag, attrs, children)

mmo-api-tokens.jhs:41
h(tag, attrs = null, ...children)
tag
attrs = null
...children
returnsElementMMO.core.dom.createElement: a string child is a text node

t(text, vars)

mmo-api-tokens.jhs:46
t(text, vars = {})
text
vars = {}
returnsstring$text translated, its {name} replaced by $vars'

call(url, method, body)

asyncmmo-api-tokens.jhs:63
async call(url, method = 'GET', body = null)
urlstring
method = 'GET'string
body = null?Object
returnsPromise<{ok: boolean, data: *, reason: string>}

clients(clients, manage)

mmo-api-tokens.jhs:112
clients(clients, manage = false)
clients
manage = false
returnsElementthe clients: label, account (for an administrator), id, rights, expiry, last use, renew, revoke

form(scopes, maxDays, own)

mmo-api-tokens.jhs:135
form(scopes, maxDays = 90, own = null)
scopesObjectthe administrator's rights, user/scopes.json: the account's are checked by the server
maxDays = 90numberthe longest a client lasts on this site
own = null?string[]not an administrator: the only rights they give, to a client of their own
returnsElementthe form making a client: the account it acts as, a label, the rights given, an expiry

secret(created)

mmo-api-tokens.jhs:200
secret(created)
created
returnsElementthe secret of the client just made, once: its id, its secret, the call for a token

renew(client)

asyncmmo-api-tokens.jhs:218

Renew a client, once confirmed: a new secret (shown once, as at its making) and a new expiry, the old secret ended.

async renew(client)
clientObject
returnsPromise<void>

revoke(client)

asyncmmo-api-tokens.jhs:233

Revoke a client, once confirmed: archived, its tokens ended.

async revoke(client)
clientObject
returnsPromise<void>