{ "swagger": "2.0", "info": { "description": "Auth system made for kyoo.", "title": "Keibi - Kyoo's auth", "contact": { "name": "Repository", "url": "https://github.com/zoriya/kyoo" }, "license": { "name": "GPL-3.0", "url": "https://www.gnu.org/licenses/gpl-3.0.en.html" }, "version": "1.0" }, "host": "kyoo.zoriya.dev", "basePath": "/auth", "paths": { "/.well-known/jwks.json": { "get": { "description": "Get the jwks info, used to validate jwts.", "produces": [ "application/json" ], "tags": [ "jwt" ], "summary": "Jwks", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.JwkSet" } } } } }, "/info": { "get": { "description": "List keibi's settings (oidc providers, public url...)", "produces": [ "application/json" ], "tags": [ "oidc" ], "summary": "Auth info", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.ServerInfo" } } } } }, "/jwt": { "get": { "security": [ { "Token": [] } ], "description": "Convert a session token or an API key to a short lived JWT.", "produces": [ "application/json" ], "tags": [ "jwt" ], "summary": "Get JWT", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.Jwt" }, "headers": { "Authorization": { "type": "string", "description": "Jwt (same value as the returned token)" } } }, "403": { "description": "Invalid session token (or expired)", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/keys": { "get": { "security": [ { "Jwt": [ "apikeys.read" ] } ], "description": "List all api keys", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "apikeys" ], "summary": "List API keys", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.Page-main_ApiKey" } } } }, "post": { "security": [ { "Jwt": [ "apikeys.write" ] } ], "description": "Create a new API key", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "apikeys" ], "summary": "Create API key", "parameters": [ { "description": "Api key info", "name": "key", "in": "body", "schema": { "$ref": "#/definitions/main.ApiKeyDto" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/main.ApiKeyWToken" } }, "409": { "description": "Duplicated api key", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "Invalid create body", "schema": { "$ref": "#/definitions/main.KError" } } } }, "delete": { "security": [ { "Jwt": [ "apikeys.write" ] } ], "description": "Delete an existing API key", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "apikeys" ], "summary": "Delete API key", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.ApiKey" } }, "404": { "description": "Invalid id", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "Invalid id format", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/oidc/callback/{provider}": { "get": { "description": "Exchange an opaque OIDC token for a local session.", "produces": [ "application/json" ], "tags": [ "oidc" ], "summary": "OIDC callback", "parameters": [ { "type": "string", "example": "google", "description": "OIDC provider id", "name": "provider", "in": "path", "required": true }, { "type": "string", "description": "Opaque token returned by /oidc/logged/:provider", "name": "token", "in": "query", "required": true }, { "type": "string", "description": "Optional tenant passthrough for federated setups", "name": "tenant", "in": "query" }, { "type": "string", "description": "Bearer token to link provider to current account", "name": "Authorization", "in": "header" } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/main.SessionWToken" } }, "404": { "description": "Unknown OIDC provider", "schema": { "$ref": "#/definitions/main.KError" } }, "410": { "description": "Login token expired or already used", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/oidc/logged/{provider}": { "get": { "description": "Callback endpoint called by OIDC providers after login.", "produces": [ "application/json" ], "tags": [ "oidc" ], "summary": "OIDC logged callback", "parameters": [ { "type": "string", "example": "google", "description": "OIDC provider id", "name": "provider", "in": "path", "required": true }, { "type": "string", "description": "State value returned by the provider", "name": "state", "in": "query", "required": true }, { "type": "string", "description": "Authorization code", "name": "code", "in": "query" }, { "type": "string", "description": "Provider callback error", "name": "error", "in": "query" } ], "responses": { "302": { "description": "Found" }, "400": { "description": "Invalid state", "schema": { "$ref": "#/definitions/main.KError" } }, "404": { "description": "Unknown OIDC provider", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/oidc/login/{provider}": { "get": { "description": "Start an OIDC login with a provider.", "produces": [ "application/json" ], "tags": [ "oidc" ], "summary": "OIDC login", "parameters": [ { "type": "string", "example": "google", "description": "OIDC provider id", "name": "provider", "in": "path", "required": true }, { "type": "string", "description": "URL to redirect the browser to after provider callback", "name": "redirectUrl", "in": "query", "required": true }, { "type": "string", "description": "Optional tenant passthrough for federated setups", "name": "tenant", "in": "query" } ], "responses": { "302": { "description": "Found" }, "400": { "description": "Missing redirectUrl", "schema": { "$ref": "#/definitions/main.KError" } }, "404": { "description": "Unknown OIDC provider", "schema": { "$ref": "#/definitions/main.KError" } } } }, "delete": { "security": [ { "Jwt": [] } ], "description": "Remove an OIDC provider from the current account.", "produces": [ "application/json" ], "tags": [ "oidc" ], "summary": "OIDC unlink provider", "parameters": [ { "type": "string", "example": "google", "description": "OIDC provider id", "name": "provider", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Unknown OIDC provider", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/sessions": { "get": { "security": [ { "Jwt": [] } ], "description": "List all active sessions for the currently connected user", "produces": [ "application/json" ], "tags": [ "sessions" ], "summary": "List my sessions", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/main.SessionWCurrent" } } }, "401": { "description": "Missing jwt token", "schema": { "$ref": "#/definitions/main.KError" } }, "403": { "description": "Invalid jwt token (or expired)", "schema": { "$ref": "#/definitions/main.KError" } } } }, "post": { "description": "Login to your account and open a session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "sessions" ], "summary": "Login", "parameters": [ { "type": "string", "example": "android tv", "description": "The device the created session will be used on", "name": "device", "in": "query" }, { "description": "Account informations", "name": "login", "in": "body", "schema": { "$ref": "#/definitions/main.LoginDto" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/main.SessionWToken" } }, "403": { "description": "Invalid password", "schema": { "$ref": "#/definitions/main.KError" } }, "404": { "description": "Account does not exists", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "User does not have a password (registered via oidc, please login via oidc)", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/sessions/current": { "delete": { "security": [ { "Jwt": [] } ], "description": "Delete a session and logout", "produces": [ "application/json" ], "tags": [ "sessions" ], "summary": "Logout", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.Session" } }, "401": { "description": "Missing jwt token", "schema": { "$ref": "#/definitions/main.KError" } }, "403": { "description": "Invalid jwt token (or expired)", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/sessions/{id}": { "delete": { "security": [ { "Jwt": [] } ], "description": "Delete a session and logout", "produces": [ "application/json" ], "tags": [ "sessions" ], "summary": "Delete other session", "parameters": [ { "type": "string", "format": "uuid", "example": "e05089d6-9179-4b5b-a63e-94dd5fc2a397", "description": "The id of the session to delete", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.Session" } }, "404": { "description": "Session not found with specified id (if not using the /current route)", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "Invalid session id", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/users": { "get": { "security": [ { "Jwt": [ "users.read" ] } ], "description": "List all users existing in this instance.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "List all users", "parameters": [ { "type": "string", "description": "used for pagination.", "name": "after", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/main.Page-models_User" } }, "422": { "description": "Invalid after id", "schema": { "$ref": "#/definitions/main.KError" } } } }, "post": { "description": "Register as a new user and open a session for it", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Register", "parameters": [ { "type": "string", "example": "android", "description": "The device the created session will be used on", "name": "device", "in": "query" }, { "description": "Registration informations", "name": "user", "in": "body", "schema": { "$ref": "#/definitions/models.RegisterDto" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/main.SessionWToken" } }, "403": { "description": "Registrations are disabled", "schema": { "$ref": "#/definitions/main.KError" } }, "409": { "description": "Duplicated email or username", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "Invalid register body", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/users/me": { "get": { "security": [ { "Jwt": [] } ], "description": "Get informations about the currently connected user", "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Get me", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } }, "401": { "description": "Missing jwt token", "schema": { "$ref": "#/definitions/main.KError" } }, "403": { "description": "Invalid jwt token (or expired)", "schema": { "$ref": "#/definitions/main.KError" } } } }, "delete": { "security": [ { "Jwt": [] } ], "description": "Delete your account and all your sessions", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Delete self", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } } } }, "patch": { "security": [ { "Jwt": [] } ], "description": "Edit your account's info", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Edit self", "parameters": [ { "description": "Edited user info", "name": "user", "in": "body", "schema": { "$ref": "#/definitions/models.EditUserDto" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } }, "403": { "description": "You can't edit a protected claim", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "Invalid body", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/users/me/logo": { "get": { "security": [ { "Jwt": [] } ], "description": "Get the current user's logo (manual upload if available, gravatar otherwise)", "produces": [ "image/*" ], "tags": [ "users" ], "summary": "Get my logo", "responses": { "200": { "description": "OK", "schema": { "type": "file" } }, "401": { "description": "Missing jwt token", "schema": { "$ref": "#/definitions/main.KError" } }, "403": { "description": "Invalid jwt token (or expired)", "schema": { "$ref": "#/definitions/main.KError" } }, "404": { "description": "No gravatar image found for this user", "schema": { "$ref": "#/definitions/main.KError" } } } }, "post": { "security": [ { "Jwt": [] } ], "description": "Upload a manual profile picture for the current user", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Upload my logo", "parameters": [ { "type": "file", "description": "Profile picture image (jpeg/png/gif/webp, max 5MB)", "name": "logo", "in": "formData", "required": true } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Missing jwt token", "schema": { "$ref": "#/definitions/main.KError" } }, "403": { "description": "Invalid jwt token (or expired)", "schema": { "$ref": "#/definitions/main.KError" } }, "413": { "description": "File too large", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "Missing or invalid logo file", "schema": { "$ref": "#/definitions/main.KError" } } } }, "delete": { "security": [ { "Jwt": [] } ], "description": "Delete the current user's manually uploaded profile picture", "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Delete my logo", "responses": { "204": { "description": "No Content" }, "401": { "description": "Missing jwt token", "schema": { "$ref": "#/definitions/main.KError" } }, "403": { "description": "Invalid jwt token (or expired)", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/users/me/password": { "patch": { "security": [ { "Jwt": [] } ], "description": "Edit your password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Edit password", "parameters": [ { "type": "boolean", "default": true, "description": "Invalidate other sessions", "name": "invalidate", "in": "query" }, { "description": "New password", "name": "user", "in": "body", "schema": { "$ref": "#/definitions/models.EditPasswordDto" } } ], "responses": { "204": { "description": "No Content" }, "422": { "description": "Invalid body", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/users/me/{id}": { "delete": { "security": [ { "Jwt": [] } ], "description": "Delete the user's manually uploaded profile picture", "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Delete user logo", "parameters": [ { "type": "string", "description": "The id or username of the user", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "401": { "description": "Missing jwt token", "schema": { "$ref": "#/definitions/main.KError" } }, "403": { "description": "Invalid jwt token (or expired)", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/users/{id}": { "get": { "security": [ { "Jwt": [ "users.read" ] } ], "description": "Get informations about a user from it's id", "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Get user", "parameters": [ { "type": "string", "format": "uuid", "description": "The id of the user", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } }, "404": { "description": "No user with the given id found", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "Invalid id (not a uuid)", "schema": { "$ref": "#/definitions/main.KError" } } } }, "delete": { "security": [ { "Jwt": [ "users.delete" ] } ], "description": "Delete an account and all it's sessions.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Delete user", "parameters": [ { "type": "string", "format": "uuid", "description": "User id of the user to delete", "name": "id", "in": "path" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } }, "404": { "description": "Invalid user id", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "Invalid id format", "schema": { "$ref": "#/definitions/main.KError" } } } }, "patch": { "security": [ { "Jwt": [ "users.write" ] } ], "description": "Edit an account info or permissions", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Edit user", "parameters": [ { "type": "string", "format": "uuid", "description": "User id of the user to edit", "name": "id", "in": "path" }, { "description": "Edited user info", "name": "user", "in": "body", "schema": { "$ref": "#/definitions/models.EditUserDto" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } }, "403": { "description": "You don't have permissions to edit another account", "schema": { "$ref": "#/definitions/main.KError" } }, "422": { "description": "Invalid body", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/users/{id}/logo": { "get": { "security": [ { "Jwt": [ "users.read" ] } ], "description": "Get a user's logo (manual upload if available, gravatar otherwise)", "produces": [ "image/*" ], "tags": [ "users" ], "summary": "Get user logo", "parameters": [ { "type": "string", "description": "The id or username of the user", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } }, "404": { "description": "No gravatar image found for this user", "schema": { "$ref": "#/definitions/main.KError" } } } } }, "/users/{id}/sessions": { "get": { "security": [ { "Jwt": [] } ], "description": "List all active sessions for a user. Listing someone else's sessions requires users.read.", "produces": [ "application/json" ], "tags": [ "sessions" ], "summary": "List user sessions", "parameters": [ { "type": "string", "example": "e05089d6-9179-4b5b-a63e-94dd5fc2a397", "description": "The id or username of the user", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/main.Session" } } }, "401": { "description": "Missing jwt token", "schema": { "$ref": "#/definitions/main.KError" } }, "403": { "description": "Missing permissions: users.read.", "schema": { "$ref": "#/definitions/main.KError" } }, "404": { "description": "No user found with id or username", "schema": { "$ref": "#/definitions/main.KError" } } } } } }, "definitions": { "main.ApiKey": { "type": "object", "properties": { "claims": { "type": "object", "additionalProperties": { "type": "string" }, "example": { "isAdmin": " true" } }, "createAt": { "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "id": { "type": "string", "example": "e05089d6-9179-4b5b-a63e-94dd5fc2a397" }, "lastUsed": { "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "name": { "type": "string", "example": "myapp" } } }, "main.ApiKeyDto": { "type": "object", "properties": { "claims": { "type": "object", "additionalProperties": { "type": "string" }, "example": { "isAdmin": " true" } }, "name": { "type": "string", "example": "myapp" } } }, "main.ApiKeyWToken": { "type": "object", "properties": { "claims": { "type": "object", "additionalProperties": { "type": "string" }, "example": { "isAdmin": " true" } }, "createAt": { "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "id": { "type": "string", "example": "e05089d6-9179-4b5b-a63e-94dd5fc2a397" }, "lastUsed": { "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "name": { "type": "string", "example": "myapp" }, "token": { "type": "string", "example": "myapp-lyHzTYm9yi+pkEv3m2tamAeeK7Dj7N3QRP7xv7dPU5q9MAe8tU4ySwYczE0RaMr4fijsA==" } } }, "main.JwkSet": { "type": "object", "properties": { "keys": { "type": "array", "items": { "type": "object", "properties": { "e": { "type": "string", "example": "AQAB" }, "key_ops": { "type": "array", "items": { "type": "string" }, "example": [ "[verify]" ] }, "kty": { "type": "string", "example": "RSA" }, "n": { "type": "string", "example": "oBcXcJUR-Sb8_b4qIj28LRAPxdF_6odRr52K5-ymiEkR2DOlEuXBtM-biWxPESW-U-zhfHzdVLf6ioy5xL0bJTh8BMIorkrDliN3vb81jCvyOMgZ7ATMJpMAQMmSDN7sL3U45r22FaoQufCJMQHmUsZPecdQSgj2aFBiRXxsLleYlSezdBVT_gKH-coqeYXSC_hk-ezSq4aDZ10BlDnZ-FA7-ES3T7nBmJEAU7KDAGeSvbYAfYimOW0r-Vc0xQNuwGCfzZtSexKXDbYbNwOVo3SjfCabq-gMfap_owcHbKicGBZu1LDlh7CpkmLQf_kv6GihM2LWFFh6Vwg2cltiwF22EIPlUDtYTkUR0qRkdNJaNkwV5Vv_6r3pzSmu5ovRriKtlrvJMjlTnLb4_ltsge3fw5Z34cJrsp094FbUc2O6Or4FGEXUldieJCnVRhs2_h6SDcmeMXs1zfvE5GlDnq8tZV6WMJ5Sb4jNO7rs_hTkr23_E6mVg-DdtozGfqzRzhIjPym6D_jVfR6dZv5W0sKwOHRmT7nYq-C7b2sAwmNNII296M4Rq-jn0b5pgSeMDYbIpbIA4thU8LYU0lBZp_ZVwWKG1RFZDxz3k9O5UVth2kTpTWlwn0hB1aAvgXHo6in1CScITGA72p73RbDieNnLFaCK4xUVstkWAKLqPxs" }, "use": { "type": "string", "example": "sig" } } } } } }, "main.Jwt": { "type": "object", "properties": { "token": { "description": "The jwt token you can use for all authorized call to either keibi or other services.", "type": "string", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30" } } }, "main.KError": { "type": "object", "properties": { "details": {}, "message": { "type": "string", "example": "No user found with this id" }, "status": { "type": "integer", "example": 404 } } }, "main.LoginDto": { "type": "object", "required": [ "login", "password" ], "properties": { "login": { "description": "Either the email or the username.", "type": "string", "example": "zoriya" }, "password": { "description": "Password of the account.", "type": "string", "example": "password1234" } } }, "main.OidcInfo": { "type": "object", "properties": { "logo": { "type": "string" }, "name": { "type": "string" } } }, "main.Page-main_ApiKey": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/main.ApiKey" } }, "next": { "type": "string", "example": "https://kyoo.zoriya.dev/auth/users?after=aoeusth" }, "this": { "type": "string", "example": "https://kyoo.zoriya.dev/auth/users" } } }, "main.Page-models_User": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/models.User" } }, "next": { "type": "string", "example": "https://kyoo.zoriya.dev/auth/users?after=aoeusth" }, "this": { "type": "string", "example": "https://kyoo.zoriya.dev/auth/users" } } }, "main.ServerInfo": { "type": "object", "properties": { "allowRegister": { "type": "boolean" }, "oidc": { "type": "object", "additionalProperties": { "$ref": "#/definitions/main.OidcInfo" } }, "publicUrl": { "type": "string" } } }, "main.Session": { "type": "object", "properties": { "createdDate": { "description": "When was the session first opened", "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "device": { "description": "Device that created the session.", "type": "string", "example": "Web - Firefox" }, "id": { "description": "Unique id of this session. Can be used for calls to DELETE", "type": "string", "example": "e05089d6-9179-4b5b-a63e-94dd5fc2a397" }, "lastUsed": { "description": "Last date this session was used to access a service.", "type": "string", "example": "2025-03-29T18:20:05.267Z" } } }, "main.SessionWCurrent": { "type": "object", "properties": { "createdDate": { "description": "When was the session first opened", "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "current": { "type": "boolean" }, "device": { "description": "Device that created the session.", "type": "string", "example": "Web - Firefox" }, "id": { "description": "Unique id of this session. Can be used for calls to DELETE", "type": "string", "example": "e05089d6-9179-4b5b-a63e-94dd5fc2a397" }, "lastUsed": { "description": "Last date this session was used to access a service.", "type": "string", "example": "2025-03-29T18:20:05.267Z" } } }, "main.SessionWToken": { "type": "object", "properties": { "createdDate": { "description": "When was the session first opened", "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "device": { "description": "Device that created the session.", "type": "string", "example": "Web - Firefox" }, "id": { "description": "Unique id of this session. Can be used for calls to DELETE", "type": "string", "example": "e05089d6-9179-4b5b-a63e-94dd5fc2a397" }, "lastUsed": { "description": "Last date this session was used to access a service.", "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "token": { "type": "string", "example": "lyHzTYm9yi+pkEv3m2tamAeeK7Dj7N3QRP7xv7dPU5q9MAe8tU4ySwYczE0RaMr4fijsA==" } } }, "models.EditPasswordDto": { "type": "object", "required": [ "newPassword" ], "properties": { "newPassword": { "type": "string", "example": "password1234" }, "oldPassword": { "type": "string", "example": "password1234" } } }, "models.EditUserDto": { "type": "object", "properties": { "claims": { "type": "object", "additionalProperties": { "type": "string" }, "example": { "preferOriginal": " true" } }, "email": { "type": "string", "example": "kyoo@zoriya.dev" }, "username": { "type": "string", "example": "zoriya" } } }, "models.OidcHandle": { "type": "object", "properties": { "id": { "description": "Id of this oidc handle.", "type": "string", "example": "e05089d6-9179-4b5b-a63e-94dd5fc2a397" }, "profileUrl": { "description": "Link to the profile of the user on the external service. Null if unknown or irrelevant.", "type": "string", "format": "url", "example": "https://myanimelist.net/profile/zoriya" }, "username": { "description": "Username of the user on the external service.", "type": "string", "example": "zoriya" } } }, "models.RegisterDto": { "type": "object", "required": [ "email", "password", "username" ], "properties": { "email": { "description": "Valid email that could be used for forgotten password requests. Can be used for login.", "type": "string", "format": "email", "example": "kyoo@zoriya.dev" }, "password": { "description": "Password to use.", "type": "string", "example": "password1234" }, "username": { "description": "Username of the new account, can't contain @ signs. Can be used for login.", "type": "string", "example": "zoriya" } } }, "models.User": { "type": "object", "properties": { "claims": { "description": "List of custom claims JWT created via get /jwt will have", "type": "object", "additionalProperties": { "type": "string" }, "example": { "isAdmin": " true" } }, "createdDate": { "description": "When was this account created?", "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "email": { "description": "Email of the user. Can be used as a login.", "type": "string", "format": "email", "example": "kyoo@zoriya.dev" }, "hasPassword": { "description": "False if the user has never setup a password and only used oidc.", "type": "boolean" }, "id": { "description": "Id of the user.", "type": "string", "example": "e05089d6-9179-4b5b-a63e-94dd5fc2a397" }, "lastSeen": { "description": "When was the last time this account made any authorized request?", "type": "string", "example": "2025-03-29T18:20:05.267Z" }, "oidc": { "description": "List of other login method available for this user. Access tokens wont be returned here.", "type": "object", "additionalProperties": { "$ref": "#/definitions/models.OidcHandle" } }, "username": { "description": "Username of the user. Can be used as a login.", "type": "string", "example": "zoriya" } } } }, "securityDefinitions": { "Jwt": { "type": "apiKey", "name": "Authorization", "in": "header" }, "Token": { "type": "apiKey", "name": "Authorization", "in": "header" } } }