Files
yucca/packages/yucca-admin-api/openapi-specs.json
T

1541 lines
34 KiB
JSON

{
"openapi": "3.0.0",
"paths": {
"/api/auth": {
"get": {
"operationId": "getAuth",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AuthDto"
}
}
}
}
},
"tags": [
"Auth"
]
}
},
"/api/auth/logout": {
"get": {
"operationId": "logout",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"tags": [
"Auth"
]
}
},
"/api/auth/oidc/login": {
"get": {
"operationId": "oidcAuthorize",
"parameters": [
{
"name": "code_challenge",
"required": true,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "state",
"required": true,
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"tags": [
"Auth"
]
}
},
"/api/auth/cli/login": {
"get": {
"operationId": "cliLogin",
"parameters": [
{
"name": "port",
"required": true,
"in": "query",
"schema": {
"type": "number"
}
},
{
"name": "state",
"required": true,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "code_challenge",
"required": true,
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"tags": [
"Auth"
]
}
},
"/api/auth/cli/token": {
"post": {
"operationId": "cliToken",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CliTokenRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CliTokenResponseDto"
}
}
}
}
},
"tags": [
"Auth"
]
}
},
"/api/auth/oidc/callback": {
"get": {
"operationId": "oidcCallback",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"tags": [
"Auth"
]
}
},
"/api/user": {
"get": {
"operationId": "listUsers",
"parameters": [
{
"name": "cursor",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"required": false,
"in": "query",
"schema": {
"default": 50,
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserListResponseDto"
}
}
}
}
},
"tags": [
"User"
]
}
},
"/api/user/{id}": {
"get": {
"operationId": "getUser",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserGetResponseDto"
}
}
}
}
},
"tags": [
"User"
]
},
"patch": {
"operationId": "updateUser",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserUpdateRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserUpdateResponseDto"
}
}
}
}
},
"tags": [
"User"
]
},
"delete": {
"operationId": "deleteUser",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": ""
}
},
"tags": [
"User"
]
}
},
"/api/user/{userId}/session": {
"get": {
"operationId": "listUserSessions",
"parameters": [
{
"name": "userId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SessionListResponseDto"
}
}
}
}
},
"tags": [
"User"
]
},
"delete": {
"operationId": "deleteUserSessions",
"parameters": [
{
"name": "userId",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": ""
}
},
"tags": [
"User"
]
}
},
"/api/user/{id}/features": {
"get": {
"operationId": "getUserFeatures",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserFeaturesResponseDto"
}
}
}
}
},
"tags": [
"User"
]
}
},
"/api/user/{id}/features/{flag}": {
"put": {
"operationId": "setUserFeature",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
},
{
"name": "flag",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeatureOverrideSetRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeatureOverrideDto"
}
}
}
}
},
"tags": [
"User"
]
},
"delete": {
"operationId": "clearUserFeature",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
},
{
"name": "flag",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": ""
}
},
"tags": [
"User"
]
}
},
"/api/session/{id}": {
"delete": {
"operationId": "deleteSession",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": ""
}
},
"tags": [
"Session"
]
}
},
"/api/repository": {
"get": {
"operationId": "listRepositories",
"parameters": [
{
"name": "cursor",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"required": false,
"in": "query",
"schema": {
"default": 50,
"type": "string"
}
},
{
"name": "userId",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepositoryListResponseDto"
}
}
}
}
},
"tags": [
"Repository"
]
},
"post": {
"operationId": "createRepository",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepositoryCreateRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepositoryCreateResponseDto"
}
}
}
}
},
"tags": [
"Repository"
]
}
},
"/api/repository/{id}": {
"get": {
"operationId": "getRepository",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepositoryGetResponseDto"
}
}
}
}
},
"tags": [
"Repository"
]
},
"patch": {
"operationId": "updateRepository",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepositoryUpdateRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepositoryUpdateResponseDto"
}
}
}
}
},
"tags": [
"Repository"
]
},
"delete": {
"operationId": "deleteRepository",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": ""
}
},
"tags": [
"Repository"
]
}
},
"/api/repository/{id}/url": {
"post": {
"operationId": "repositoryUrl",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RepositoryUrlResponseDto"
}
}
}
}
},
"tags": [
"Repository"
]
}
},
"/api/allowlist": {
"get": {
"operationId": "listAllowlist",
"parameters": [
{
"name": "cursor",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"required": false,
"in": "query",
"schema": {
"default": 50,
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AllowlistListResponseDto"
}
}
}
}
},
"tags": [
"Allowlist"
]
},
"post": {
"operationId": "addAllowlistEntry",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AllowlistAddRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AllowlistEntryResponseDto"
}
}
}
}
},
"tags": [
"Allowlist"
]
}
},
"/api/allowlist/{email}": {
"delete": {
"operationId": "removeAllowlistEntry",
"parameters": [
{
"name": "email",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": ""
}
},
"tags": [
"Allowlist"
]
}
},
"/api/allowlist/invite": {
"post": {
"operationId": "inviteEmails",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AllowlistInviteRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AllowlistEntriesResponseDto"
}
}
}
}
},
"tags": [
"Allowlist"
]
}
},
"/api/allowlist/invite-batch": {
"post": {
"operationId": "inviteBatch",
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AllowlistInviteBatchRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AllowlistEntriesResponseDto"
}
}
}
}
},
"tags": [
"Allowlist"
]
}
},
"/api/features": {
"get": {
"operationId": "listFeatures",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeatureFlagListResponseDto"
}
}
}
}
},
"tags": [
"Features"
]
}
},
"/api/features/{flag}/users": {
"get": {
"operationId": "listFeatureUsers",
"parameters": [
{
"name": "flag",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeatureUsersResponseDto"
}
}
}
}
},
"tags": [
"Features"
]
}
},
"/api/features/{flag}/enable-batch": {
"post": {
"operationId": "enableFeatureBatch",
"parameters": [
{
"name": "flag",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeatureEnableBatchRequestDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeatureEnableBatchResponseDto"
}
}
}
}
},
"tags": [
"Features"
]
}
}
},
"info": {
"title": "yucca-admin",
"description": "yucca admin API",
"version": "1.0.0",
"contact": {}
},
"tags": [],
"servers": [
{
"url": "/"
}
],
"components": {
"schemas": {
"AuthDto": {
"type": "object",
"properties": {
"sub": {
"type": "string"
}
},
"required": [
"sub"
]
},
"CliTokenRequestDto": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "One-time code delivered to the loopback redirect"
},
"codeVerifier": {
"type": "string",
"description": "Plaintext verifier whose S256 hash was sent as code_challenge on /auth/cli/login"
}
},
"required": [
"code",
"codeVerifier"
]
},
"CliTokenResponseDto": {
"type": "object",
"properties": {
"accessToken": {
"type": "string",
"description": "ES256 session JWT for Authorization: Bearer"
},
"expiresAt": {
"type": "string",
"description": "Session expiry, ISO 8601"
},
"sub": {
"type": "string"
}
},
"required": [
"accessToken",
"expiresAt",
"sub"
]
},
"UserDto": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"sub": {
"type": "string"
},
"name": {
"type": "string"
},
"email": {
"type": "string"
},
"disabled": {
"type": "boolean"
}
},
"required": [
"id",
"sub",
"name",
"email",
"disabled"
]
},
"UserListResponseDto": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserDto"
}
},
"nextCursor": {
"type": "object",
"nullable": true
}
},
"required": [
"items"
]
},
"UserGetResponseDto": {
"type": "object",
"properties": {
"user": {
"$ref": "#/components/schemas/UserDto"
}
},
"required": [
"user"
]
},
"UserUpdateRequestDto": {
"type": "object",
"properties": {
"disabled": {
"type": "boolean"
}
}
},
"UserUpdateResponseDto": {
"type": "object",
"properties": {
"user": {
"$ref": "#/components/schemas/UserDto"
}
},
"required": [
"user"
]
},
"SessionDto": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"id",
"userId"
]
},
"SessionListResponseDto": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SessionDto"
}
}
},
"required": [
"items"
]
},
"FeatureOverrideDto": {
"type": "object",
"properties": {
"flag": {
"type": "string"
},
"value": {
"type": "boolean"
},
"setBy": {
"type": "string"
},
"reason": {
"type": "object",
"nullable": true
},
"updatedAt": {
"type": "string"
}
},
"required": [
"flag",
"value",
"setBy",
"updatedAt"
]
},
"UserFeaturesResponseDto": {
"type": "object",
"properties": {
"features": {
"type": "object",
"additionalProperties": {
"type": "boolean"
},
"description": "Resolved flags: override, else registry default"
},
"overrides": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FeatureOverrideDto"
}
}
},
"required": [
"features",
"overrides"
]
},
"FeatureOverrideSetRequestDto": {
"type": "object",
"properties": {
"value": {
"type": "boolean"
},
"reason": {
"type": "string"
}
},
"required": [
"value"
]
},
"RepositoryOwnerDto": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"email": {
"type": "string"
},
"disabled": {
"type": "boolean"
}
},
"required": [
"id",
"name",
"email",
"disabled"
]
},
"RepositoryMetricsDto": {
"type": "object",
"properties": {
"sizeBytes": {
"type": "number"
},
"lastStarted": {
"type": "string",
"nullable": true
},
"lastBackup": {
"type": "string",
"nullable": true
},
"lastSuccessfulBackup": {
"type": "string",
"nullable": true
},
"lastBackupDuration": {
"type": "object",
"nullable": true
}
},
"required": [
"sizeBytes"
]
},
"RepositoryAdminDto": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"worm": {
"type": "boolean"
},
"user": {
"$ref": "#/components/schemas/RepositoryOwnerDto"
},
"metrics": {
"$ref": "#/components/schemas/RepositoryMetricsDto"
}
},
"required": [
"id",
"name",
"worm",
"user",
"metrics"
]
},
"RepositoryListResponseDto": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RepositoryAdminDto"
}
},
"nextCursor": {
"type": "object",
"nullable": true
}
},
"required": [
"items"
]
},
"RepositoryCreateRequestDto": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"userId": {
"type": "string",
"description": "Owner; defaults to the admin service user"
},
"worm": {
"type": "boolean"
}
},
"required": [
"name"
]
},
"RepositoryCreateResponseDto": {
"type": "object",
"properties": {
"repository": {
"$ref": "#/components/schemas/RepositoryAdminDto"
}
},
"required": [
"repository"
]
},
"RepositoryGetResponseDto": {
"type": "object",
"properties": {
"repository": {
"$ref": "#/components/schemas/RepositoryAdminDto"
}
},
"required": [
"repository"
]
},
"RepositoryUrlResponseDto": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "restic rest: URL with an embedded repository token"
}
},
"required": [
"url"
]
},
"RepositoryUpdateRequestDto": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"worm": {
"type": "boolean"
}
}
},
"RepositoryUpdateResponseDto": {
"type": "object",
"properties": {
"repository": {
"$ref": "#/components/schemas/RepositoryAdminDto"
}
},
"required": [
"repository"
]
},
"AllowlistEntryDto": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"inviteCode": {
"type": "string"
},
"invited": {
"type": "boolean"
},
"inviteUsed": {
"type": "boolean"
},
"inviteUsedAt": {
"type": "string",
"nullable": true
},
"createdAt": {
"type": "string"
}
},
"required": [
"id",
"email",
"inviteCode",
"invited",
"inviteUsed",
"createdAt"
]
},
"AllowlistListResponseDto": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AllowlistEntryDto"
}
},
"nextCursor": {
"type": "object",
"nullable": true
}
},
"required": [
"items"
]
},
"AllowlistAddRequestDto": {
"type": "object",
"properties": {
"email": {
"type": "string"
},
"staged": {
"type": "boolean",
"description": "Stage the entry without allowing login yet"
}
},
"required": [
"email"
]
},
"AllowlistEntryResponseDto": {
"type": "object",
"properties": {
"entry": {
"$ref": "#/components/schemas/AllowlistEntryDto"
}
},
"required": [
"entry"
]
},
"AllowlistInviteRequestDto": {
"type": "object",
"properties": {
"emails": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"emails"
]
},
"AllowlistEntriesResponseDto": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AllowlistEntryDto"
}
}
},
"required": [
"items"
]
},
"AllowlistInviteBatchRequestDto": {
"type": "object",
"properties": {
"count": {
"type": "number"
}
},
"required": [
"count"
]
},
"FeatureFlagDefDto": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"default": {
"type": "boolean",
"description": "Registry default when no override exists"
},
"stage": {
"type": "string",
"description": "experimental | beta | ga | retired"
},
"description": {
"type": "string"
},
"since": {
"type": "string"
},
"overrides": {
"type": "number",
"description": "Number of users with an override for this flag"
}
},
"required": [
"key",
"default",
"stage",
"description",
"since",
"overrides"
]
},
"FeatureFlagListResponseDto": {
"type": "object",
"properties": {
"flags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FeatureFlagDefDto"
}
}
},
"required": [
"flags"
]
},
"FeatureUserDto": {
"type": "object",
"properties": {
"userId": {
"type": "string"
},
"email": {
"type": "string"
},
"value": {
"type": "boolean"
},
"setBy": {
"type": "string"
},
"reason": {
"type": "object",
"nullable": true
},
"updatedAt": {
"type": "string"
}
},
"required": [
"userId",
"email",
"value",
"setBy",
"updatedAt"
]
},
"FeatureUsersResponseDto": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FeatureUserDto"
}
}
},
"required": [
"items"
]
},
"FeatureEnableBatchRequestDto": {
"type": "object",
"properties": {
"count": {
"type": "number",
"description": "Enable for this many not-yet-overridden users, oldest first"
}
},
"required": [
"count"
]
},
"FeatureEnableBatchResponseDto": {
"type": "object",
"properties": {
"enabled": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FeatureUserDto"
}
}
},
"required": [
"enabled"
]
}
}
}
}