summaryrefslogtreecommitdiff
path: root/internal/api/model/token.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-07-31 17:49:59 +0200
committerLibravatar GitHub <noreply@github.com>2021-07-31 17:49:59 +0200
commit58dddd86e0ddbb0c6aa54506dcef162321babfbb (patch)
treeee83cec11f05dfe1e397b9303fe5cd7c2273d4f3 /internal/api/model/token.go
parentPassword change (#123) (diff)
downloadgotosocial-58dddd86e0ddbb0c6aa54506dcef162321babfbb.tar.xz
Swagger (#124)
* start experimenting with swagger documentation * further adventures in swagger * do a few more api paths * account paths documented * go fmt * fix up some models * bit o lintin'
Diffstat (limited to 'internal/api/model/token.go')
-rw-r--r--internal/api/model/token.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/internal/api/model/token.go b/internal/api/model/token.go
index 611ab214c..29a3c6f1d 100644
--- a/internal/api/model/token.go
+++ b/internal/api/model/token.go
@@ -18,14 +18,19 @@
package model
-// Token represents an OAuth token used for authenticating with the API and performing actions.. See https://docs.joinmastodon.org/entities/token/
+// Token represents an OAuth token used for authenticating with the GoToSocial API and performing actions.
+//
+// swagger:model oauthToken
type Token struct {
- // An OAuth token to be used for authorization.
+ // Access token used for authorization.
AccessToken string `json:"access_token"`
- // The OAuth token type. Mastodon uses Bearer tokens.
+ // OAuth token type. Will always be 'Bearer'.
+ // example: bearer
TokenType string `json:"token_type"`
- // The OAuth scopes granted by this token, space-separated.
+ // OAuth scopes granted by this token, space-separated.
+ // example: read write admin
Scope string `json:"scope"`
- // When the token was generated. (UNIX timestamp seconds)
+ // When the OAuth token was generated (UNIX timestamp seconds).
+ // example: 1627644520
CreatedAt int64 `json:"created_at"`
}