From 917dcc196450cbdfa9a9e43818bee9d977e1a5ad Mon Sep 17 00:00:00 2001 From: sickl8 Date: Tue, 23 Jul 2024 02:50:24 +0100 Subject: [PATCH] fix formatting with pre-commit for docs/swagger.{json, yaml} --- docs/swagger.json | 2940 ++++++++++++++++++++++++++++++++++++++++++++- docs/swagger.yaml | 1001 ++++++++------- 2 files changed, 3439 insertions(+), 502 deletions(-) diff --git a/docs/swagger.json b/docs/swagger.json index 4882840..24c99a4 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1 +1,2939 @@ -{ "schemes": [ "https" ], "swagger": "2.0", "info": { "description": "Interact with Saferwall Malware Analysis Platform", "title": "Saferwall Web API", "termsOfService": "https://about.saferwall.com/tos", "contact": { "name": "API Support", "url": "https://about.saferwall.com/contact.html", "email": "support@saferwall.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0" }, "host": "api.saferwall.com", "basePath": "/v1", "paths": { "/auth/login/": { "post": { "description": "Users logins by username and password.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "summary": "Log in", "parameters": [ { "description": "Username and password", "name": "auth-request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.loginRequest" } } ], "responses": { "200": { "description": "{\"token\": \"value\"}", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/auth/logout/": { "delete": { "description": "Delete the cookie used for authentication.", "tags": [ "Authentication" ], "summary": "Log out from current session", "responses": { "204": { "description": "logout success" } } } }, "/auth/password/": { "post": { "description": "Update the password from the auth token received in email.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "summary": "Create a new password from a token received in email", "parameters": [ { "description": "New password request", "name": "reset-pwd", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.createNewPwdRequest" } } ], "responses": { "200": { "description": "{\"token\": \"value\"}", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/auth/resend-confirmation/": { "post": { "description": "Send a new confirmation email link to confirm user's account.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "summary": "Resend a confirmation email", "parameters": [ { "description": "Account confirmation request", "name": "reset-pwd", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.confirmAccountRequest" } } ], "responses": { "200": { "description": "{\"token\": \"value\"}", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/auth/reset-password/": { "post": { "description": "Request a reset password for anonymous users.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Authentication" ], "summary": "Reset password for non-logged users by email", "parameters": [ { "description": "Email used during account sign-up", "name": "reset-pwd", "in": "body", "required": true, "schema": { "$ref": "#/definitions/auth.resetPwdRequest" } } ], "responses": { "200": { "description": "{\"token\": \"value\"}", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/auth/verify-account/": { "get": { "description": "Verify the JWT token received during account creation.", "tags": [ "Authentication" ], "summary": "Confirm a new account creation", "parameters": [ { "type": "string", "description": "GUID to identify the token", "name": "guid", "in": "query", "required": true }, { "type": "string", "description": "JWT token generated for account creation", "name": "token", "in": "query", "required": true } ], "responses": { "200": { "description": "{\"token\": \"value\"}", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/behaviors/{id}": { "get": { "description": "Retrieves the full behavior report of a file.", "tags": [ "Behavior" ], "summary": "Check a behavior report.", "parameters": [ { "type": "string", "description": "Behavior report GUID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Behavior" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/behaviors/{id}/api-trace/": { "get": { "description": "Paginates over the list of APIs", "tags": [ "Behavior" ], "summary": "List of APIs log.", "parameters": [ { "type": "string", "description": "Behavior report GUID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/behaviors/{id}/artifacts/": { "get": { "description": "Returns a paginated list of artifacts' metadata such as memdumps, created files, etc ..", "tags": [ "Behavior" ], "summary": "List of artifacts' metadata.", "parameters": [ { "type": "string", "description": "Behavior report GUID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/behaviors/{id}/sys-events/": { "get": { "description": "Paginates over the list of system events.", "tags": [ "Behavior" ], "summary": "List of system events.", "parameters": [ { "type": "string", "description": "Behavior report GUID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/comments/": { "post": { "security": [ { "Bearer": [] } ], "description": "Create a new comment.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Comment" ], "summary": "Create a new comment", "parameters": [ { "description": "Comment body", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/comment.CreateCommentRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/entity.Comment" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "413": { "description": "Request Entity Too Large", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/comments/{id}": { "get": { "description": "Retrieves information about a comment.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Comment" ], "summary": "Get comment by ID", "parameters": [ { "type": "string", "description": "Comment ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Comment" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/comments/{id}/": { "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a comment by ID.", "produces": [ "application/json" ], "tags": [ "Comment" ], "summary": "Deletes a comment", "parameters": [ { "type": "string", "description": "Comment ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "$ref": "#/definitions/entity.Comment" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } }, "patch": { "security": [ { "Bearer": [] } ], "description": "Replace a cocument with a new comment's document.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Comment" ], "summary": "Update a comment object (full update)", "parameters": [ { "type": "string", "description": "Comment ID", "name": "id", "in": "path", "required": true }, { "description": "New comment data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/comment.UpdateCommentRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.Comment" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/": { "get": { "security": [ { "Bearer": [] } ], "description": "List files", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Retrieves a paginated list of files", "parameters": [ { "type": "integer", "description": "Number of files per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Specify the page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/pagination.Pages" }, { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/entity.File" } } } } ] } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Upload file for analysis.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Submit a new file for scanning", "parameters": [ { "type": "file", "description": "binary file", "name": "file", "in": "formData", "required": true } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/entity.File" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "413": { "description": "Request Entity Too Large", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/{sha256}": { "get": { "description": "Retrieves the content of a file report.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Get a file report", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.File" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Replace a file report with a new report", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Update a file report (full update)", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.File" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a file by ID.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Deletes a file", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "$ref": "#/definitions/entity.File" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } }, "head": { "description": "Check weather a file exists in the database.", "tags": [ "File" ], "summary": "Check if a file exists.", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.File" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } }, "patch": { "security": [ { "Bearer": [] } ], "description": "Patch a portion of a file report.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Update a file report (partial update)", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.File" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/{sha256}/comments/": { "get": { "security": [ { "Bearer": []}, {} ], "description": "List of comments for a given file.", "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Returns a paginated list of file comments", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/{sha256}/download/": { "get": { "security": [ { "Bearer": [] } ], "description": "Download a binary file. Files are in zip format and password protected.", "produces": [ "multipart/form-data" ], "tags": [ "File" ], "summary": "Download a file", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/{sha256}/generate-presigned-url/": { "post": { "security": [ { "Bearer": [] } ], "description": "Generate a pre-signed URL to download samples directly from the object storage.", "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Generate a pre-signed URL for downloading samples.", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/{sha256}/like/": { "post": { "security": [ { "Bearer": [] } ], "description": "Adds a file to the like list.", "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Like a file", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/{sha256}/rescan/": { "post": { "security": [ { "Bearer": [] } ], "description": "Rescan an existing file.", "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Rescan an existing file", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/{sha256}/strings/": { "get": { "description": "List strings of a file.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Returns a paginated list of strings", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true }, { "type": "integer", "description": "Number of strings per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Specify the page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/{sha256}/summary/": { "get": { "security": [ { "Bearer": []}, {} ], "description": "File metadata returned in the summary view of a file.", "produces": [ "application/json" ], "tags": [ "File" ], "summary": "File summary and metadata", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/files/{sha256}/unlike/": { "post": { "security": [ { "Bearer": [] } ], "description": "Removes a file from the like list.", "produces": [ "application/json" ], "tags": [ "File" ], "summary": "Unlike a file", "parameters": [ { "type": "string", "description": "File SHA256", "name": "sha256", "in": "path", "required": true } ], "responses": { "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/": { "get": { "security": [ { "Bearer": [] } ], "description": "List users.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Retrieves a paginated list of users", "parameters": [ { "type": "integer", "description": "Number of items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Specify the page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/pagination.Pages" }, { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/entity.User" } } } } ] } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } }, "post": { "description": "Create a new user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Create a new user", "parameters": [ { "description": "User data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.CreateUserRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/entity.User" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "413": { "description": "Request Entity Too Large", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/activities/": { "get": { "security": [ { "Bearer": []}, {} ], "description": "List of activities of a user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Activity" ], "summary": "Returns a paginated list of a user's activities", "parameters": [ { "type": "integer", "description": "Number of items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Specify the page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}": { "get": { "security": [ { "Bearer": []}, {} ], "description": "Retrieves information about a user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Get user information by user ID", "parameters": [ { "type": "string", "description": "User ID", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.User" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/": { "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a user by ID.", "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Deletes a user", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content", "schema": { "$ref": "#/definitions/entity.User" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } }, "patch": { "security": [ { "Bearer": [] } ], "description": "Replace a user document with a new user's document.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Update a user object (full update)", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true }, { "description": "New user data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.UpdateUserRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/entity.User" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/avatar/": { "post": { "security": [ { "Bearer": [] } ], "description": "Change user avatar", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Update user avatar", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true }, { "description": "User data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.UpdateEmailRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "413": { "description": "Request Entity Too Large", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/comments/": { "get": { "security": [ { "Bearer": []}, {} ], "description": "List of comments by a user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Returns a paginated list of a user's comments", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true }, { "type": "integer", "description": "Number of items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Specify the page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/email/": { "post": { "security": [ { "Bearer": [] } ], "description": "Change email for logged-in users.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Update email for authenticated users", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true }, { "description": "User data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.UpdateEmailRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/follow/": { "post": { "security": [ { "Bearer": [] } ], "description": "Start following a user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Follow a user", "parameters": [ { "type": "string", "description": "Target user to follow", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/followers/": { "get": { "security": [ { "Bearer": []}, {} ], "description": "List of users who follow a user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Returns a paginated list of a user's followers", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true }, { "type": "integer", "description": "Number of items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Specify the page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/following/": { "get": { "security": [ { "Bearer": []}, {} ], "description": "List of users a user follows.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Returns a paginated list of a user's following", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true }, { "type": "integer", "description": "Number of items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Specify the page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/likes/": { "get": { "security": [ { "Bearer": []}, {} ], "description": "List of likes of a user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Returns a paginated list of a user's likes", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true }, { "type": "integer", "description": "Number of items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Specify the page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/password/": { "post": { "security": [ { "Bearer": [] } ], "description": "Change password for logged-in users.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Update password for authenticated users", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true }, { "description": "User data", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user.UpdateUserRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/submissions/": { "get": { "security": [ { "Bearer": []}, {} ], "description": "List of submissions by a user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Returns a paginated list of a user's submissions", "parameters": [ { "type": "string", "description": "Username", "name": "username", "in": "path", "required": true }, { "type": "integer", "description": "Number of items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Specify the page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/pagination.Pages" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } }, "/users/{username}/unfollow/": { "post": { "security": [ { "Bearer": [] } ], "description": "Stop following a user.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Unfollow a user", "parameters": [ { "type": "string", "description": "Target user to unfollow", "name": "username", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/errors.ErrorResponse" } } } } } }, "definitions": { "auth.confirmAccountRequest": { "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string", "example": "mike@protonmail.com" } } }, "auth.createNewPwdRequest": { "type": "object", "required": [ "guid", "password", "token" ], "properties": { "guid": { "type": "string", "example": "f47ac10b-58cc-8372-8567-0e02b2c3d479" }, "password": { "type": "string", "maxLength": 30, "minLength": 8, "example": "secretControl" }, "token": { "type": "string", "example": "eyJhbGciOiJIUzI1Ni" } } }, "auth.loginRequest": { "type": "object", "required": [ "password", "username" ], "properties": { "password": { "type": "string", "maxLength": 30, "minLength": 8, "example": "control123" }, "username": { "type": "string", "example": "mrrobot or mr-robot@protonmail.com" } } }, "auth.resetPwdRequest": { "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string", "example": "mike@protonmail.com" } } }, "comment.CreateCommentRequest": { "type": "object", "required": [ "body", "sha256" ], "properties": { "body": { "type": "string" }, "sha256": { "type": "string" }, "username": { "type": "string" } } }, "comment.UpdateCommentRequest": { "type": "object", "required": [ "body" ], "properties": { "body": { "type": "string" } } }, "entity.Behavior": { "type": "object", "properties": { "agent_log": {}, "api_trace": {}, "artifacts": {}, "capabilities": {}, "env": {}, "proc_tree": {}, "sandbox_log": {}, "scan_cfg": {}, "screenshots_count": { "type": "integer" }, "sha256": { "type": "string" }, "status": { "type": "integer" }, "sys_events": {}, "timestamp": { "type": "integer" }, "type": { "type": "string" } } }, "entity.Comment": { "type": "object", "properties": { "body": { "description": "Body represents the content of the comment.", "type": "string" }, "id": { "description": "ID represents the activity identifier.", "type": "string" }, "sha256": { "description": "SHA256 references the hash of the file\nwhere the comment has been made.", "type": "string" }, "timestamp": { "description": "Timestamp when this activity happened.", "type": "integer" }, "type": { "description": "Type represents the document type.", "type": "string" }, "username": { "description": "Username represents the author of the comment.", "type": "string" } } }, "entity.File": { "type": "object", "properties": { "behavior_scans": {}, "byte_entropy": { "type": "array", "items": { "type": "integer" } }, "comments_count": { "type": "integer" }, "crc32": { "type": "string" }, "default_behavior_report": {}, "exif": { "type": "object", "additionalProperties": { "type": "string" } }, "file_extension": { "type": "string" }, "file_format": { "type": "string" }, "first_seen": { "type": "integer" }, "histogram": { "type": "array", "items": { "type": "integer" } }, "last_scanned": { "type": "integer" }, "magic": { "type": "string" }, "md5": { "type": "string" }, "ml": { "type": "object", "additionalProperties": true }, "multiav": { "type": "object", "additionalProperties": true }, "packer": { "type": "array", "items": { "type": "string" } }, "pe": {}, "sha1": { "type": "string" }, "sha256": { "type": "string" }, "sha512": { "type": "string" }, "size": { "type": "integer" }, "ssdeep": { "type": "string" }, "status": { "type": "integer" }, "strings": {}, "submissions": { "type": "array", "items": { "$ref": "#/definitions/entity.Submission" } }, "tags": { "type": "object", "additionalProperties": true }, "trid": { "type": "array", "items": { "type": "string" } }, "type": { "type": "string" } } }, "entity.Submission": { "type": "object", "properties": { "country": { "type": "string" }, "filename": { "type": "string" }, "src": { "type": "string" }, "timestamp": { "type": "integer" } } }, "entity.User": { "type": "object", "properties": { "admin": { "type": "boolean" }, "bio": { "type": "string" }, "comments_count": { "type": "integer" }, "confirmed": { "type": "boolean" }, "email": { "type": "string" }, "followers": { "type": "array", "items": { "type": "string" } }, "followers_count": { "type": "integer" }, "following": { "type": "array", "items": { "type": "string" } }, "following_count": { "type": "integer" }, "has_avatar": { "type": "boolean" }, "last_seen": { "type": "integer" }, "likes": { "type": "array", "items": { "type": "string" } }, "likes_count": { "type": "integer" }, "location": { "type": "string" }, "member_since": { "type": "integer" }, "name": { "type": "string" }, "password": { "type": "string" }, "submissions_count": { "type": "integer" }, "type": { "type": "string" }, "url": { "type": "string" }, "username": { "type": "string" } } }, "errors.ErrorResponse": { "type": "object", "properties": { "details": {}, "message": { "type": "string" }, "status": { "type": "integer" } } }, "pagination.Pages": { "type": "object", "properties": { "items": {}, "page": { "type": "integer" }, "page_count": { "type": "integer" }, "per_page": { "type": "integer" }, "total_count": { "type": "integer" } } }, "user.CreateUserRequest": { "type": "object", "required": [ "email", "password", "username" ], "properties": { "email": { "type": "string", "example": "mike@protonmail.com" }, "password": { "type": "string", "maxLength": 30, "minLength": 8, "example": "control123" }, "username": { "type": "string", "maxLength": 20, "minLength": 1, "example": "mike" } } }, "user.UpdateEmailRequest": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "type": "string", "example": "mike@proton.me" }, "password": { "type": "string", "maxLength": 30, "minLength": 8, "example": "control123" } } }, "user.UpdateUserRequest": { "type": "object", "properties": { "bio": { "type": "string", "maxLength": 64, "minLength": 1, "example": "What really counts are good endings, not flawed beginnings." }, "location": { "type": "string", "maxLength": 16, "minLength": 1, "example": "Damascus" }, "name": { "type": "string", "maxLength": 32, "minLength": 1, "example": "Ibn Taymiyyah" }, "url": { "type": "string", "maxLength": 64, "example": "https://en.wikipedia.org/wiki/Ibn_Taymiyyah" } } } }, "securityDefinitions": { "Bearer": { "description": "Enter the token with the `Bearer ` prefix, e.g. \"Bearer abcde12345\".", "type": "oauth2", "flow": "password", "tokenUrl": "auth/login" } }} \ No newline at end of file +{ + "schemes": [ + "https" + ], + "swagger": "2.0", + "info": { + "description": "Interact with Saferwall Malware Analysis Platform", + "title": "Saferwall Web API", + "termsOfService": "https://about.saferwall.com/tos", + "contact": { + "name": "API Support", + "url": "https://about.saferwall.com/contact.html", + "email": "support@saferwall.com" + }, + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version": "1.0" + }, + "host": "api.saferwall.com", + "basePath": "/v1", + "paths": { + "/auth/login/": { + "post": { + "description": "Users logins by username and password.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authentication" + ], + "summary": "Log in", + "parameters": [ + { + "description": "Username and password", + "name": "auth-request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/auth.loginRequest" + } + } + ], + "responses": { + "200": { + "description": "{\"token\": \"value\"}", + "schema": { + "type": "string" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/auth/logout/": { + "delete": { + "description": "Delete the cookie used for authentication.", + "tags": [ + "Authentication" + ], + "summary": "Log out from current session", + "responses": { + "204": { + "description": "logout success" + } + } + } + }, + "/auth/password/": { + "post": { + "description": "Update the password from the auth token received in email.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authentication" + ], + "summary": "Create a new password from a token received in email", + "parameters": [ + { + "description": "New password request", + "name": "reset-pwd", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/auth.createNewPwdRequest" + } + } + ], + "responses": { + "200": { + "description": "{\"token\": \"value\"}", + "schema": { + "type": "string" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/auth/resend-confirmation/": { + "post": { + "description": "Send a new confirmation email link to confirm user's account.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authentication" + ], + "summary": "Resend a confirmation email", + "parameters": [ + { + "description": "Account confirmation request", + "name": "reset-pwd", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/auth.confirmAccountRequest" + } + } + ], + "responses": { + "200": { + "description": "{\"token\": \"value\"}", + "schema": { + "type": "string" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/auth/reset-password/": { + "post": { + "description": "Request a reset password for anonymous users.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authentication" + ], + "summary": "Reset password for non-logged users by email", + "parameters": [ + { + "description": "Email used during account sign-up", + "name": "reset-pwd", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/auth.resetPwdRequest" + } + } + ], + "responses": { + "200": { + "description": "{\"token\": \"value\"}", + "schema": { + "type": "string" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/auth/verify-account/": { + "get": { + "description": "Verify the JWT token received during account creation.", + "tags": [ + "Authentication" + ], + "summary": "Confirm a new account creation", + "parameters": [ + { + "type": "string", + "description": "GUID to identify the token", + "name": "guid", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "JWT token generated for account creation", + "name": "token", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"token\": \"value\"}", + "schema": { + "type": "string" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/behaviors/{id}": { + "get": { + "description": "Retrieves the full behavior report of a file.", + "tags": [ + "Behavior" + ], + "summary": "Check a behavior report.", + "parameters": [ + { + "type": "string", + "description": "Behavior report GUID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.Behavior" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/behaviors/{id}/api-trace/": { + "get": { + "description": "Paginates over the list of APIs", + "tags": [ + "Behavior" + ], + "summary": "List of APIs log.", + "parameters": [ + { + "type": "string", + "description": "Behavior report GUID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/behaviors/{id}/artifacts/": { + "get": { + "description": "Returns a paginated list of artifacts' metadata such as memdumps, created files, etc ..", + "tags": [ + "Behavior" + ], + "summary": "List of artifacts' metadata.", + "parameters": [ + { + "type": "string", + "description": "Behavior report GUID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/behaviors/{id}/sys-events/": { + "get": { + "description": "Paginates over the list of system events.", + "tags": [ + "Behavior" + ], + "summary": "List of system events.", + "parameters": [ + { + "type": "string", + "description": "Behavior report GUID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/comments/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Create a new comment.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Comment" + ], + "summary": "Create a new comment", + "parameters": [ + { + "description": "Comment body", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/comment.CreateCommentRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/entity.Comment" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "413": { + "description": "Request Entity Too Large", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/comments/{id}": { + "get": { + "description": "Retrieves information about a comment.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Comment" + ], + "summary": "Get comment by ID", + "parameters": [ + { + "type": "string", + "description": "Comment ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.Comment" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/comments/{id}/": { + "delete": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Deletes a comment by ID.", + "produces": [ + "application/json" + ], + "tags": [ + "Comment" + ], + "summary": "Deletes a comment", + "parameters": [ + { + "type": "string", + "description": "Comment ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content", + "schema": { + "$ref": "#/definitions/entity.Comment" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + }, + "patch": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Replace a cocument with a new comment's document.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Comment" + ], + "summary": "Update a comment object (full update)", + "parameters": [ + { + "type": "string", + "description": "Comment ID", + "name": "id", + "in": "path", + "required": true + }, + { + "description": "New comment data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/comment.UpdateCommentRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.Comment" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "description": "List files", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Retrieves a paginated list of files", + "parameters": [ + { + "type": "integer", + "description": "Number of files per page", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Specify the page number", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/pagination.Pages" + }, + { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.File" + } + } + } + } + ] + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + }, + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Upload file for analysis.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Submit a new file for scanning", + "parameters": [ + { + "type": "file", + "description": "binary file", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/entity.File" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "413": { + "description": "Request Entity Too Large", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/{sha256}": { + "get": { + "description": "Retrieves the content of a file report.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Get a file report", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.File" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + }, + "put": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Replace a file report with a new report", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Update a file report (full update)", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.File" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + }, + "delete": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Deletes a file by ID.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Deletes a file", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content", + "schema": { + "$ref": "#/definitions/entity.File" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + }, + "head": { + "description": "Check weather a file exists in the database.", + "tags": [ + "File" + ], + "summary": "Check if a file exists.", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.File" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + }, + "patch": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Patch a portion of a file report.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Update a file report (partial update)", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.File" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/{sha256}/comments/": { + "get": { + "security": [ + { + "Bearer": [] + }, + {} + ], + "description": "List of comments for a given file.", + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Returns a paginated list of file comments", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/{sha256}/download/": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Download a binary file. Files are in zip format and password protected.", + "produces": [ + "multipart/form-data" + ], + "tags": [ + "File" + ], + "summary": "Download a file", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/{sha256}/generate-presigned-url/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Generate a pre-signed URL to download samples directly from the object storage.", + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Generate a pre-signed URL for downloading samples.", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/{sha256}/like/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Adds a file to the like list.", + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Like a file", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/{sha256}/rescan/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Rescan an existing file.", + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Rescan an existing file", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/{sha256}/strings/": { + "get": { + "description": "List strings of a file.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Returns a paginated list of strings", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Number of strings per page", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Specify the page number", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/{sha256}/summary/": { + "get": { + "security": [ + { + "Bearer": [] + }, + {} + ], + "description": "File metadata returned in the summary view of a file.", + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "File summary and metadata", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/files/{sha256}/unlike/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Removes a file from the like list.", + "produces": [ + "application/json" + ], + "tags": [ + "File" + ], + "summary": "Unlike a file", + "parameters": [ + { + "type": "string", + "description": "File SHA256", + "name": "sha256", + "in": "path", + "required": true + } + ], + "responses": { + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "description": "List users.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Retrieves a paginated list of users", + "parameters": [ + { + "type": "integer", + "description": "Number of items per page", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Specify the page number", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/pagination.Pages" + }, + { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.User" + } + } + } + } + ] + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + }, + "post": { + "description": "Create a new user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Create a new user", + "parameters": [ + { + "description": "User data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.CreateUserRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/entity.User" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "413": { + "description": "Request Entity Too Large", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/activities/": { + "get": { + "security": [ + { + "Bearer": [] + }, + {} + ], + "description": "List of activities of a user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Activity" + ], + "summary": "Returns a paginated list of a user's activities", + "parameters": [ + { + "type": "integer", + "description": "Number of items per page", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Specify the page number", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}": { + "get": { + "security": [ + { + "Bearer": [] + }, + {} + ], + "description": "Retrieves information about a user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Get user information by user ID", + "parameters": [ + { + "type": "string", + "description": "User ID", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.User" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/": { + "delete": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Deletes a user by ID.", + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Deletes a user", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "No Content", + "schema": { + "$ref": "#/definitions/entity.User" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + }, + "patch": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Replace a user document with a new user's document.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Update a user object (full update)", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + }, + { + "description": "New user data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.UpdateUserRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.User" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/avatar/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Change user avatar", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Update user avatar", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + }, + { + "description": "User data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.UpdateEmailRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "413": { + "description": "Request Entity Too Large", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/comments/": { + "get": { + "security": [ + { + "Bearer": [] + }, + {} + ], + "description": "List of comments by a user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Returns a paginated list of a user's comments", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Specify the page number", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/email/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Change email for logged-in users.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Update email for authenticated users", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + }, + { + "description": "User data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.UpdateEmailRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/follow/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Start following a user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Follow a user", + "parameters": [ + { + "type": "string", + "description": "Target user to follow", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/followers/": { + "get": { + "security": [ + { + "Bearer": [] + }, + {} + ], + "description": "List of users who follow a user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Returns a paginated list of a user's followers", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Specify the page number", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/following/": { + "get": { + "security": [ + { + "Bearer": [] + }, + {} + ], + "description": "List of users a user follows.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Returns a paginated list of a user's following", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Specify the page number", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/likes/": { + "get": { + "security": [ + { + "Bearer": [] + }, + {} + ], + "description": "List of likes of a user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Returns a paginated list of a user's likes", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Specify the page number", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/password/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Change password for logged-in users.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Update password for authenticated users", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + }, + { + "description": "User data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.UpdateUserRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/submissions/": { + "get": { + "security": [ + { + "Bearer": [] + }, + {} + ], + "description": "List of submissions by a user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Returns a paginated list of a user's submissions", + "parameters": [ + { + "type": "string", + "description": "Username", + "name": "username", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "per_page", + "in": "query" + }, + { + "type": "integer", + "description": "Specify the page number", + "name": "page", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/pagination.Pages" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + }, + "/users/{username}/unfollow/": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "Stop following a user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "Unfollow a user", + "parameters": [ + { + "type": "string", + "description": "Target user to unfollow", + "name": "username", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "403": { + "description": "Forbidden", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/errors.ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "auth.confirmAccountRequest": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string", + "example": "mike@protonmail.com" + } + } + }, + "auth.createNewPwdRequest": { + "type": "object", + "required": [ + "guid", + "password", + "token" + ], + "properties": { + "guid": { + "type": "string", + "example": "f47ac10b-58cc-8372-8567-0e02b2c3d479" + }, + "password": { + "type": "string", + "maxLength": 30, + "minLength": 8, + "example": "secretControl" + }, + "token": { + "type": "string", + "example": "eyJhbGciOiJIUzI1Ni" + } + } + }, + "auth.loginRequest": { + "type": "object", + "required": [ + "password", + "username" + ], + "properties": { + "password": { + "type": "string", + "maxLength": 30, + "minLength": 8, + "example": "control123" + }, + "username": { + "type": "string", + "example": "mrrobot or mr-robot@protonmail.com" + } + } + }, + "auth.resetPwdRequest": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string", + "example": "mike@protonmail.com" + } + } + }, + "comment.CreateCommentRequest": { + "type": "object", + "required": [ + "body", + "sha256" + ], + "properties": { + "body": { + "type": "string" + }, + "sha256": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "comment.UpdateCommentRequest": { + "type": "object", + "required": [ + "body" + ], + "properties": { + "body": { + "type": "string" + } + } + }, + "entity.Behavior": { + "type": "object", + "properties": { + "agent_log": {}, + "api_trace": {}, + "artifacts": {}, + "capabilities": {}, + "env": {}, + "proc_tree": {}, + "sandbox_log": {}, + "scan_cfg": {}, + "screenshots_count": { + "type": "integer" + }, + "sha256": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "sys_events": {}, + "timestamp": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "entity.Comment": { + "type": "object", + "properties": { + "body": { + "description": "Body represents the content of the comment.", + "type": "string" + }, + "id": { + "description": "ID represents the activity identifier.", + "type": "string" + }, + "sha256": { + "description": "SHA256 references the hash of the file\nwhere the comment has been made.", + "type": "string" + }, + "timestamp": { + "description": "Timestamp when this activity happened.", + "type": "integer" + }, + "type": { + "description": "Type represents the document type.", + "type": "string" + }, + "username": { + "description": "Username represents the author of the comment.", + "type": "string" + } + } + }, + "entity.File": { + "type": "object", + "properties": { + "behavior_scans": {}, + "byte_entropy": { + "type": "array", + "items": { + "type": "integer" + } + }, + "comments_count": { + "type": "integer" + }, + "crc32": { + "type": "string" + }, + "default_behavior_report": {}, + "exif": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "file_extension": { + "type": "string" + }, + "file_format": { + "type": "string" + }, + "first_seen": { + "type": "integer" + }, + "histogram": { + "type": "array", + "items": { + "type": "integer" + } + }, + "last_scanned": { + "type": "integer" + }, + "magic": { + "type": "string" + }, + "md5": { + "type": "string" + }, + "ml": { + "type": "object", + "additionalProperties": true + }, + "multiav": { + "type": "object", + "additionalProperties": true + }, + "packer": { + "type": "array", + "items": { + "type": "string" + } + }, + "pe": {}, + "sha1": { + "type": "string" + }, + "sha256": { + "type": "string" + }, + "sha512": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "ssdeep": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "strings": {}, + "submissions": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Submission" + } + }, + "tags": { + "type": "object", + "additionalProperties": true + }, + "trid": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + } + } + }, + "entity.Submission": { + "type": "object", + "properties": { + "country": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "src": { + "type": "string" + }, + "timestamp": { + "type": "integer" + } + } + }, + "entity.User": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "bio": { + "type": "string" + }, + "comments_count": { + "type": "integer" + }, + "confirmed": { + "type": "boolean" + }, + "email": { + "type": "string" + }, + "followers": { + "type": "array", + "items": { + "type": "string" + } + }, + "followers_count": { + "type": "integer" + }, + "following": { + "type": "array", + "items": { + "type": "string" + } + }, + "following_count": { + "type": "integer" + }, + "has_avatar": { + "type": "boolean" + }, + "last_seen": { + "type": "integer" + }, + "likes": { + "type": "array", + "items": { + "type": "string" + } + }, + "likes_count": { + "type": "integer" + }, + "location": { + "type": "string" + }, + "member_since": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "submissions_count": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "errors.ErrorResponse": { + "type": "object", + "properties": { + "details": {}, + "message": { + "type": "string" + }, + "status": { + "type": "integer" + } + } + }, + "pagination.Pages": { + "type": "object", + "properties": { + "items": {}, + "page": { + "type": "integer" + }, + "page_count": { + "type": "integer" + }, + "per_page": { + "type": "integer" + }, + "total_count": { + "type": "integer" + } + } + }, + "user.CreateUserRequest": { + "type": "object", + "required": [ + "email", + "password", + "username" + ], + "properties": { + "email": { + "type": "string", + "example": "mike@protonmail.com" + }, + "password": { + "type": "string", + "maxLength": 30, + "minLength": 8, + "example": "control123" + }, + "username": { + "type": "string", + "maxLength": 20, + "minLength": 1, + "example": "mike" + } + } + }, + "user.UpdateEmailRequest": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "example": "mike@proton.me" + }, + "password": { + "type": "string", + "maxLength": 30, + "minLength": 8, + "example": "control123" + } + } + }, + "user.UpdateUserRequest": { + "type": "object", + "properties": { + "bio": { + "type": "string", + "maxLength": 64, + "minLength": 1, + "example": "What really counts are good endings, not flawed beginnings." + }, + "location": { + "type": "string", + "maxLength": 16, + "minLength": 1, + "example": "Damascus" + }, + "name": { + "type": "string", + "maxLength": 32, + "minLength": 1, + "example": "Ibn Taymiyyah" + }, + "url": { + "type": "string", + "maxLength": 64, + "example": "https://en.wikipedia.org/wiki/Ibn_Taymiyyah" + } + } + } + }, + "securityDefinitions": { + "Bearer": { + "description": "Enter the token with the `Bearer ` prefix, e.g. \"Bearer abcde12345\".", + "type": "oauth2", + "flow": "password", + "tokenUrl": "auth/login" + } + } +} diff --git a/docs/swagger.yaml b/docs/swagger.yaml index c1db46e..acc976c 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -6,7 +6,7 @@ definitions: example: mike@protonmail.com type: string required: - - email + - email type: object auth.createNewPwdRequest: properties: @@ -22,9 +22,9 @@ definitions: example: eyJhbGciOiJIUzI1Ni type: string required: - - guid - - password - - token + - guid + - password + - token type: object auth.loginRequest: properties: @@ -37,8 +37,8 @@ definitions: example: mrrobot or mr-robot@protonmail.com type: string required: - - password - - username + - password + - username type: object auth.resetPwdRequest: properties: @@ -46,7 +46,7 @@ definitions: example: mike@protonmail.com type: string required: - - email + - email type: object comment.CreateCommentRequest: properties: @@ -57,15 +57,15 @@ definitions: username: type: string required: - - body - - sha256 + - body + - sha256 type: object comment.UpdateCommentRequest: properties: body: type: string required: - - body + - body type: object entity.Behavior: properties: @@ -280,9 +280,9 @@ definitions: minLength: 1 type: string required: - - email - - password - - username + - email + - password + - username type: object user.UpdateEmailRequest: properties: @@ -295,8 +295,8 @@ definitions: minLength: 8 type: string required: - - email - - password + - email + - password type: object user.UpdateUserRequest: properties: @@ -337,17 +337,17 @@ paths: /auth/login/: post: consumes: - - application/json + - application/json description: Users logins by username and password. parameters: - - description: Username and password - in: body - name: auth-request - required: true - schema: - $ref: '#/definitions/auth.loginRequest' + - description: Username and password + in: body + name: auth-request + required: true + schema: + $ref: '#/definitions/auth.loginRequest' produces: - - application/json + - application/json responses: "200": description: '{"token": "value"}' @@ -367,7 +367,7 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Log in tags: - - Authentication + - Authentication /auth/logout/: delete: description: Delete the cookie used for authentication. @@ -376,21 +376,21 @@ paths: description: logout success summary: Log out from current session tags: - - Authentication + - Authentication /auth/password/: post: consumes: - - application/json + - application/json description: Update the password from the auth token received in email. parameters: - - description: New password request - in: body - name: reset-pwd - required: true - schema: - $ref: '#/definitions/auth.createNewPwdRequest' + - description: New password request + in: body + name: reset-pwd + required: true + schema: + $ref: '#/definitions/auth.createNewPwdRequest' produces: - - application/json + - application/json responses: "200": description: '{"token": "value"}' @@ -410,21 +410,21 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Create a new password from a token received in email tags: - - Authentication + - Authentication /auth/resend-confirmation/: post: consumes: - - application/json + - application/json description: Send a new confirmation email link to confirm user's account. parameters: - - description: Account confirmation request - in: body - name: reset-pwd - required: true - schema: - $ref: '#/definitions/auth.confirmAccountRequest' + - description: Account confirmation request + in: body + name: reset-pwd + required: true + schema: + $ref: '#/definitions/auth.confirmAccountRequest' produces: - - application/json + - application/json responses: "200": description: '{"token": "value"}' @@ -444,21 +444,21 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Resend a confirmation email tags: - - Authentication + - Authentication /auth/reset-password/: post: consumes: - - application/json + - application/json description: Request a reset password for anonymous users. parameters: - - description: Email used during account sign-up - in: body - name: reset-pwd - required: true - schema: - $ref: '#/definitions/auth.resetPwdRequest' + - description: Email used during account sign-up + in: body + name: reset-pwd + required: true + schema: + $ref: '#/definitions/auth.resetPwdRequest' produces: - - application/json + - application/json responses: "200": description: '{"token": "value"}' @@ -478,21 +478,21 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Reset password for non-logged users by email tags: - - Authentication + - Authentication /auth/verify-account/: get: description: Verify the JWT token received during account creation. parameters: - - description: GUID to identify the token - in: query - name: guid - required: true - type: string - - description: JWT token generated for account creation - in: query - name: token - required: true - type: string + - description: GUID to identify the token + in: query + name: guid + required: true + type: string + - description: JWT token generated for account creation + in: query + name: token + required: true + type: string responses: "200": description: '{"token": "value"}' @@ -512,16 +512,16 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Confirm a new account creation tags: - - Authentication + - Authentication /behaviors/{id}: get: description: Retrieves the full behavior report of a file. parameters: - - description: Behavior report GUID - in: path - name: id - required: true - type: string + - description: Behavior report GUID + in: path + name: id + required: true + type: string responses: "200": description: OK @@ -537,16 +537,16 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Check a behavior report. tags: - - Behavior + - Behavior /behaviors/{id}/api-trace/: get: description: Paginates over the list of APIs parameters: - - description: Behavior report GUID - in: path - name: id - required: true - type: string + - description: Behavior report GUID + in: path + name: id + required: true + type: string responses: "200": description: OK @@ -562,17 +562,17 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: List of APIs log. tags: - - Behavior + - Behavior /behaviors/{id}/artifacts/: get: - description: Returns a paginated list of artifacts' metadata such as memdumps, - created files, etc .. + description: Returns a paginated list of artifacts' metadata such as memdumps, created files, etc + .. parameters: - - description: Behavior report GUID - in: path - name: id - required: true - type: string + - description: Behavior report GUID + in: path + name: id + required: true + type: string responses: "200": description: OK @@ -588,16 +588,16 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: List of artifacts' metadata. tags: - - Behavior + - Behavior /behaviors/{id}/sys-events/: get: description: Paginates over the list of system events. parameters: - - description: Behavior report GUID - in: path - name: id - required: true - type: string + - description: Behavior report GUID + in: path + name: id + required: true + type: string responses: "200": description: OK @@ -613,21 +613,21 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: List of system events. tags: - - Behavior + - Behavior /comments/: post: consumes: - - application/json + - application/json description: Create a new comment. parameters: - - description: Comment body - in: body - name: data - required: true - schema: - $ref: '#/definitions/comment.CreateCommentRequest' + - description: Comment body + in: body + name: data + required: true + schema: + $ref: '#/definitions/comment.CreateCommentRequest' produces: - - application/json + - application/json responses: "201": description: Created @@ -650,23 +650,23 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Create a new comment tags: - - Comment + - Comment /comments/{id}: get: consumes: - - application/json + - application/json description: Retrieves information about a comment. parameters: - - description: Comment ID - in: path - name: id - required: true - type: string + - description: Comment ID + in: path + name: id + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -686,18 +686,18 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Get comment by ID tags: - - Comment + - Comment /comments/{id}/: delete: description: Deletes a comment by ID. parameters: - - description: Comment ID - in: path - name: id - required: true - type: string + - description: Comment ID + in: path + name: id + required: true + type: string produces: - - application/json + - application/json responses: "204": description: No Content @@ -716,28 +716,28 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Deletes a comment tags: - - Comment + - Comment patch: consumes: - - application/json + - application/json description: Replace a cocument with a new comment's document. parameters: - - description: Comment ID - in: path - name: id - required: true - type: string - - description: New comment data - in: body - name: data - required: true - schema: - $ref: '#/definitions/comment.UpdateCommentRequest' + - description: Comment ID + in: path + name: id + required: true + type: string + - description: New comment data + in: body + name: data + required: true + schema: + $ref: '#/definitions/comment.UpdateCommentRequest' produces: - - application/json + - application/json responses: "200": description: OK @@ -756,38 +756,38 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Update a comment object (full update) tags: - - Comment + - Comment /files/: get: consumes: - - application/json + - application/json description: List files parameters: - - description: Number of files per page - in: query - name: per_page - type: integer - - description: Specify the page number - in: query - name: page - type: integer + - description: Number of files per page + in: query + name: per_page + type: integer + - description: Specify the page number + in: query + name: page + type: integer produces: - - application/json + - application/json responses: "200": description: OK schema: allOf: - - $ref: '#/definitions/pagination.Pages' - - properties: - items: + - $ref: '#/definitions/pagination.Pages' + - properties: items: - $ref: '#/definitions/entity.File' - type: array - type: object + items: + $ref: '#/definitions/entity.File' + type: array + type: object "403": description: Forbidden schema: @@ -801,22 +801,22 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Retrieves a paginated list of files tags: - - File + - File post: consumes: - - multipart/form-data + - multipart/form-data description: Upload file for analysis. parameters: - - description: binary file - in: formData - name: file - required: true - type: file + - description: binary file + in: formData + name: file + required: true + type: file produces: - - application/json + - application/json responses: "201": description: Created @@ -839,23 +839,23 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Submit a new file for scanning tags: - - File + - File /files/{sha256}: delete: consumes: - - application/json + - application/json description: Deletes a file by ID. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "204": description: No Content @@ -874,22 +874,22 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Deletes a file tags: - - File + - File get: consumes: - - application/json + - application/json description: Retrieves the content of a file report. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -909,15 +909,15 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Get a file report tags: - - File + - File head: description: Check weather a file exists in the database. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string responses: "200": description: OK @@ -933,19 +933,19 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Check if a file exists. tags: - - File + - File patch: consumes: - - application/json + - application/json description: Patch a portion of a file report. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -964,22 +964,22 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Update a file report (partial update) tags: - - File + - File put: consumes: - - application/json + - application/json description: Replace a file report with a new report parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -998,21 +998,21 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Update a file report (full update) tags: - - File + - File /files/{sha256}/comments/: get: description: List of comments for a given file. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -1031,22 +1031,22 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - {} - - Bearer: [] + - {} + - Bearer: [] summary: Returns a paginated list of file comments tags: - - File + - File /files/{sha256}/download/: get: description: Download a binary file. Files are in zip format and password protected. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - multipart/form-data + - multipart/form-data responses: "403": description: Forbidden @@ -1061,22 +1061,21 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Download a file tags: - - File + - File /files/{sha256}/generate-presigned-url/: post: - description: Generate a pre-signed URL to download samples directly from the - object storage. + description: Generate a pre-signed URL to download samples directly from the object storage. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "403": description: Forbidden @@ -1091,21 +1090,21 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Generate a pre-signed URL for downloading samples. tags: - - File + - File /files/{sha256}/like/: post: description: Adds a file to the like list. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -1124,21 +1123,21 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Like a file tags: - - File + - File /files/{sha256}/rescan/: post: description: Rescan an existing file. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "403": description: Forbidden @@ -1153,31 +1152,31 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Rescan an existing file tags: - - File + - File /files/{sha256}/strings/: get: consumes: - - application/json + - application/json description: List strings of a file. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string - - description: Number of strings per page - in: query - name: per_page - type: integer - - description: Specify the page number - in: query - name: page - type: integer + - description: File SHA256 + in: path + name: sha256 + required: true + type: string + - description: Number of strings per page + in: query + name: per_page + type: integer + - description: Specify the page number + in: query + name: page + type: integer produces: - - application/json + - application/json responses: "200": description: OK @@ -1197,18 +1196,18 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Returns a paginated list of strings tags: - - File + - File /files/{sha256}/summary/: get: description: File metadata returned in the summary view of a file. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -1227,22 +1226,22 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - {} - - Bearer: [] + - {} + - Bearer: [] summary: File summary and metadata tags: - - File + - File /files/{sha256}/unlike/: post: description: Removes a file from the like list. parameters: - - description: File SHA256 - in: path - name: sha256 - required: true - type: string + - description: File SHA256 + in: path + name: sha256 + required: true + type: string produces: - - application/json + - application/json responses: "403": description: Forbidden @@ -1257,38 +1256,38 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Unlike a file tags: - - File + - File /users/: get: consumes: - - application/json + - application/json description: List users. parameters: - - description: Number of items per page - in: query - name: per_page - type: integer - - description: Specify the page number - in: query - name: page - type: integer + - description: Number of items per page + in: query + name: per_page + type: integer + - description: Specify the page number + in: query + name: page + type: integer produces: - - application/json + - application/json responses: "200": description: OK schema: allOf: - - $ref: '#/definitions/pagination.Pages' - - properties: - items: + - $ref: '#/definitions/pagination.Pages' + - properties: items: - $ref: '#/definitions/entity.User' - type: array - type: object + items: + $ref: '#/definitions/entity.User' + type: array + type: object "403": description: Forbidden schema: @@ -1302,23 +1301,23 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Retrieves a paginated list of users tags: - - User + - User post: consumes: - - application/json + - application/json description: Create a new user. parameters: - - description: User data - in: body - name: data - required: true - schema: - $ref: '#/definitions/user.CreateUserRequest' + - description: User data + in: body + name: data + required: true + schema: + $ref: '#/definitions/user.CreateUserRequest' produces: - - application/json + - application/json responses: "201": description: Created @@ -1342,20 +1341,20 @@ paths: $ref: '#/definitions/errors.ErrorResponse' summary: Create a new user tags: - - User + - User /users/{username}: get: consumes: - - application/json + - application/json description: Retrieves information about a user. parameters: - - description: User ID - in: path - name: username - required: true - type: string + - description: User ID + in: path + name: username + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -1374,22 +1373,22 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - {} - - Bearer: [] + - {} + - Bearer: [] summary: Get user information by user ID tags: - - User + - User /users/{username}/: delete: description: Deletes a user by ID. parameters: - - description: Username - in: path - name: username - required: true - type: string + - description: Username + in: path + name: username + required: true + type: string produces: - - application/json + - application/json responses: "204": description: No Content @@ -1408,28 +1407,28 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Deletes a user tags: - - User + - User patch: consumes: - - application/json + - application/json description: Replace a user document with a new user's document. parameters: - - description: Username - in: path - name: username - required: true - type: string - - description: New user data - in: body - name: data - required: true - schema: - $ref: '#/definitions/user.UpdateUserRequest' + - description: Username + in: path + name: username + required: true + type: string + - description: New user data + in: body + name: data + required: true + schema: + $ref: '#/definitions/user.UpdateUserRequest' produces: - - application/json + - application/json responses: "200": description: OK @@ -1448,29 +1447,29 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Update a user object (full update) tags: - - User + - User /users/{username}/avatar/: post: consumes: - - application/json + - application/json description: Change user avatar parameters: - - description: Username - in: path - name: username - required: true - type: string - - description: User data - in: body - name: data - required: true - schema: - $ref: '#/definitions/user.UpdateEmailRequest' + - description: Username + in: path + name: username + required: true + type: string + - description: User data + in: body + name: data + required: true + schema: + $ref: '#/definitions/user.UpdateEmailRequest' produces: - - application/json + - application/json responses: "200": description: OK @@ -1497,31 +1496,31 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Update user avatar tags: - - User + - User /users/{username}/comments/: get: consumes: - - application/json + - application/json description: List of comments by a user. parameters: - - description: Username - in: path - name: username - required: true - type: string - - description: Number of items per page - in: query - name: per_page - type: integer - - description: Specify the page number - in: query - name: page - type: integer + - description: Username + in: path + name: username + required: true + type: string + - description: Number of items per page + in: query + name: per_page + type: integer + - description: Specify the page number + in: query + name: page + type: integer produces: - - application/json + - application/json responses: "200": description: OK @@ -1540,30 +1539,30 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - {} - - Bearer: [] + - {} + - Bearer: [] summary: Returns a paginated list of a user's comments tags: - - User + - User /users/{username}/email/: post: consumes: - - application/json + - application/json description: Change email for logged-in users. parameters: - - description: Username - in: path - name: username - required: true - type: string - - description: User data - in: body - name: data - required: true - schema: - $ref: '#/definitions/user.UpdateEmailRequest' + - description: Username + in: path + name: username + required: true + type: string + - description: User data + in: body + name: data + required: true + schema: + $ref: '#/definitions/user.UpdateEmailRequest' produces: - - application/json + - application/json responses: "200": description: OK @@ -1582,23 +1581,23 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Update email for authenticated users tags: - - User + - User /users/{username}/follow/: post: consumes: - - application/json + - application/json description: Start following a user. parameters: - - description: Target user to follow - in: path - name: username - required: true - type: string + - description: Target user to follow + in: path + name: username + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -1617,31 +1616,31 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Follow a user tags: - - User + - User /users/{username}/followers/: get: consumes: - - application/json + - application/json description: List of users who follow a user. parameters: - - description: Username - in: path - name: username - required: true - type: string - - description: Number of items per page - in: query - name: per_page - type: integer - - description: Specify the page number - in: query - name: page - type: integer + - description: Username + in: path + name: username + required: true + type: string + - description: Number of items per page + in: query + name: per_page + type: integer + - description: Specify the page number + in: query + name: page + type: integer produces: - - application/json + - application/json responses: "200": description: OK @@ -1660,32 +1659,32 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - {} - - Bearer: [] + - {} + - Bearer: [] summary: Returns a paginated list of a user's followers tags: - - User + - User /users/{username}/following/: get: consumes: - - application/json + - application/json description: List of users a user follows. parameters: - - description: Username - in: path - name: username - required: true - type: string - - description: Number of items per page - in: query - name: per_page - type: integer - - description: Specify the page number - in: query - name: page - type: integer + - description: Username + in: path + name: username + required: true + type: string + - description: Number of items per page + in: query + name: per_page + type: integer + - description: Specify the page number + in: query + name: page + type: integer produces: - - application/json + - application/json responses: "200": description: OK @@ -1704,32 +1703,32 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - {} - - Bearer: [] + - {} + - Bearer: [] summary: Returns a paginated list of a user's following tags: - - User + - User /users/{username}/likes/: get: consumes: - - application/json + - application/json description: List of likes of a user. parameters: - - description: Username - in: path - name: username - required: true - type: string - - description: Number of items per page - in: query - name: per_page - type: integer - - description: Specify the page number - in: query - name: page - type: integer + - description: Username + in: path + name: username + required: true + type: string + - description: Number of items per page + in: query + name: per_page + type: integer + - description: Specify the page number + in: query + name: page + type: integer produces: - - application/json + - application/json responses: "200": description: OK @@ -1748,30 +1747,30 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - {} - - Bearer: [] + - {} + - Bearer: [] summary: Returns a paginated list of a user's likes tags: - - User + - User /users/{username}/password/: post: consumes: - - application/json + - application/json description: Change password for logged-in users. parameters: - - description: Username - in: path - name: username - required: true - type: string - - description: User data - in: body - name: data - required: true - schema: - $ref: '#/definitions/user.UpdateUserRequest' + - description: Username + in: path + name: username + required: true + type: string + - description: User data + in: body + name: data + required: true + schema: + $ref: '#/definitions/user.UpdateUserRequest' produces: - - application/json + - application/json responses: "200": description: OK @@ -1790,31 +1789,31 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Update password for authenticated users tags: - - User + - User /users/{username}/submissions/: get: consumes: - - application/json + - application/json description: List of submissions by a user. parameters: - - description: Username - in: path - name: username - required: true - type: string - - description: Number of items per page - in: query - name: per_page - type: integer - - description: Specify the page number - in: query - name: page - type: integer + - description: Username + in: path + name: username + required: true + type: string + - description: Number of items per page + in: query + name: per_page + type: integer + - description: Specify the page number + in: query + name: page + type: integer produces: - - application/json + - application/json responses: "200": description: OK @@ -1833,24 +1832,24 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - {} - - Bearer: [] + - {} + - Bearer: [] summary: Returns a paginated list of a user's submissions tags: - - User + - User /users/{username}/unfollow/: post: consumes: - - application/json + - application/json description: Stop following a user. parameters: - - description: Target user to unfollow - in: path - name: username - required: true - type: string + - description: Target user to unfollow + in: path + name: username + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -1869,26 +1868,26 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - Bearer: [] + - Bearer: [] summary: Unfollow a user tags: - - User + - User /users/activities/: get: consumes: - - application/json + - application/json description: List of activities of a user. parameters: - - description: Number of items per page - in: query - name: per_page - type: integer - - description: Specify the page number - in: query - name: page - type: integer + - description: Number of items per page + in: query + name: per_page + type: integer + - description: Specify the page number + in: query + name: page + type: integer produces: - - application/json + - application/json responses: "200": description: OK @@ -1907,13 +1906,13 @@ paths: schema: $ref: '#/definitions/errors.ErrorResponse' security: - - {} - - Bearer: [] + - {} + - Bearer: [] summary: Returns a paginated list of a user's activities tags: - - Activity + - Activity schemes: -- https + - https securityDefinitions: Bearer: description: Enter the token with the `Bearer ` prefix, e.g. "Bearer abcde12345".