diff --git a/packages/sshecret-frontend/openapi.json b/packages/sshecret-frontend/openapi.json index d1fbad5..fbd1f26 100644 --- a/packages/sshecret-frontend/openapi.json +++ b/packages/sshecret-frontend/openapi.json @@ -1 +1 @@ -{"openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": {"/health": {"get": {"summary": "Get Health", "description": "Provide simple health check.", "operationId": "get_health_health_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/v1/token": {"post": {"summary": "Login For Access Token", "description": "Login user and generate token.", "operationId": "login_for_access_token_api_v1_token_post", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/Body_login_for_access_token_api_v1_token_post"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Token"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/refresh": {"post": {"summary": "Refresh Token", "description": "Refresh access token.", "operationId": "refresh_token_api_v1_refresh_post", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/RefreshTokenForm"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Token"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/": {"get": {"summary": "Get Clients", "description": "Get clients.", "operationId": "get_clients_api_v1_clients__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/Client"}, "type": "array", "title": "Response Get Clients Api V1 Clients Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}, "post": {"summary": "Create Client", "description": "Create a new client.", "operationId": "create_client_api_v1_clients__post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientCreate"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Client"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/api/v1/clients/terse/": {"get": {"summary": "Get Clients Terse", "description": "Get a list of client ids and names.", "operationId": "get_clients_terse_api_v1_clients_terse__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/ClientReference"}, "type": "array", "title": "Response Get Clients Terse Api V1 Clients Terse Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/api/v1/query/clients/": {"get": {"summary": "Query Clients", "description": "Query clients.", "operationId": "query_clients_api_v1_query_clients__get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100, "exclusiveMinimum": 0, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Id"}}, {"name": "name", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}}, {"name": "name__like", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Like"}}, {"name": "name__contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Contains"}}, {"name": "order_by", "in": "query", "required": false, "schema": {"type": "string", "default": "created_at", "title": "Order By"}}, {"name": "order_reverse", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Order Reverse"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientQueryResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/{id}": {"get": {"summary": "Get Client", "description": "Get a client.", "operationId": "get_client_api_v1_clients__id__get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Client"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"summary": "Update Client", "description": "Update a client.", "operationId": "update_client_api_v1_clients__id__put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientCreate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Client"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"summary": "Delete Client", "description": "Delete a client.", "operationId": "delete_client_api_v1_clients__id__delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/{id}/secrets/{secret_name}": {"delete": {"summary": "Delete Secret From Client", "description": "Delete a secret from a client.", "operationId": "delete_secret_from_client_api_v1_clients__id__secrets__secret_name__delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}, {"name": "secret_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Secret Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"summary": "Add Secret To Client", "description": "Add secret to a client.", "operationId": "add_secret_to_client_api_v1_clients__id__secrets__secret_name__put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}, {"name": "secret_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Secret Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/{id}/policies": {"put": {"summary": "Update Client Policies", "description": "Update the client access policies.", "operationId": "update_client_policies_api_v1_clients__id__policies_put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdatePoliciesRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Client"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/{id}/public-key": {"put": {"summary": "Update Client Public Key", "description": "Update client public key.\n\nUpdating the public key will invalidate the current secrets, so these well\nbe resolved first, and re-encrypted using the new key.", "operationId": "update_client_public_key_api_v1_clients__id__public_key_put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateKeyModel"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateKeyResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/": {"get": {"summary": "Get Secret Names", "description": "Get Secret Names.", "operationId": "get_secret_names_api_v1_secrets__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/SecretListView"}, "type": "array", "title": "Response Get Secret Names Api V1 Secrets Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}, "post": {"summary": "Add Secret", "description": "Create a secret.", "operationId": "add_secret_api_v1_secrets__post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretCreate"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/api/v1/secrets/{name}": {"get": {"summary": "Get Secret", "description": "Get a secret.", "operationId": "get_secret_api_v1_secrets__name__get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string", "title": "Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretView"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"summary": "Update Secret", "operationId": "update_secret_api_v1_secrets__name__put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string", "title": "Name"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"summary": "Delete Secret", "description": "Delete secret.", "operationId": "delete_secret_api_v1_secrets__name__delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string", "title": "Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/groups/": {"get": {"summary": "Get Secret Groups", "description": "Get secret groups.", "operationId": "get_secret_groups_api_v1_secrets_groups__get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "filter_regex", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Filter Regex"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientSecretGroupList"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"summary": "Add Secret Group", "description": "Create a secret grouping.", "operationId": "add_secret_group_api_v1_secrets_groups__post", "security": [{"OAuth2PasswordBearer": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretGroupCreate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientSecretGroup"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/groups/{group_name}/": {"get": {"summary": "Get Secret Group", "description": "Get a specific secret group.", "operationId": "get_secret_group_api_v1_secrets_groups__group_name___get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientSecretGroup"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"summary": "Delete Secret Group", "description": "Remove a group.\n\nEntries within the group will be moved to the root.\nThis also includes nested entries further down from the group.", "operationId": "delete_secret_group_api_v1_secrets_groups__group_name___delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/groups/{group_name}/{secret_name}": {"post": {"summary": "Move Secret To Group", "description": "Move a secret to a group.", "operationId": "move_secret_to_group_api_v1_secrets_groups__group_name___secret_name__post", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Name"}}, {"name": "secret_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Secret Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"summary": "Remove Secret From Group", "description": "Remove a secret from a group.\n\nSecret will be moved to the root group.", "operationId": "remove_secret_from_group_api_v1_secrets_groups__group_name___secret_name__delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Name"}}, {"name": "secret_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Secret Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/group/{group_name}/parent/{parent_name}": {"post": {"summary": "Move Group", "description": "Move a group.", "operationId": "move_group_api_v1_secrets_group__group_name__parent__parent_name__post", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Name"}}, {"name": "parent_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Parent Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/group/{group_name}/parent/": {"delete": {"summary": "Move Group To Root", "description": "Move a group to the root.", "operationId": "move_group_to_root_api_v1_secrets_group__group_name__parent__delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"AutoGenerateOpts": {"properties": {"auto_generate": {"type": "boolean", "const": true, "title": "Auto Generate"}, "length": {"type": "integer", "title": "Length", "default": 32}}, "type": "object", "required": ["auto_generate"], "title": "AutoGenerateOpts", "description": "Option to auto-generate a password."}, "Body_login_for_access_token_api_v1_token_post": {"properties": {"grant_type": {"anyOf": [{"type": "string", "pattern": "^password$"}, {"type": "null"}], "title": "Grant Type"}, "username": {"type": "string", "title": "Username"}, "password": {"type": "string", "format": "password", "title": "Password"}, "scope": {"type": "string", "title": "Scope", "default": ""}, "client_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Client Id"}, "client_secret": {"anyOf": [{"type": "string"}, {"type": "null"}], "format": "password", "title": "Client Secret"}}, "type": "object", "required": ["username", "password"], "title": "Body_login_for_access_token_api_v1_token_post"}, "Client": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "name": {"type": "string", "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "public_key": {"type": "string", "title": "Public Key"}, "version": {"type": "integer", "title": "Version"}, "is_active": {"type": "boolean", "title": "Is Active"}, "is_deleted": {"type": "boolean", "title": "Is Deleted"}, "secrets": {"items": {"type": "string"}, "type": "array", "title": "Secrets"}, "policies": {"items": {"anyOf": [{"type": "string", "format": "ipvanynetwork"}, {"type": "string", "format": "ipvanyaddress"}]}, "type": "array", "title": "Policies"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Updated At"}, "deleted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Deleted At"}}, "type": "object", "required": ["id", "name", "description", "public_key", "version", "is_active", "is_deleted", "secrets", "policies", "created_at", "updated_at", "deleted_at"], "title": "Client", "description": "Implementation of the backend class ClientView."}, "ClientCreate": {"properties": {"name": {"type": "string", "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "public_key": {"type": "string", "title": "Public Key"}, "sources": {"items": {"anyOf": [{"type": "string", "format": "ipvanyaddress"}, {"type": "string", "format": "ipvanynetwork"}]}, "type": "array", "title": "Sources"}}, "type": "object", "required": ["name", "public_key"], "title": "ClientCreate", "description": "Model to create a client."}, "ClientQueryResult": {"properties": {"clients": {"items": {"$ref": "#/components/schemas/Client"}, "type": "array", "title": "Clients"}, "total_results": {"type": "integer", "title": "Total Results"}, "remaining_results": {"type": "integer", "title": "Remaining Results"}}, "type": "object", "required": ["clients", "total_results", "remaining_results"], "title": "ClientQueryResult", "description": "Implementation of the backend ClientQueryResult class."}, "ClientReference": {"properties": {"id": {"type": "string", "title": "Id"}, "name": {"type": "string", "title": "Name"}}, "type": "object", "required": ["id", "name"], "title": "ClientReference", "description": "Implementation of the backend class ClientReference."}, "ClientSecretGroup": {"properties": {"group_name": {"type": "string", "title": "Group Name"}, "path": {"type": "string", "title": "Path"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "parent_group": {"anyOf": [{"$ref": "#/components/schemas/ClientSecretGroup"}, {"type": "null"}]}, "children": {"items": {"$ref": "#/components/schemas/ClientSecretGroup"}, "type": "array", "title": "Children"}, "entries": {"items": {"$ref": "#/components/schemas/SecretClientMapping"}, "type": "array", "title": "Entries"}}, "type": "object", "required": ["group_name", "path"], "title": "ClientSecretGroup", "description": "Client secrets grouped."}, "ClientSecretGroupList": {"properties": {"ungrouped": {"items": {"$ref": "#/components/schemas/SecretClientMapping"}, "type": "array", "title": "Ungrouped"}, "groups": {"items": {"$ref": "#/components/schemas/ClientSecretGroup"}, "type": "array", "title": "Groups"}}, "type": "object", "title": "ClientSecretGroupList", "description": "Secret group list."}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "RefreshTokenForm": {"properties": {"grant_type": {"type": "string", "const": "refresh_token", "title": "Grant Type"}, "refresh_token": {"type": "string", "title": "Refresh Token"}}, "type": "object", "required": ["grant_type", "refresh_token"], "title": "RefreshTokenForm", "description": "The refresh token form data."}, "SecretClientMapping": {"properties": {"name": {"type": "string", "title": "Name"}, "unmanaged": {"type": "boolean", "title": "Unmanaged", "default": false}, "clients": {"items": {"$ref": "#/components/schemas/ClientReference"}, "type": "array", "title": "Clients"}}, "type": "object", "required": ["name"], "title": "SecretClientMapping", "description": "Secret name with list of clients."}, "SecretCreate": {"properties": {"value": {"anyOf": [{"type": "string"}, {"$ref": "#/components/schemas/AutoGenerateOpts"}], "title": "Value", "description": "Secret as string value or auto-generated with optional length", "examples": ["MySecretString", {"auto_generate": true, "length": 32}]}, "name": {"type": "string", "title": "Name"}, "clients": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Clients", "description": "Assign the secret to a list of clients."}, "group": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Group"}}, "type": "object", "required": ["value", "name"], "title": "SecretCreate", "description": "Model to create a secret.", "examples": [{"clients": ["client-1", "client-2"], "name": "MySecret", "value": {"auto_generate": true, "length": 32}}, {"group": "MySecretGroup", "name": "MySecret", "value": "mysecretstring"}]}, "SecretGroupCreate": {"properties": {"name": {"type": "string", "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "parent_group": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Group"}}, "type": "object", "required": ["name"], "title": "SecretGroupCreate", "description": "Create model for creating secret groups."}, "SecretListView": {"properties": {"name": {"type": "string", "title": "Name"}, "unmanaged": {"type": "boolean", "title": "Unmanaged", "default": false}, "clients": {"items": {"type": "string"}, "type": "array", "title": "Clients"}}, "type": "object", "required": ["name"], "title": "SecretListView", "description": "Model containing a list of all available secrets."}, "SecretUpdate": {"properties": {"value": {"anyOf": [{"type": "string"}, {"$ref": "#/components/schemas/AutoGenerateOpts"}], "title": "Value", "description": "Secret as string value or auto-generated with optional length", "examples": ["MySecretString", {"auto_generate": true, "length": 32}]}}, "type": "object", "required": ["value"], "title": "SecretUpdate", "description": "Model to update a secret."}, "SecretView": {"properties": {"name": {"type": "string", "title": "Name"}, "secret": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Secret"}, "group": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Group"}, "clients": {"items": {"$ref": "#/components/schemas/ClientReference"}, "type": "array", "title": "Clients"}}, "type": "object", "required": ["name", "secret"], "title": "SecretView", "description": "Model containing a secret, including its clear-text value."}, "Token": {"properties": {"access_token": {"type": "string", "title": "Access Token"}, "refresh_token": {"type": "string", "title": "Refresh Token"}, "token_type": {"type": "string", "title": "Token Type"}}, "type": "object", "required": ["access_token", "refresh_token", "token_type"], "title": "Token"}, "UpdateKeyModel": {"properties": {"public_key": {"type": "string", "title": "Public Key"}}, "type": "object", "required": ["public_key"], "title": "UpdateKeyModel", "description": "Model for updating client public key."}, "UpdateKeyResponse": {"properties": {"public_key": {"type": "string", "title": "Public Key"}, "updated_secrets": {"items": {"type": "string"}, "type": "array", "title": "Updated Secrets"}, "detail": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Detail"}}, "type": "object", "required": ["public_key"], "title": "UpdateKeyResponse", "description": "Response model after updating the public key."}, "UpdatePoliciesRequest": {"properties": {"sources": {"items": {"anyOf": [{"type": "string", "format": "ipvanyaddress"}, {"type": "string", "format": "ipvanynetwork"}]}, "type": "array", "title": "Sources"}}, "type": "object", "required": ["sources"], "title": "UpdatePoliciesRequest", "description": "Update policy request."}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}, "securitySchemes": {"OAuth2PasswordBearer": {"type": "oauth2", "flows": {"password": {"refreshUrl": "/api/v1/refresh", "scopes": {}, "tokenUrl": "/api/v1/token"}}}}}} \ No newline at end of file +{"openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": {"/health": {"get": {"summary": "Get Health", "description": "Provide simple health check.", "operationId": "get_health_health_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/v1/audit/": {"get": {"summary": "Get Audit Log", "description": "Query audit log.", "operationId": "get_audit_log_api_v1_audit__get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "subsystem", "in": "query", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/SubSystem"}, {"type": "null"}], "title": "Subsystem"}}, {"name": "operation", "in": "query", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/Operation"}, {"type": "null"}], "title": "Operation"}}, {"name": "client_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Client Id"}}, {"name": "client_name", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Client Name"}}, {"name": "secret_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Secret Id"}}, {"name": "secret_name", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Secret Name"}}, {"name": "origin", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Origin"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "default": 0, "title": "Offset"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": 100, "title": "Limit"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AuditListResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/token": {"post": {"summary": "Login For Access Token", "description": "Login user and generate token.", "operationId": "login_for_access_token_api_v1_token_post", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/Body_login_for_access_token_api_v1_token_post"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Token"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/refresh": {"post": {"summary": "Refresh Token", "description": "Refresh access token.", "operationId": "refresh_token_api_v1_refresh_post", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/RefreshTokenForm"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Token"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/": {"get": {"summary": "Get Clients", "description": "Get clients.", "operationId": "get_clients_api_v1_clients__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/Client"}, "type": "array", "title": "Response Get Clients Api V1 Clients Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}, "post": {"summary": "Create Client", "description": "Create a new client.", "operationId": "create_client_api_v1_clients__post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientCreate"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Client"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/api/v1/clients/terse/": {"get": {"summary": "Get Clients Terse", "description": "Get a list of client ids and names.", "operationId": "get_clients_terse_api_v1_clients_terse__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/ClientReference"}, "type": "array", "title": "Response Get Clients Terse Api V1 Clients Terse Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/api/v1/query/clients/": {"get": {"summary": "Query Clients", "description": "Query clients.", "operationId": "query_clients_api_v1_query_clients__get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100, "exclusiveMinimum": 0, "default": 100, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid"}, {"type": "null"}], "title": "Id"}}, {"name": "name", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}}, {"name": "name__like", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Like"}}, {"name": "name__contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Contains"}}, {"name": "order_by", "in": "query", "required": false, "schema": {"type": "string", "default": "created_at", "title": "Order By"}}, {"name": "order_reverse", "in": "query", "required": false, "schema": {"type": "boolean", "default": true, "title": "Order Reverse"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientQueryResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/{id}": {"get": {"summary": "Get Client", "description": "Get a client.", "operationId": "get_client_api_v1_clients__id__get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Client identifier", "description": "Identifier of path, may include the prefix 'id:' or 'name:'", "examples": ["name:myclient", "id:8eab15a4-a8eb-4d1b-b47f-2283b9f6f6b0"]}, "description": "Identifier of path, may include the prefix 'id:' or 'name:'"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Client"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"summary": "Update Client", "description": "Update a client.", "operationId": "update_client_api_v1_clients__id__put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Client identifier", "description": "Identifier of path, may include the prefix 'id:' or 'name:'", "examples": ["name:myclient", "id:8eab15a4-a8eb-4d1b-b47f-2283b9f6f6b0"]}, "description": "Identifier of path, may include the prefix 'id:' or 'name:'"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientCreate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Client"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"summary": "Delete Client", "description": "Delete a client.", "operationId": "delete_client_api_v1_clients__id__delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Client identifier", "description": "Identifier of path, may include the prefix 'id:' or 'name:'", "examples": ["name:myclient", "id:8eab15a4-a8eb-4d1b-b47f-2283b9f6f6b0"]}, "description": "Identifier of path, may include the prefix 'id:' or 'name:'"}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/{id}/secrets/{secret_name}": {"delete": {"summary": "Delete Secret From Client", "description": "Delete a secret from a client.", "operationId": "delete_secret_from_client_api_v1_clients__id__secrets__secret_name__delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Client identifier", "description": "Identifier of path, may include the prefix 'id:' or 'name:'", "examples": ["name:myclient", "id:8eab15a4-a8eb-4d1b-b47f-2283b9f6f6b0"]}, "description": "Identifier of path, may include the prefix 'id:' or 'name:'"}, {"name": "secret_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Secret Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"summary": "Add Secret To Client", "description": "Add secret to a client.", "operationId": "add_secret_to_client_api_v1_clients__id__secrets__secret_name__put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Client identifier", "description": "Identifier of path, may include the prefix 'id:' or 'name:'", "examples": ["name:myclient", "id:8eab15a4-a8eb-4d1b-b47f-2283b9f6f6b0"]}, "description": "Identifier of path, may include the prefix 'id:' or 'name:'"}, {"name": "secret_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Secret Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/{id}/policies": {"put": {"summary": "Update Client Policies", "description": "Update the client access policies.", "operationId": "update_client_policies_api_v1_clients__id__policies_put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdatePoliciesRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Client"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/clients/{id}/public-key": {"put": {"summary": "Update Client Public Key", "description": "Update client public key.\n\nUpdating the public key will invalidate the current secrets, so these well\nbe resolved first, and re-encrypted using the new key.", "operationId": "update_client_public_key_api_v1_clients__id__public_key_put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Client identifier", "description": "Identifier of path, may include the prefix 'id:' or 'name:'", "examples": ["name:myclient", "id:8eab15a4-a8eb-4d1b-b47f-2283b9f6f6b0"]}, "description": "Identifier of path, may include the prefix 'id:' or 'name:'"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateKeyModel"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateKeyResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/": {"get": {"summary": "Get Secret Names", "description": "Get Secret Names.", "operationId": "get_secret_names_api_v1_secrets__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/SecretListView"}, "type": "array", "title": "Response Get Secret Names Api V1 Secrets Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}, "post": {"summary": "Add Secret", "description": "Create a secret.", "operationId": "add_secret_api_v1_secrets__post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretCreate"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/api/v1/secrets/{name}": {"get": {"summary": "Get Secret", "description": "Get a secret.", "operationId": "get_secret_api_v1_secrets__name__get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string", "title": "Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretView"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"summary": "Update Secret", "operationId": "update_secret_api_v1_secrets__name__put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string", "title": "Name"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretUpdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"summary": "Delete Secret", "description": "Delete secret.", "operationId": "delete_secret_api_v1_secrets__name__delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "name", "in": "path", "required": true, "schema": {"type": "string", "title": "Name"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/groups/": {"get": {"summary": "Get Secret Groups", "description": "Get secret groups.", "operationId": "get_secret_groups_api_v1_secrets_groups__get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "filter_regex", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Filter Regex"}}, {"name": "flat", "in": "query", "required": false, "schema": {"type": "boolean", "default": false, "title": "Flat"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientSecretGroupList"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"summary": "Add Secret Group", "description": "Create a secret grouping.", "operationId": "add_secret_group_api_v1_secrets_groups__post", "security": [{"OAuth2PasswordBearer": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretGroupCreate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientSecretGroup"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/groups/{group_path}/": {"get": {"summary": "Get Secret Group", "description": "Get a specific secret group.", "operationId": "get_secret_group_api_v1_secrets_groups__group_path___get", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_path", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Path"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientSecretGroup"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "put": {"summary": "Update Secret Group", "description": "Update a secret group.", "operationId": "update_secret_group_api_v1_secrets_groups__group_path___put", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_path", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Path"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretGroupUdate"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientSecretGroup"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "delete": {"summary": "Delete Secret Group", "description": "Remove a group.\n\nEntries within the group will be moved to the root.\nThis also includes nested entries further down from the group.", "operationId": "delete_secret_group_api_v1_secrets_groups__group_path___delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_path", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Path"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/group/{id}": {"delete": {"summary": "Delete Group Id", "description": "Remove a group by ID.", "operationId": "delete_group_id_api_v1_secrets_group__id__delete", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "title": "Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/v1/secrets/set-group": {"post": {"summary": "Assign Secret Group", "description": "Assign a secret to a group or root.", "operationId": "assign_secret_group_api_v1_secrets_set_group_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SecretGroupAssign"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/api/v1/secrets/move-group/{group_name}": {"post": {"summary": "Move Group", "description": "Move a group.", "operationId": "move_group_api_v1_secrets_move_group__group_name__post", "security": [{"OAuth2PasswordBearer": []}], "parameters": [{"name": "group_name", "in": "path", "required": true, "schema": {"type": "string", "title": "Group Name"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/GroupPath"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"AuditListResult": {"properties": {"results": {"items": {"$ref": "#/components/schemas/AuditLog"}, "type": "array", "title": "Results"}, "total": {"type": "integer", "title": "Total"}, "remaining": {"type": "integer", "title": "Remaining"}}, "type": "object", "required": ["results", "total", "remaining"], "title": "AuditListResult", "description": "Class to return when listing audit entries."}, "AuditLog": {"properties": {"id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Id"}, "subsystem": {"$ref": "#/components/schemas/SubSystem"}, "operation": {"$ref": "#/components/schemas/Operation"}, "client_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Client Id"}, "client_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Client Name"}, "secret_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Secret Id"}, "secret_name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Secret Name"}, "data": {"anyOf": [{"additionalProperties": {"type": "string"}, "type": "object"}, {"type": "null"}], "title": "Data"}, "message": {"type": "string", "title": "Message"}, "origin": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Origin"}, "timestamp": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Timestamp"}}, "type": "object", "required": ["subsystem", "operation", "message"], "title": "AuditLog", "description": "Implementation of the backend class AuditView."}, "AutoGenerateOpts": {"properties": {"auto_generate": {"type": "boolean", "const": true, "title": "Auto Generate"}, "length": {"type": "integer", "title": "Length", "default": 32}}, "type": "object", "required": ["auto_generate"], "title": "AutoGenerateOpts", "description": "Option to auto-generate a password."}, "Body_login_for_access_token_api_v1_token_post": {"properties": {"grant_type": {"anyOf": [{"type": "string", "pattern": "^password$"}, {"type": "null"}], "title": "Grant Type"}, "username": {"type": "string", "title": "Username"}, "password": {"type": "string", "format": "password", "title": "Password"}, "scope": {"type": "string", "title": "Scope", "default": ""}, "client_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Client Id"}, "client_secret": {"anyOf": [{"type": "string"}, {"type": "null"}], "format": "password", "title": "Client Secret"}}, "type": "object", "required": ["username", "password"], "title": "Body_login_for_access_token_api_v1_token_post"}, "Client": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "name": {"type": "string", "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "public_key": {"type": "string", "title": "Public Key"}, "version": {"type": "integer", "title": "Version"}, "is_active": {"type": "boolean", "title": "Is Active"}, "is_deleted": {"type": "boolean", "title": "Is Deleted"}, "secrets": {"items": {"type": "string"}, "type": "array", "title": "Secrets"}, "policies": {"items": {"anyOf": [{"type": "string", "format": "ipvanynetwork"}, {"type": "string", "format": "ipvanyaddress"}]}, "type": "array", "title": "Policies"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "updated_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Updated At"}, "deleted_at": {"anyOf": [{"type": "string", "format": "date-time"}, {"type": "null"}], "title": "Deleted At"}}, "type": "object", "required": ["id", "name", "description", "public_key", "version", "is_active", "is_deleted", "secrets", "policies", "created_at", "updated_at", "deleted_at"], "title": "Client", "description": "Implementation of the backend class ClientView."}, "ClientCreate": {"properties": {"name": {"type": "string", "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "public_key": {"type": "string", "title": "Public Key"}, "sources": {"items": {"anyOf": [{"type": "string", "format": "ipvanyaddress"}, {"type": "string", "format": "ipvanynetwork"}]}, "type": "array", "title": "Sources"}}, "type": "object", "required": ["name", "public_key"], "title": "ClientCreate", "description": "Model to create a client."}, "ClientQueryResult": {"properties": {"clients": {"items": {"$ref": "#/components/schemas/Client"}, "type": "array", "title": "Clients"}, "total_results": {"type": "integer", "title": "Total Results"}, "remaining_results": {"type": "integer", "title": "Remaining Results"}}, "type": "object", "required": ["clients", "total_results", "remaining_results"], "title": "ClientQueryResult", "description": "Implementation of the backend ClientQueryResult class."}, "ClientReference": {"properties": {"id": {"type": "string", "title": "Id"}, "name": {"type": "string", "title": "Name"}}, "type": "object", "required": ["id", "name"], "title": "ClientReference", "description": "Implementation of the backend class ClientReference."}, "ClientSecretGroup": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "group_name": {"type": "string", "title": "Group Name"}, "path": {"type": "string", "title": "Path"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "parent_group": {"anyOf": [{"$ref": "#/components/schemas/GroupReference"}, {"type": "null"}]}, "children": {"items": {"$ref": "#/components/schemas/ClientSecretGroup"}, "type": "array", "title": "Children"}, "entries": {"items": {"$ref": "#/components/schemas/SecretClientMapping"}, "type": "array", "title": "Entries"}}, "type": "object", "required": ["id", "group_name", "path"], "title": "ClientSecretGroup", "description": "Client secrets grouped."}, "ClientSecretGroupList": {"properties": {"ungrouped": {"items": {"$ref": "#/components/schemas/SecretClientMapping"}, "type": "array", "title": "Ungrouped"}, "groups": {"items": {"$ref": "#/components/schemas/ClientSecretGroup"}, "type": "array", "title": "Groups"}}, "type": "object", "title": "ClientSecretGroupList", "description": "Secret group list."}, "GroupPath": {"properties": {"path": {"type": "string", "pattern": "^/.*", "title": "Path"}}, "type": "object", "required": ["path"], "title": "GroupPath", "description": "Path to a group."}, "GroupReference": {"properties": {"group_name": {"type": "string", "title": "Group Name"}, "path": {"type": "string", "title": "Path"}}, "type": "object", "required": ["group_name", "path"], "title": "GroupReference", "description": "Reference to a group.\n\nThis will be used for references to parent groups to avoid circular\nreferences."}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "Operation": {"type": "string", "enum": ["create", "read", "update", "delete", "deny", "permit", "login", "none"], "title": "Operation", "description": "Various operations for the audit logging module."}, "RefreshTokenForm": {"properties": {"grant_type": {"type": "string", "const": "refresh_token", "title": "Grant Type"}, "refresh_token": {"type": "string", "title": "Refresh Token"}}, "type": "object", "required": ["grant_type", "refresh_token"], "title": "RefreshTokenForm", "description": "The refresh token form data."}, "SecretClientMapping": {"properties": {"name": {"type": "string", "title": "Name"}, "unmanaged": {"type": "boolean", "title": "Unmanaged", "default": false}, "clients": {"items": {"$ref": "#/components/schemas/ClientReference"}, "type": "array", "title": "Clients"}}, "type": "object", "required": ["name"], "title": "SecretClientMapping", "description": "Secret name with list of clients."}, "SecretCreate": {"properties": {"value": {"anyOf": [{"type": "string"}, {"$ref": "#/components/schemas/AutoGenerateOpts"}], "title": "Value", "description": "Secret as string value or auto-generated with optional length", "examples": ["MySecretString", {"auto_generate": true, "length": 32}]}, "name": {"type": "string", "title": "Name"}, "clients": {"anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], "title": "Clients", "description": "Assign the secret to a list of clients."}, "client_distinguisher": {"type": "string", "enum": ["id", "name"], "title": "Client Distinguisher", "default": "name"}, "group": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Group"}}, "type": "object", "required": ["value", "name"], "title": "SecretCreate", "description": "Model to create a secret.", "examples": [{"clients": ["client-1", "client-2"], "name": "MySecret", "value": {"auto_generate": true, "length": 32}}, {"group": "MySecretGroup", "name": "MySecret", "value": "mysecretstring"}]}, "SecretGroupAssign": {"properties": {"secret_name": {"type": "string", "title": "Secret Name"}, "group_path": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Group Path"}}, "type": "object", "required": ["secret_name", "group_path"], "title": "SecretGroupAssign", "description": "Model for assigning secrets to a group.\n\nIf group is None, then it will be placed in the root."}, "SecretGroupCreate": {"properties": {"name": {"type": "string", "minLength": 1, "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "parent_group": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Group"}}, "type": "object", "required": ["name"], "title": "SecretGroupCreate", "description": "Create model for creating secret groups."}, "SecretGroupUdate": {"properties": {"name": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}, "parent_group": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Group"}}, "type": "object", "title": "SecretGroupUdate", "description": "Update model for updating secret groups."}, "SecretListView": {"properties": {"name": {"type": "string", "title": "Name"}, "unmanaged": {"type": "boolean", "title": "Unmanaged", "default": false}, "clients": {"items": {"type": "string"}, "type": "array", "title": "Clients"}}, "type": "object", "required": ["name"], "title": "SecretListView", "description": "Model containing a list of all available secrets."}, "SecretUpdate": {"properties": {"value": {"anyOf": [{"type": "string"}, {"$ref": "#/components/schemas/AutoGenerateOpts"}], "title": "Value", "description": "Secret as string value or auto-generated with optional length", "examples": ["MySecretString", {"auto_generate": true, "length": 32}]}}, "type": "object", "required": ["value"], "title": "SecretUpdate", "description": "Model to update a secret."}, "SecretView": {"properties": {"name": {"type": "string", "title": "Name"}, "secret": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Secret"}, "group": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Group"}, "clients": {"items": {"$ref": "#/components/schemas/ClientReference"}, "type": "array", "title": "Clients"}}, "type": "object", "required": ["name", "secret"], "title": "SecretView", "description": "Model containing a secret, including its clear-text value."}, "SubSystem": {"type": "string", "enum": ["admin", "sshd", "backend"], "title": "SubSystem", "description": "Available subsystems."}, "Token": {"properties": {"access_token": {"type": "string", "title": "Access Token"}, "refresh_token": {"type": "string", "title": "Refresh Token"}, "token_type": {"type": "string", "title": "Token Type"}}, "type": "object", "required": ["access_token", "refresh_token", "token_type"], "title": "Token"}, "UpdateKeyModel": {"properties": {"public_key": {"type": "string", "title": "Public Key"}}, "type": "object", "required": ["public_key"], "title": "UpdateKeyModel", "description": "Model for updating client public key."}, "UpdateKeyResponse": {"properties": {"public_key": {"type": "string", "title": "Public Key"}, "updated_secrets": {"items": {"type": "string"}, "type": "array", "title": "Updated Secrets"}, "detail": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Detail"}}, "type": "object", "required": ["public_key"], "title": "UpdateKeyResponse", "description": "Response model after updating the public key."}, "UpdatePoliciesRequest": {"properties": {"sources": {"items": {"anyOf": [{"type": "string", "format": "ipvanyaddress"}, {"type": "string", "format": "ipvanynetwork"}]}, "type": "array", "title": "Sources"}}, "type": "object", "required": ["sources"], "title": "UpdatePoliciesRequest", "description": "Update policy request."}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}, "securitySchemes": {"OAuth2PasswordBearer": {"type": "oauth2", "flows": {"password": {"refreshUrl": "/api/v1/refresh", "scopes": {}, "tokenUrl": "/api/v1/token"}}}}}} \ No newline at end of file diff --git a/packages/sshecret-frontend/package-lock.json b/packages/sshecret-frontend/package-lock.json index 847b99b..40c441a 100644 --- a/packages/sshecret-frontend/package-lock.json +++ b/packages/sshecret-frontend/package-lock.json @@ -11,7 +11,10 @@ "@shoelace-style/shoelace": "^2.20.1", "@shoelace-style/vue-sl-model": "^1.0.1", "@tailwindcss/vite": "^4.1.11", + "@tiaohsun/vue-datatable-tailwind": "^2.2.0", "axios": "^1.10.0", + "datatables.net-dt": "^2.3.2", + "datatables.net-vue3": "^3.0.4", "flowbite": "^3.1.2", "flowbite-vue": "^0.2.1", "is-cidr": "^5.1.1", @@ -2280,6 +2283,16 @@ "vite": "^5.2.0 || ^6 || ^7" } }, + "node_modules/@tiaohsun/vue-datatable-tailwind": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@tiaohsun/vue-datatable-tailwind/-/vue-datatable-tailwind-2.2.0.tgz", + "integrity": "sha512-9LZ1uUZ5goJCAj/8Ba2sbrkEdth/PWsWrYE5AWFD2uk8+Y+ljKTQPC8q3OKTWdJu+4pYBvtuCmqWv1Py1SlhqA==", + "license": "MIT", + "peerDependencies": { + "tailwindcss": "^4.1.0", + "vue": "^3.4.0" + } + }, "node_modules/@tsconfig/node22": { "version": "22.0.2", "resolved": "https://registry.npmjs.org/@tsconfig/node22/-/node22-22.0.2.tgz", @@ -3953,6 +3966,37 @@ "node": ">=18" } }, + "node_modules/datatables.net": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-2.3.2.tgz", + "integrity": "sha512-31TzwIQM0+pr2ZOEOEH6dsHd/WSAl5GDDGPezOHPI3mM2NK4lcDyOoG8xXeWmSbVfbi852LNK5C84fpp4Q+qxg==", + "license": "MIT", + "dependencies": { + "jquery": ">=1.7" + } + }, + "node_modules/datatables.net-dt": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/datatables.net-dt/-/datatables.net-dt-2.3.2.tgz", + "integrity": "sha512-2heAMe0AVqJ8nt9wE35ArLtL1zP7N7qnhM3u52bLcJfi4NStxyBsHScVggTHVQPj7r9O+qirAxox1Xcr+Bm4Dw==", + "license": "MIT", + "dependencies": { + "datatables.net": "2.3.2", + "jquery": ">=1.7" + } + }, + "node_modules/datatables.net-vue3": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/datatables.net-vue3/-/datatables.net-vue3-3.0.4.tgz", + "integrity": "sha512-m7b7+zdH07d6J+Dz97KNs2PMezxZk+RgB4Or9i0J/SAXA/kaBRpQLTpr9Pyg8fh66/r4FQxnIkHhPTbW78Ep5A==", + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "datatables.net": "^2", + "vue": "^3.0.5" + } + }, "node_modules/de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", @@ -5747,6 +5791,12 @@ "jiti": "lib/jiti-cli.mjs" } }, + "node_modules/jquery": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + "license": "MIT" + }, "node_modules/js-beautify": { "version": "1.15.4", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.15.4.tgz", diff --git a/packages/sshecret-frontend/package.json b/packages/sshecret-frontend/package.json index c24a45f..cd33991 100644 --- a/packages/sshecret-frontend/package.json +++ b/packages/sshecret-frontend/package.json @@ -18,7 +18,10 @@ "@shoelace-style/shoelace": "^2.20.1", "@shoelace-style/vue-sl-model": "^1.0.1", "@tailwindcss/vite": "^4.1.11", + "@tiaohsun/vue-datatable-tailwind": "^2.2.0", "axios": "^1.10.0", + "datatables.net-dt": "^2.3.2", + "datatables.net-vue3": "^3.0.4", "flowbite": "^3.1.2", "flowbite-vue": "^0.2.1", "is-cidr": "^5.1.1", diff --git a/packages/sshecret-frontend/src/App.vue b/packages/sshecret-frontend/src/App.vue index e234503..f87236f 100644 --- a/packages/sshecret-frontend/src/App.vue +++ b/packages/sshecret-frontend/src/App.vue @@ -1,8 +1,21 @@ diff --git a/packages/sshecret-frontend/src/api/password.ts b/packages/sshecret-frontend/src/api/password.ts new file mode 100644 index 0000000..09e45c8 --- /dev/null +++ b/packages/sshecret-frontend/src/api/password.ts @@ -0,0 +1,16 @@ +export function generateRandomPassword(length: number = 16): string { + const lower = 'abcdefghijklmnopqrstuvwxyz' + const upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + const numbers = '0123456789' + const special = '!@#$%^&*()-_=+[]{};:,.<>?' + + const allChars = lower + upper + numbers + special + + let password = '' + for (let i = 0; i < length; i++) { + const index = Math.floor(Math.random() * allChars.length) + password += allChars[index] + } + + return password +} diff --git a/packages/sshecret-frontend/src/api/typeguards.ts b/packages/sshecret-frontend/src/api/typeguards.ts new file mode 100644 index 0000000..b69483e --- /dev/null +++ b/packages/sshecret-frontend/src/api/typeguards.ts @@ -0,0 +1,13 @@ +// Typeguards + +import { OPERATIONS } from '@/api/types' +import { SUBSYSTEM } from '@/api/types' +import type { Operation, SubSystem } from '@/client' + +export function isOperation(value: string): value is Operation { + return (OPERATIONS as readonly string[]).includes(value) +} + +export function isSubSystem(value: string): value is SubSystem { + return (SUBSYSTEM as readonly string[]).includes(value) +} diff --git a/packages/sshecret-frontend/src/api/types.ts b/packages/sshecret-frontend/src/api/types.ts index e7ab12c..0715ceb 100644 --- a/packages/sshecret-frontend/src/api/types.ts +++ b/packages/sshecret-frontend/src/api/types.ts @@ -1,3 +1,4 @@ +import type { SubSystem, Operation } from "@/client"; export type PageRequest = { offset: number; limit: number; @@ -6,9 +7,67 @@ export type PageRequest = { export enum SshecretObjectType { Client = "Client", ClientSecret = "ClientSecret", + SecretGroup = "SecretGroup", } export type SshecretObject = { objectType: SshecretObjectType, id: string, + param?: string, } + +export type AuditFilter = { + /** + * Subsystem + */ + subsystem?: SubSystem | null; + /** + * Operation + */ + operation?: Operation | null; + /** + * Client Id + */ + client_id?: string | null; + /** + * Client Name + */ + client_name?: string | null; + /** + * Secret Id + */ + secret_id?: string | null; + /** + * Secret Name + */ + secret_name?: string | null; + /** + * Origin + */ + origin?: string | null; + /** + */ + offset?: number; + /** + * Limit + */ + limit?: number; + +} + +export const OPERATIONS = [ + 'create', + 'read', + 'update', + 'delete', + 'deny', + 'permit', + 'login', + 'none', +] as const + +export const SUBSYSTEM = [ + 'admin', + 'sshd', + 'backend', +] as const diff --git a/packages/sshecret-frontend/src/assets/custom.css b/packages/sshecret-frontend/src/assets/custom.css new file mode 100644 index 0000000..0418a6e --- /dev/null +++ b/packages/sshecret-frontend/src/assets/custom.css @@ -0,0 +1,55 @@ +sl-input, +sl-select, +sl-checkbox { + display: block; + margin-bottom: var(--sl-spacing-medium); +} + +/* user invalid styles */ +sl-input[data-user-invalid]::part(base), +sl-select[data-user-invalid]::part(combobox), +sl-checkbox[data-user-invalid]::part(control) { + border-color: var(--sl-color-danger-600); +} + +[data-user-invalid]::part(form-control-label), +[data-user-invalid]::part(form-control-help-text), +sl-checkbox[data-user-invalid]::part(label) { + color: var(--sl-color-danger-700); +} + +sl-checkbox[data-user-invalid]::part(control) { + outline: none; +} + +sl-input:focus-within[data-user-invalid]::part(base), +sl-select:focus-within[data-user-invalid]::part(combobox), +sl-checkbox:focus-within[data-user-invalid]::part(control) { + border-color: var(--sl-color-danger-600); + box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-color-danger-300); +} + +/* User valid styles */ +sl-input[data-user-valid]::part(base), +sl-select[data-user-valid]::part(combobox), +sl-checkbox[data-user-valid]::part(control) { + border-color: var(--sl-color-success-600); +} + +[data-user-valid]::part(form-control-label), +[data-user-valid]::part(form-control-help-text), +sl-checkbox[data-user-valid]::part(label) { + color: var(--sl-color-success-700); +} + +sl-checkbox[data-user-valid]::part(control) { + background-color: var(--sl-color-success-600); + outline: none; +} + +sl-input:focus-within[data-user-valid]::part(base), +sl-select:focus-within[data-user-valid]::part(combobox), +sl-checkbox:focus-within[data-user-valid]::part(control) { + border-color: var(--sl-color-success-600); + box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-color-success-300); +} diff --git a/packages/sshecret-frontend/src/assets/main.css b/packages/sshecret-frontend/src/assets/main.css index a152199..49337b4 100644 --- a/packages/sshecret-frontend/src/assets/main.css +++ b/packages/sshecret-frontend/src/assets/main.css @@ -1 +1,2 @@ @import './base.css'; +@import './custom.css' diff --git a/packages/sshecret-frontend/src/client/sdk.gen.ts b/packages/sshecret-frontend/src/client/sdk.gen.ts index 3c1bdd0..02e3b73 100644 --- a/packages/sshecret-frontend/src/client/sdk.gen.ts +++ b/packages/sshecret-frontend/src/client/sdk.gen.ts @@ -1,7 +1,7 @@ // This file is auto-generated by @hey-api/openapi-ts import { type Options as ClientOptions, type TDataShape, type Client, urlSearchParamsBodySerializer } from './client'; -import type { GetHealthHealthGetData, GetHealthHealthGetResponses, LoginForAccessTokenApiV1TokenPostData, LoginForAccessTokenApiV1TokenPostResponses, LoginForAccessTokenApiV1TokenPostErrors, RefreshTokenApiV1RefreshPostData, RefreshTokenApiV1RefreshPostResponses, RefreshTokenApiV1RefreshPostErrors, GetClientsApiV1ClientsGetData, GetClientsApiV1ClientsGetResponses, CreateClientApiV1ClientsPostData, CreateClientApiV1ClientsPostResponses, CreateClientApiV1ClientsPostErrors, GetClientsTerseApiV1ClientsTerseGetData, GetClientsTerseApiV1ClientsTerseGetResponses, QueryClientsApiV1QueryClientsGetData, QueryClientsApiV1QueryClientsGetResponses, QueryClientsApiV1QueryClientsGetErrors, DeleteClientApiV1ClientsIdDeleteData, DeleteClientApiV1ClientsIdDeleteResponses, DeleteClientApiV1ClientsIdDeleteErrors, GetClientApiV1ClientsIdGetData, GetClientApiV1ClientsIdGetResponses, GetClientApiV1ClientsIdGetErrors, UpdateClientApiV1ClientsIdPutData, UpdateClientApiV1ClientsIdPutResponses, UpdateClientApiV1ClientsIdPutErrors, DeleteSecretFromClientApiV1ClientsIdSecretsSecretNameDeleteData, DeleteSecretFromClientApiV1ClientsIdSecretsSecretNameDeleteResponses, DeleteSecretFromClientApiV1ClientsIdSecretsSecretNameDeleteErrors, AddSecretToClientApiV1ClientsIdSecretsSecretNamePutData, AddSecretToClientApiV1ClientsIdSecretsSecretNamePutResponses, AddSecretToClientApiV1ClientsIdSecretsSecretNamePutErrors, UpdateClientPoliciesApiV1ClientsIdPoliciesPutData, UpdateClientPoliciesApiV1ClientsIdPoliciesPutResponses, UpdateClientPoliciesApiV1ClientsIdPoliciesPutErrors, UpdateClientPublicKeyApiV1ClientsIdPublicKeyPutData, UpdateClientPublicKeyApiV1ClientsIdPublicKeyPutResponses, UpdateClientPublicKeyApiV1ClientsIdPublicKeyPutErrors, GetSecretNamesApiV1SecretsGetData, GetSecretNamesApiV1SecretsGetResponses, AddSecretApiV1SecretsPostData, AddSecretApiV1SecretsPostResponses, AddSecretApiV1SecretsPostErrors, DeleteSecretApiV1SecretsNameDeleteData, DeleteSecretApiV1SecretsNameDeleteResponses, DeleteSecretApiV1SecretsNameDeleteErrors, GetSecretApiV1SecretsNameGetData, GetSecretApiV1SecretsNameGetResponses, GetSecretApiV1SecretsNameGetErrors, UpdateSecretApiV1SecretsNamePutData, UpdateSecretApiV1SecretsNamePutResponses, UpdateSecretApiV1SecretsNamePutErrors, GetSecretGroupsApiV1SecretsGroupsGetData, GetSecretGroupsApiV1SecretsGroupsGetResponses, GetSecretGroupsApiV1SecretsGroupsGetErrors, AddSecretGroupApiV1SecretsGroupsPostData, AddSecretGroupApiV1SecretsGroupsPostResponses, AddSecretGroupApiV1SecretsGroupsPostErrors, DeleteSecretGroupApiV1SecretsGroupsGroupNameDeleteData, DeleteSecretGroupApiV1SecretsGroupsGroupNameDeleteResponses, DeleteSecretGroupApiV1SecretsGroupsGroupNameDeleteErrors, GetSecretGroupApiV1SecretsGroupsGroupNameGetData, GetSecretGroupApiV1SecretsGroupsGroupNameGetResponses, GetSecretGroupApiV1SecretsGroupsGroupNameGetErrors, RemoveSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDeleteData, RemoveSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDeleteResponses, RemoveSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDeleteErrors, MoveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePostData, MoveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePostResponses, MoveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePostErrors, MoveGroupApiV1SecretsGroupGroupNameParentParentNamePostData, MoveGroupApiV1SecretsGroupGroupNameParentParentNamePostResponses, MoveGroupApiV1SecretsGroupGroupNameParentParentNamePostErrors, MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteData, MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteResponses, MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteErrors } from './types.gen'; +import type { GetHealthHealthGetData, GetHealthHealthGetResponses, GetAuditLogApiV1AuditGetData, GetAuditLogApiV1AuditGetResponses, GetAuditLogApiV1AuditGetErrors, LoginForAccessTokenApiV1TokenPostData, LoginForAccessTokenApiV1TokenPostResponses, LoginForAccessTokenApiV1TokenPostErrors, RefreshTokenApiV1RefreshPostData, RefreshTokenApiV1RefreshPostResponses, RefreshTokenApiV1RefreshPostErrors, GetClientsApiV1ClientsGetData, GetClientsApiV1ClientsGetResponses, CreateClientApiV1ClientsPostData, CreateClientApiV1ClientsPostResponses, CreateClientApiV1ClientsPostErrors, GetClientsTerseApiV1ClientsTerseGetData, GetClientsTerseApiV1ClientsTerseGetResponses, QueryClientsApiV1QueryClientsGetData, QueryClientsApiV1QueryClientsGetResponses, QueryClientsApiV1QueryClientsGetErrors, DeleteClientApiV1ClientsIdDeleteData, DeleteClientApiV1ClientsIdDeleteResponses, DeleteClientApiV1ClientsIdDeleteErrors, GetClientApiV1ClientsIdGetData, GetClientApiV1ClientsIdGetResponses, GetClientApiV1ClientsIdGetErrors, UpdateClientApiV1ClientsIdPutData, UpdateClientApiV1ClientsIdPutResponses, UpdateClientApiV1ClientsIdPutErrors, DeleteSecretFromClientApiV1ClientsIdSecretsSecretNameDeleteData, DeleteSecretFromClientApiV1ClientsIdSecretsSecretNameDeleteResponses, DeleteSecretFromClientApiV1ClientsIdSecretsSecretNameDeleteErrors, AddSecretToClientApiV1ClientsIdSecretsSecretNamePutData, AddSecretToClientApiV1ClientsIdSecretsSecretNamePutResponses, AddSecretToClientApiV1ClientsIdSecretsSecretNamePutErrors, UpdateClientPoliciesApiV1ClientsIdPoliciesPutData, UpdateClientPoliciesApiV1ClientsIdPoliciesPutResponses, UpdateClientPoliciesApiV1ClientsIdPoliciesPutErrors, UpdateClientPublicKeyApiV1ClientsIdPublicKeyPutData, UpdateClientPublicKeyApiV1ClientsIdPublicKeyPutResponses, UpdateClientPublicKeyApiV1ClientsIdPublicKeyPutErrors, GetSecretNamesApiV1SecretsGetData, GetSecretNamesApiV1SecretsGetResponses, AddSecretApiV1SecretsPostData, AddSecretApiV1SecretsPostResponses, AddSecretApiV1SecretsPostErrors, DeleteSecretApiV1SecretsNameDeleteData, DeleteSecretApiV1SecretsNameDeleteResponses, DeleteSecretApiV1SecretsNameDeleteErrors, GetSecretApiV1SecretsNameGetData, GetSecretApiV1SecretsNameGetResponses, GetSecretApiV1SecretsNameGetErrors, UpdateSecretApiV1SecretsNamePutData, UpdateSecretApiV1SecretsNamePutResponses, UpdateSecretApiV1SecretsNamePutErrors, GetSecretGroupsApiV1SecretsGroupsGetData, GetSecretGroupsApiV1SecretsGroupsGetResponses, GetSecretGroupsApiV1SecretsGroupsGetErrors, AddSecretGroupApiV1SecretsGroupsPostData, AddSecretGroupApiV1SecretsGroupsPostResponses, AddSecretGroupApiV1SecretsGroupsPostErrors, DeleteSecretGroupApiV1SecretsGroupsGroupPathDeleteData, DeleteSecretGroupApiV1SecretsGroupsGroupPathDeleteResponses, DeleteSecretGroupApiV1SecretsGroupsGroupPathDeleteErrors, GetSecretGroupApiV1SecretsGroupsGroupPathGetData, GetSecretGroupApiV1SecretsGroupsGroupPathGetResponses, GetSecretGroupApiV1SecretsGroupsGroupPathGetErrors, UpdateSecretGroupApiV1SecretsGroupsGroupPathPutData, UpdateSecretGroupApiV1SecretsGroupsGroupPathPutResponses, UpdateSecretGroupApiV1SecretsGroupsGroupPathPutErrors, DeleteGroupIdApiV1SecretsGroupIdDeleteData, DeleteGroupIdApiV1SecretsGroupIdDeleteResponses, DeleteGroupIdApiV1SecretsGroupIdDeleteErrors, AssignSecretGroupApiV1SecretsSetGroupPostData, AssignSecretGroupApiV1SecretsSetGroupPostResponses, AssignSecretGroupApiV1SecretsSetGroupPostErrors, MoveGroupApiV1SecretsMoveGroupGroupNamePostData, MoveGroupApiV1SecretsMoveGroupGroupNamePostResponses, MoveGroupApiV1SecretsMoveGroupGroupNamePostErrors } from './types.gen'; import { client as _heyApiClient } from './client.gen'; export type Options = ClientOptions & { @@ -31,6 +31,24 @@ export class SshecretAdmin { }); } + /** + * Get Audit Log + * Query audit log. + */ + public static getAuditLogApiV1AuditGet(options?: Options) { + return (options?.client ?? _heyApiClient).get({ + responseType: 'json', + security: [ + { + scheme: 'bearer', + type: 'http' + } + ], + url: '/api/v1/audit/', + ...options + }); + } + /** * Login For Access Token * Login user and generate token. @@ -426,8 +444,8 @@ export class SshecretAdmin { * Entries within the group will be moved to the root. * This also includes nested entries further down from the group. */ - public static deleteSecretGroupApiV1SecretsGroupsGroupNameDelete(options: Options) { - return (options.client ?? _heyApiClient).delete({ + public static deleteSecretGroupApiV1SecretsGroupsGroupPathDelete(options: Options) { + return (options.client ?? _heyApiClient).delete({ responseType: 'json', security: [ { @@ -435,7 +453,7 @@ export class SshecretAdmin { type: 'http' } ], - url: '/api/v1/secrets/groups/{group_name}/', + url: '/api/v1/secrets/groups/{group_path}/', ...options }); } @@ -444,8 +462,8 @@ export class SshecretAdmin { * Get Secret Group * Get a specific secret group. */ - public static getSecretGroupApiV1SecretsGroupsGroupNameGet(options: Options) { - return (options.client ?? _heyApiClient).get({ + public static getSecretGroupApiV1SecretsGroupsGroupPathGet(options: Options) { + return (options.client ?? _heyApiClient).get({ responseType: 'json', security: [ { @@ -453,19 +471,17 @@ export class SshecretAdmin { type: 'http' } ], - url: '/api/v1/secrets/groups/{group_name}/', + url: '/api/v1/secrets/groups/{group_path}/', ...options }); } /** - * Remove Secret From Group - * Remove a secret from a group. - * - * Secret will be moved to the root group. + * Update Secret Group + * Update a secret group. */ - public static removeSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDelete(options: Options) { - return (options.client ?? _heyApiClient).delete({ + public static updateSecretGroupApiV1SecretsGroupsGroupPathPut(options: Options) { + return (options.client ?? _heyApiClient).put({ responseType: 'json', security: [ { @@ -473,17 +489,39 @@ export class SshecretAdmin { type: 'http' } ], - url: '/api/v1/secrets/groups/{group_name}/{secret_name}', + url: '/api/v1/secrets/groups/{group_path}/', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } + }); + } + + /** + * Delete Group Id + * Remove a group by ID. + */ + public static deleteGroupIdApiV1SecretsGroupIdDelete(options: Options) { + return (options.client ?? _heyApiClient).delete({ + responseType: 'json', + security: [ + { + scheme: 'bearer', + type: 'http' + } + ], + url: '/api/v1/secrets/group/{id}', ...options }); } /** - * Move Secret To Group - * Move a secret to a group. + * Assign Secret Group + * Assign a secret to a group or root. */ - public static moveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePost(options: Options) { - return (options.client ?? _heyApiClient).post({ + public static assignSecretGroupApiV1SecretsSetGroupPost(options: Options) { + return (options.client ?? _heyApiClient).post({ responseType: 'json', security: [ { @@ -491,8 +529,12 @@ export class SshecretAdmin { type: 'http' } ], - url: '/api/v1/secrets/groups/{group_name}/{secret_name}', - ...options + url: '/api/v1/secrets/set-group', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } }); } @@ -500,8 +542,8 @@ export class SshecretAdmin { * Move Group * Move a group. */ - public static moveGroupApiV1SecretsGroupGroupNameParentParentNamePost(options: Options) { - return (options.client ?? _heyApiClient).post({ + public static moveGroupApiV1SecretsMoveGroupGroupNamePost(options: Options) { + return (options.client ?? _heyApiClient).post({ responseType: 'json', security: [ { @@ -509,26 +551,12 @@ export class SshecretAdmin { type: 'http' } ], - url: '/api/v1/secrets/group/{group_name}/parent/{parent_name}', - ...options - }); - } - - /** - * Move Group To Root - * Move a group to the root. - */ - public static moveGroupToRootApiV1SecretsGroupGroupNameParentDelete(options: Options) { - return (options.client ?? _heyApiClient).delete({ - responseType: 'json', - security: [ - { - scheme: 'bearer', - type: 'http' - } - ], - url: '/api/v1/secrets/group/{group_name}/parent/', - ...options + url: '/api/v1/secrets/move-group/{group_name}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers + } }); } } \ No newline at end of file diff --git a/packages/sshecret-frontend/src/client/types.gen.ts b/packages/sshecret-frontend/src/client/types.gen.ts index d557d99..8861ee2 100644 --- a/packages/sshecret-frontend/src/client/types.gen.ts +++ b/packages/sshecret-frontend/src/client/types.gen.ts @@ -1,5 +1,71 @@ // This file is auto-generated by @hey-api/openapi-ts +/** + * AuditListResult + * Class to return when listing audit entries. + */ +export type AuditListResult = { + /** + * Results + */ + results: Array; + /** + * Total + */ + total: number; + /** + * Remaining + */ + remaining: number; +}; + +/** + * AuditLog + * Implementation of the backend class AuditView. + */ +export type AuditLog = { + /** + * Id + */ + id?: string | null; + subsystem: SubSystem; + operation: Operation; + /** + * Client Id + */ + client_id?: string | null; + /** + * Client Name + */ + client_name?: string | null; + /** + * Secret Id + */ + secret_id?: string | null; + /** + * Secret Name + */ + secret_name?: string | null; + /** + * Data + */ + data?: { + [key: string]: string; + } | null; + /** + * Message + */ + message: string; + /** + * Origin + */ + origin?: string | null; + /** + * Timestamp + */ + timestamp?: string | null; +}; + /** * AutoGenerateOpts * Option to auto-generate a password. @@ -162,6 +228,10 @@ export type ClientReference = { * Client secrets grouped. */ export type ClientSecretGroup = { + /** + * Id + */ + id: string; /** * Group Name */ @@ -174,7 +244,7 @@ export type ClientSecretGroup = { * Description */ description?: string | null; - parent_group?: ClientSecretGroup | null; + parent_group?: GroupReference | null; /** * Children */ @@ -200,6 +270,35 @@ export type ClientSecretGroupList = { groups?: Array; }; +/** + * GroupPath + * Path to a group. + */ +export type GroupPath = { + /** + * Path + */ + path: string; +}; + +/** + * GroupReference + * Reference to a group. + * + * This will be used for references to parent groups to avoid circular + * references. + */ +export type GroupReference = { + /** + * Group Name + */ + group_name: string; + /** + * Path + */ + path: string; +}; + /** * HTTPValidationError */ @@ -210,6 +309,12 @@ export type HttpValidationError = { detail?: Array; }; +/** + * Operation + * Various operations for the audit logging module. + */ +export type Operation = 'create' | 'read' | 'update' | 'delete' | 'deny' | 'permit' | 'login' | 'none'; + /** * RefreshTokenForm * The refresh token form data. @@ -263,12 +368,33 @@ export type SecretCreate = { * Assign the secret to a list of clients. */ clients?: Array | null; + /** + * Client Distinguisher + */ + client_distinguisher?: 'id' | 'name'; /** * Group */ group?: string | null; }; +/** + * SecretGroupAssign + * Model for assigning secrets to a group. + * + * If group is None, then it will be placed in the root. + */ +export type SecretGroupAssign = { + /** + * Secret Name + */ + secret_name: string; + /** + * Group Path + */ + group_path: string | null; +}; + /** * SecretGroupCreate * Create model for creating secret groups. @@ -288,6 +414,25 @@ export type SecretGroupCreate = { parent_group?: string | null; }; +/** + * SecretGroupUdate + * Update model for updating secret groups. + */ +export type SecretGroupUdate = { + /** + * Name + */ + name?: string | null; + /** + * Description + */ + description?: string | null; + /** + * Parent Group + */ + parent_group?: string | null; +}; + /** * SecretListView * Model containing a list of all available secrets. @@ -342,6 +487,12 @@ export type SecretView = { clients?: Array; }; +/** + * SubSystem + * Available subsystems. + */ +export type SubSystem = 'admin' | 'sshd' | 'backend'; + /** * Token */ @@ -433,6 +584,68 @@ export type GetHealthHealthGetResponses = { 200: unknown; }; +export type GetAuditLogApiV1AuditGetData = { + body?: never; + path?: never; + query?: { + /** + * Subsystem + */ + subsystem?: SubSystem | null; + /** + * Operation + */ + operation?: Operation | null; + /** + * Client Id + */ + client_id?: string | null; + /** + * Client Name + */ + client_name?: string | null; + /** + * Secret Id + */ + secret_id?: string | null; + /** + * Secret Name + */ + secret_name?: string | null; + /** + * Origin + */ + origin?: string | null; + /** + * Offset + */ + offset?: number; + /** + * Limit + */ + limit?: number; + }; + url: '/api/v1/audit/'; +}; + +export type GetAuditLogApiV1AuditGetErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetAuditLogApiV1AuditGetError = GetAuditLogApiV1AuditGetErrors[keyof GetAuditLogApiV1AuditGetErrors]; + +export type GetAuditLogApiV1AuditGetResponses = { + /** + * Successful Response + */ + 200: AuditListResult; +}; + +export type GetAuditLogApiV1AuditGetResponse = GetAuditLogApiV1AuditGetResponses[keyof GetAuditLogApiV1AuditGetResponses]; + export type LoginForAccessTokenApiV1TokenPostData = { body: BodyLoginForAccessTokenApiV1TokenPost; path?: never; @@ -604,7 +817,8 @@ export type DeleteClientApiV1ClientsIdDeleteData = { body?: never; path: { /** - * Id + * Client identifier + * Identifier of path, may include the prefix 'id:' or 'name:' */ id: string; }; @@ -632,7 +846,8 @@ export type GetClientApiV1ClientsIdGetData = { body?: never; path: { /** - * Id + * Client identifier + * Identifier of path, may include the prefix 'id:' or 'name:' */ id: string; }; @@ -662,7 +877,8 @@ export type UpdateClientApiV1ClientsIdPutData = { body: ClientCreate; path: { /** - * Id + * Client identifier + * Identifier of path, may include the prefix 'id:' or 'name:' */ id: string; }; @@ -692,7 +908,8 @@ export type DeleteSecretFromClientApiV1ClientsIdSecretsSecretNameDeleteData = { body?: never; path: { /** - * Id + * Client identifier + * Identifier of path, may include the prefix 'id:' or 'name:' */ id: string; /** @@ -724,7 +941,8 @@ export type AddSecretToClientApiV1ClientsIdSecretsSecretNamePutData = { body?: never; path: { /** - * Id + * Client identifier + * Identifier of path, may include the prefix 'id:' or 'name:' */ id: string; /** @@ -786,7 +1004,8 @@ export type UpdateClientPublicKeyApiV1ClientsIdPublicKeyPutData = { body: UpdateKeyModel; path: { /** - * Id + * Client identifier + * Identifier of path, may include the prefix 'id:' or 'name:' */ id: string; }; @@ -946,6 +1165,10 @@ export type GetSecretGroupsApiV1SecretsGroupsGetData = { * Filter Regex */ filter_regex?: string | null; + /** + * Flat + */ + flat?: boolean; }; url: '/api/v1/secrets/groups/'; }; @@ -993,162 +1216,147 @@ export type AddSecretGroupApiV1SecretsGroupsPostResponses = { export type AddSecretGroupApiV1SecretsGroupsPostResponse = AddSecretGroupApiV1SecretsGroupsPostResponses[keyof AddSecretGroupApiV1SecretsGroupsPostResponses]; -export type DeleteSecretGroupApiV1SecretsGroupsGroupNameDeleteData = { +export type DeleteSecretGroupApiV1SecretsGroupsGroupPathDeleteData = { body?: never; path: { /** - * Group Name + * Group Path */ - group_name: string; + group_path: string; }; query?: never; - url: '/api/v1/secrets/groups/{group_name}/'; + url: '/api/v1/secrets/groups/{group_path}/'; }; -export type DeleteSecretGroupApiV1SecretsGroupsGroupNameDeleteErrors = { +export type DeleteSecretGroupApiV1SecretsGroupsGroupPathDeleteErrors = { /** * Validation Error */ 422: HttpValidationError; }; -export type DeleteSecretGroupApiV1SecretsGroupsGroupNameDeleteError = DeleteSecretGroupApiV1SecretsGroupsGroupNameDeleteErrors[keyof DeleteSecretGroupApiV1SecretsGroupsGroupNameDeleteErrors]; +export type DeleteSecretGroupApiV1SecretsGroupsGroupPathDeleteError = DeleteSecretGroupApiV1SecretsGroupsGroupPathDeleteErrors[keyof DeleteSecretGroupApiV1SecretsGroupsGroupPathDeleteErrors]; -export type DeleteSecretGroupApiV1SecretsGroupsGroupNameDeleteResponses = { +export type DeleteSecretGroupApiV1SecretsGroupsGroupPathDeleteResponses = { /** * Successful Response */ 200: unknown; }; -export type GetSecretGroupApiV1SecretsGroupsGroupNameGetData = { +export type GetSecretGroupApiV1SecretsGroupsGroupPathGetData = { body?: never; path: { /** - * Group Name + * Group Path */ - group_name: string; + group_path: string; }; query?: never; - url: '/api/v1/secrets/groups/{group_name}/'; + url: '/api/v1/secrets/groups/{group_path}/'; }; -export type GetSecretGroupApiV1SecretsGroupsGroupNameGetErrors = { +export type GetSecretGroupApiV1SecretsGroupsGroupPathGetErrors = { /** * Validation Error */ 422: HttpValidationError; }; -export type GetSecretGroupApiV1SecretsGroupsGroupNameGetError = GetSecretGroupApiV1SecretsGroupsGroupNameGetErrors[keyof GetSecretGroupApiV1SecretsGroupsGroupNameGetErrors]; +export type GetSecretGroupApiV1SecretsGroupsGroupPathGetError = GetSecretGroupApiV1SecretsGroupsGroupPathGetErrors[keyof GetSecretGroupApiV1SecretsGroupsGroupPathGetErrors]; -export type GetSecretGroupApiV1SecretsGroupsGroupNameGetResponses = { +export type GetSecretGroupApiV1SecretsGroupsGroupPathGetResponses = { /** * Successful Response */ 200: ClientSecretGroup; }; -export type GetSecretGroupApiV1SecretsGroupsGroupNameGetResponse = GetSecretGroupApiV1SecretsGroupsGroupNameGetResponses[keyof GetSecretGroupApiV1SecretsGroupsGroupNameGetResponses]; +export type GetSecretGroupApiV1SecretsGroupsGroupPathGetResponse = GetSecretGroupApiV1SecretsGroupsGroupPathGetResponses[keyof GetSecretGroupApiV1SecretsGroupsGroupPathGetResponses]; -export type RemoveSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDeleteData = { - body?: never; +export type UpdateSecretGroupApiV1SecretsGroupsGroupPathPutData = { + body: SecretGroupUdate; path: { /** - * Group Name + * Group Path */ - group_name: string; - /** - * Secret Name - */ - secret_name: string; + group_path: string; }; query?: never; - url: '/api/v1/secrets/groups/{group_name}/{secret_name}'; + url: '/api/v1/secrets/groups/{group_path}/'; }; -export type RemoveSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDeleteErrors = { +export type UpdateSecretGroupApiV1SecretsGroupsGroupPathPutErrors = { /** * Validation Error */ 422: HttpValidationError; }; -export type RemoveSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDeleteError = RemoveSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDeleteErrors[keyof RemoveSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDeleteErrors]; +export type UpdateSecretGroupApiV1SecretsGroupsGroupPathPutError = UpdateSecretGroupApiV1SecretsGroupsGroupPathPutErrors[keyof UpdateSecretGroupApiV1SecretsGroupsGroupPathPutErrors]; -export type RemoveSecretFromGroupApiV1SecretsGroupsGroupNameSecretNameDeleteResponses = { +export type UpdateSecretGroupApiV1SecretsGroupsGroupPathPutResponses = { + /** + * Successful Response + */ + 200: ClientSecretGroup; +}; + +export type UpdateSecretGroupApiV1SecretsGroupsGroupPathPutResponse = UpdateSecretGroupApiV1SecretsGroupsGroupPathPutResponses[keyof UpdateSecretGroupApiV1SecretsGroupsGroupPathPutResponses]; + +export type DeleteGroupIdApiV1SecretsGroupIdDeleteData = { + body?: never; + path: { + /** + * Id + */ + id: string; + }; + query?: never; + url: '/api/v1/secrets/group/{id}'; +}; + +export type DeleteGroupIdApiV1SecretsGroupIdDeleteErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type DeleteGroupIdApiV1SecretsGroupIdDeleteError = DeleteGroupIdApiV1SecretsGroupIdDeleteErrors[keyof DeleteGroupIdApiV1SecretsGroupIdDeleteErrors]; + +export type DeleteGroupIdApiV1SecretsGroupIdDeleteResponses = { /** * Successful Response */ 200: unknown; }; -export type MoveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePostData = { - body?: never; - path: { - /** - * Group Name - */ - group_name: string; - /** - * Secret Name - */ - secret_name: string; - }; +export type AssignSecretGroupApiV1SecretsSetGroupPostData = { + body: SecretGroupAssign; + path?: never; query?: never; - url: '/api/v1/secrets/groups/{group_name}/{secret_name}'; + url: '/api/v1/secrets/set-group'; }; -export type MoveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePostErrors = { +export type AssignSecretGroupApiV1SecretsSetGroupPostErrors = { /** * Validation Error */ 422: HttpValidationError; }; -export type MoveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePostError = MoveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePostErrors[keyof MoveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePostErrors]; +export type AssignSecretGroupApiV1SecretsSetGroupPostError = AssignSecretGroupApiV1SecretsSetGroupPostErrors[keyof AssignSecretGroupApiV1SecretsSetGroupPostErrors]; -export type MoveSecretToGroupApiV1SecretsGroupsGroupNameSecretNamePostResponses = { +export type AssignSecretGroupApiV1SecretsSetGroupPostResponses = { /** * Successful Response */ 200: unknown; }; -export type MoveGroupApiV1SecretsGroupGroupNameParentParentNamePostData = { - body?: never; - path: { - /** - * Group Name - */ - group_name: string; - /** - * Parent Name - */ - parent_name: string; - }; - query?: never; - url: '/api/v1/secrets/group/{group_name}/parent/{parent_name}'; -}; - -export type MoveGroupApiV1SecretsGroupGroupNameParentParentNamePostErrors = { - /** - * Validation Error - */ - 422: HttpValidationError; -}; - -export type MoveGroupApiV1SecretsGroupGroupNameParentParentNamePostError = MoveGroupApiV1SecretsGroupGroupNameParentParentNamePostErrors[keyof MoveGroupApiV1SecretsGroupGroupNameParentParentNamePostErrors]; - -export type MoveGroupApiV1SecretsGroupGroupNameParentParentNamePostResponses = { - /** - * Successful Response - */ - 200: unknown; -}; - -export type MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteData = { - body?: never; +export type MoveGroupApiV1SecretsMoveGroupGroupNamePostData = { + body: GroupPath; path: { /** * Group Name @@ -1156,19 +1364,19 @@ export type MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteData = { group_name: string; }; query?: never; - url: '/api/v1/secrets/group/{group_name}/parent/'; + url: '/api/v1/secrets/move-group/{group_name}'; }; -export type MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteErrors = { +export type MoveGroupApiV1SecretsMoveGroupGroupNamePostErrors = { /** * Validation Error */ 422: HttpValidationError; }; -export type MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteError = MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteErrors[keyof MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteErrors]; +export type MoveGroupApiV1SecretsMoveGroupGroupNamePostError = MoveGroupApiV1SecretsMoveGroupGroupNamePostErrors[keyof MoveGroupApiV1SecretsMoveGroupGroupNamePostErrors]; -export type MoveGroupToRootApiV1SecretsGroupGroupNameParentDeleteResponses = { +export type MoveGroupApiV1SecretsMoveGroupGroupNamePostResponses = { /** * Successful Response */ diff --git a/packages/sshecret-frontend/src/components/audit/AuditFilters.vue b/packages/sshecret-frontend/src/components/audit/AuditFilters.vue new file mode 100644 index 0000000..fabedde --- /dev/null +++ b/packages/sshecret-frontend/src/components/audit/AuditFilters.vue @@ -0,0 +1,120 @@ + + diff --git a/packages/sshecret-frontend/src/components/audit/AuditTable.vue b/packages/sshecret-frontend/src/components/audit/AuditTable.vue new file mode 100644 index 0000000..314bb28 --- /dev/null +++ b/packages/sshecret-frontend/src/components/audit/AuditTable.vue @@ -0,0 +1,241 @@ + + + diff --git a/packages/sshecret-frontend/src/components/clients/ClientDetail.vue b/packages/sshecret-frontend/src/components/clients/ClientDetail.vue index 4da704a..da2e325 100644 --- a/packages/sshecret-frontend/src/components/clients/ClientDetail.vue +++ b/packages/sshecret-frontend/src/components/clients/ClientDetail.vue @@ -83,7 +83,9 @@ - + + + @@ -102,18 +104,8 @@ import { computed, ref, watch } from 'vue' import type { Client, ClientCreate } from '@/client/types.gen' -import '@shoelace-style/shoelace/dist/components/button/button.js' -import '@shoelace-style/shoelace/dist/components/dialog/dialog.js' -import '@shoelace-style/shoelace/dist/components/divider/divider.js' -import '@shoelace-style/shoelace/dist/components/drawer/drawer.js' -import '@shoelace-style/shoelace/dist/components/dropdown/dropdown.js' -import '@shoelace-style/shoelace/dist/components/icon-button/icon-button.js' -import '@shoelace-style/shoelace/dist/components/menu/menu.js' -import '@shoelace-style/shoelace/dist/components/menu-item/menu-item.js' -import '@shoelace-style/shoelace/dist/components/menu-label/menu-label.js' -import '@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js' -import '@shoelace-style/shoelace/dist/components/tab-group/tab-group.js' -import '@shoelace-style/shoelace/dist/components/tab/tab.js' + +import AuditTable from '@/components/audit/AuditTable.vue' import ClientForm from '@/components/clients/ClientForm.vue' const props = defineProps<{ client: Client }>() const emit = defineEmits<{ @@ -132,6 +124,11 @@ async function updateClient(data: ClientCreate) { updateDrawerOpen.value = false } +const auditFilter = { + client_name: props.client.name, + limit: 10, +} + async function deleteClient() { showConfirm.value = false emit('deleted', localClient.value.id) diff --git a/packages/sshecret-frontend/src/components/clients/ClientSecretTreeItem.vue b/packages/sshecret-frontend/src/components/clients/ClientSecretTreeItem.vue index ac42df6..ba0e219 100644 --- a/packages/sshecret-frontend/src/components/clients/ClientSecretTreeItem.vue +++ b/packages/sshecret-frontend/src/components/clients/ClientSecretTreeItem.vue @@ -7,8 +7,6 @@ + diff --git a/packages/sshecret-frontend/src/components/clients/ClientTreeItem.vue b/packages/sshecret-frontend/src/components/clients/ClientTreeItem.vue index 3bb7922..97bf985 100644 --- a/packages/sshecret-frontend/src/components/clients/ClientTreeItem.vue +++ b/packages/sshecret-frontend/src/components/clients/ClientTreeItem.vue @@ -1,17 +1,13 @@ diff --git a/packages/sshecret-frontend/src/components/common/PageNumbers.vue b/packages/sshecret-frontend/src/components/common/PageNumbers.vue new file mode 100644 index 0000000..7637b16 --- /dev/null +++ b/packages/sshecret-frontend/src/components/common/PageNumbers.vue @@ -0,0 +1,70 @@ + + + diff --git a/packages/sshecret-frontend/src/components/layout/Navbar.vue b/packages/sshecret-frontend/src/components/layout/Navbar.vue index eccffa7..e4ef2ae 100644 --- a/packages/sshecret-frontend/src/components/layout/Navbar.vue +++ b/packages/sshecret-frontend/src/components/layout/Navbar.vue @@ -54,3 +54,9 @@ function logout() { router.push('/login') } + + diff --git a/packages/sshecret-frontend/src/components/secrets/AddGroup.vue b/packages/sshecret-frontend/src/components/secrets/AddGroup.vue new file mode 100644 index 0000000..9b603d6 --- /dev/null +++ b/packages/sshecret-frontend/src/components/secrets/AddGroup.vue @@ -0,0 +1,56 @@ + + + diff --git a/packages/sshecret-frontend/src/components/secrets/AddSecretToClients.vue b/packages/sshecret-frontend/src/components/secrets/AddSecretToClients.vue index 81fa94a..50a9bf5 100644 --- a/packages/sshecret-frontend/src/components/secrets/AddSecretToClients.vue +++ b/packages/sshecret-frontend/src/components/secrets/AddSecretToClients.vue @@ -1,17 +1,6 @@