summaryrefslogtreecommitdiff
path: root/internal/api/model
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-03-04 11:01:25 +0100
committerLibravatar GitHub <noreply@github.com>2025-03-04 10:01:25 +0000
commit829143d2636d4c0d274bf2ab4559912f472a2bc4 (patch)
treeb28175fadfbd2d02801337975560e522dd8e129b /internal/api/model
parent[chore] fixed email template to align with the new "Log in" button + separate... (diff)
downloadgotosocial-829143d2636d4c0d274bf2ab4559912f472a2bc4.tar.xz
[feature] Add token review / delete to backend + settings panel (#3845)
Diffstat (limited to 'internal/api/model')
-rw-r--r--internal/api/model/token.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/api/model/token.go b/internal/api/model/token.go
index 5a1abe28f..3ad45e684 100644
--- a/internal/api/model/token.go
+++ b/internal/api/model/token.go
@@ -33,3 +33,25 @@ type Token struct {
// example: 1627644520
CreatedAt int64 `json:"created_at"`
}
+
+// TokenInfo represents metadata about one user-level access token.
+// The actual access token itself will never be sent via the API.
+//
+// swagger:model tokenInfo
+type TokenInfo struct {
+ // Database ID of this token.
+ // example: 01JMW7QBAZYZ8T8H73PCEX12XG
+ ID string `json:"id"`
+ // When the token was created (ISO 8601 Datetime).
+ // example: 2021-07-30T09:20:25+00:00
+ CreatedAt string `json:"created_at"`
+ // Approximate time (accurate to within an hour) when the token was last used (ISO 8601 Datetime).
+ // Omitted if token has never been used, or it is not known when it was last used (eg., it was last used before tracking "last_used" became a thing).
+ // example: 2021-07-30T09:20:25+00:00
+ LastUsed string `json:"last_used,omitempty"`
+ // OAuth scopes granted by the token, space-separated.
+ // example: read write admin
+ Scope string `json:"scope"`
+ // Application used to create this token.
+ Application *Application `json:"application"`
+}