Skip to content

Commit

Permalink
Update openapi specification and skip unimplemented endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
iainsproat committed Dec 31, 2024
1 parent 7691195 commit 1b7cd28
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 31 deletions.
4 changes: 3 additions & 1 deletion setup/fuzzer/dictionary.restler.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"restler_fuzzable_number": ["1.23"],
"restler_fuzzable_bool": ["true"],
"restler_fuzzable_object": ["{ \"fuzz\": false }"],
"restler_custom_payload": {},
"restler_custom_payload": {
"/graphql/post/Content-Type": ["application/json"]
},
"restler_custom_payload_unquoted": {},
"restler_custom_payload_uuid4_suffix": {},
"restler_custom_payload_header": {},
Expand Down
8 changes: 7 additions & 1 deletion setup/fuzzer/settings.restler.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
"max_combinations": 20,
"target_ip": "127.0.0.1",
"target_port": 3000,
"ignore_decoding_failures": true
"ignore_decoding_failures": true,
"exclude_requests": [
{
"endpoint": "/api/stream/{streamId}/blobs",
"methods": ["DELETE"]
}
]
}
199 changes: 170 additions & 29 deletions setup/fuzzer/speckle-server.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,32 @@
},
"/auth/local/login": {
"post": {
"parameters": [
{
"in": "query",
"name": "challenge",
"required": true,
"schema": { "type": "string" }
}
],
"description": "Login with email and password",
"responses": {
"200": { "description": "User logged in successfully" },
"400": { "description": "Invalid input" },
"401": { "description": "Invalid credentials" }
}
}
},
"/auth/local/register": {
"post": {
"parameters": [
{
"in": "query",
"name": "challenge",
"required": true,
"schema": { "type": "string" }
}
],
"description": "Register with email and password",
"responses": {
"200": { "description": "User registered successfully" },
Expand All @@ -37,6 +54,14 @@
},
"/auth/accesscode": {
"get": {
"parameters": [
{
"in": "query",
"name": "appId",
"required": true,
"schema": { "type": "string" }
}
],
"description": "Generates an access code for an app.",
"responses": {
"200": { "description": "Returns an access code in the body" },
Expand All @@ -55,7 +80,27 @@
"/auth/token": {
"post": {
"description": "Generates a new API token",
"responses": { "200": { "description": "Generates a new API token" } }
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"appId": { "type": "string" },
"appSecret": { "type": "string" },
"accessCode": { "type": "string" },
"challenge": { "type": "string" },
"refreshToken": { "type": "string" }
},
"required": ["appId", "appSecret"]
}
}
}
},
"responses": {
"200": { "description": "Generates a new API token" },
"401": { "description": "Unauthorized" }
}
}
},
"/auth/logout": {
Expand All @@ -70,18 +115,43 @@
"/api/stream/{streamId}/blob": {
"post": {
"description": "Upload a new blob to a project (stream)",
"parameters": [{ "in": "path", "name": "streamId", "required": true }],
"parameters": [
{
"in": "path",
"name": "streamId",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "Successfully uploaded a blob to the project"
}
},
"404": { "description": "Stream could not be found" }
}
}
},
"/api/stream/{streamId}/diff": {
"/api/stream/{streamId}/blob/diff": {
"post": {
"description": "Determine the difference (diff) between the provided array of blob Ids and those stored on the server",
"parameters": [{ "in": "path", "name": "streamId", "required": true }],
"parameters": [
{
"in": "path",
"name": "streamId",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "type": "string" }
}
}
}
},
"responses": {
"200": {
"description": "The difference between the list of blob Ids provided in the body of the request and those stored on the server"
Expand All @@ -90,28 +160,37 @@
}
},
"/api/stream/{streamId}/blob/{blobId}": {
"parameters": [
{
"in": "path",
"name": "streamId",
"required": true,
"schema": { "type": "string" }
},
{
"in": "path",
"name": "blobId",
"required": true,
"schema": { "type": "string" }
}
],
"get": {
"description": "Gets a blob from a project (stream)",
"parameters": [
{ "in": "path", "name": "streamId", "required": true },
{ "in": "path", "name": "blobId", "required": true }
],
"responses": {
"200": {
"description": "Successfully retrieved a blob from the project"
}
},
"401": { "description": "Unauthorized" },
"404": { "description": "Stream or blob could not be found." }
}
},
"delete": {
"description": "Deletes a blob from a project (stream)",
"parameters": [
{ "in": "path", "name": "streamId", "required": true },
{ "in": "path", "name": "blobId", "required": true }
],
"responses": {
"204": {
"description": "Successfully deleted a blob from the project"
}
},
"404": { "description": "Stream or blob could not be found." }
}
}
},
Expand All @@ -129,15 +208,17 @@
"responses": {
"200": {
"description": "Successfully retrieved all the blobs from the project"
}
},
"401": { "description": "Unauthorized" },
"404": { "description": "Stream could not be found." }
}
},
"delete": {
"description": "Deletes all the blobs from a project (stream)",
"responses": { "501": { "description": "Not implemented." } }
}
},
"/static": {
"/static/": {
"get": {
"description": "Static assets",
"responses": { "200": { "description": "An asset was retrieved." } }
Expand Down Expand Up @@ -181,7 +262,8 @@
"post": {
"description": "Upload objects to the project (stream)",
"responses": {
"200": { "description": "Objects were successfully uploaded." }
"200": { "description": "Objects were successfully uploaded." },
"401": { "description": "Unauthorized" }
}
}
},
Expand All @@ -206,7 +288,10 @@
},
"get": {
"description": "Download objects from a project (stream)",
"responses": { "200": { "description": "Objects were downloaded." } }
"responses": {
"200": { "description": "Objects were downloaded." },
"401": { "description": "Unauthorized" }
}
}
},
"/objects/{streamId}/{objectId}/single": {
Expand All @@ -230,7 +315,10 @@
},
"get": {
"description": "Options for downloading a single object from a project (stream)",
"responses": { "200": { "description": "An object was retrieved." } }
"responses": {
"200": { "description": "An object was retrieved." },
"401": { "description": "Unauthorized" }
}
}
},
"/api/diff/{streamId}": {
Expand All @@ -248,8 +336,22 @@
},
"post": {
"description": "Options for getting the diff of objects for a project (stream)",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"objects": { "type": "array", "items": { "type": "string" } }
},
"required": ["objects"]
}
}
}
},
"responses": {
"200": { "description": "A diff was successfully computed." }
"200": { "description": "A diff was successfully computed." },
"401": { "description": "Unauthorized" }
}
}
},
Expand All @@ -269,15 +371,32 @@
"post": {
"description": "Get all objects for a project (stream)",
"responses": {
"200": { "description": "All objects were successfully retrieved." }
"200": { "description": "All objects were successfully retrieved." },
"401": { "description": "Unauthorized" }
}
}
},
"/auth/verifyemail": {
"get": {
"summary": "Verify email",
"description": "Verifies an email address",
"responses": { "302": { "description": "Redirects to the home page." } }
"responses": {
"302": {
"description": "Redirects to the home page.",
"headers": {
"Location": {
"schema": { "type": "string" }
}
},
"parameters": [
{
"in": "query",
"name": "emailverifiederror",
"schema": { "type": "string" }
}
]
}
}
}
},
"/api/file/{fileType}/{streamId}/{branchName}": {
Expand All @@ -286,7 +405,12 @@
"in": "path",
"name": "fileType",
"required": true,
"schema": { "type": "string" }
"schema": {
"oneOf": [
{ "type": "string" },
{ "type": "string", "enum": ["autodetect"] }
]
}
},
{
"in": "path",
Expand All @@ -306,6 +430,9 @@
"responses": {
"200": {
"description": "file successfully uploaded to the project (stream)"
},
"404": {
"description": "Stream or branch could not be found."
}
}
}
Expand Down Expand Up @@ -466,10 +593,9 @@
{
"in": "path",
"name": "angle",
"required": true,
"schema": {
"oneOf": [
{ "type": "integer", "minimum": 0 },
{ "type": "integer", "minimum": 0, "maximum": 360 },
{ "type": "string", "enum": ["all"] }
]
}
Expand All @@ -491,22 +617,37 @@
"schema": { "type": "string", "format": "binary" }
}
}
}
},
"403": { "description": "Forbidden" }
}
}
},
"/auth/pwdreset/request": {
"post": {
"description": "Reset a password",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": { "type": "string", "format": "email" }
},
"required": ["email"]
}
}
}
},
"responses": {
"200": {
"description": "The password reset workflow was successfully started."
}
},
"400": { "description": "Invalid input" }
}
}
},
"/auth/pwdreset/finalize": {
"get": {
"post": {
"description": "Finish resetting a password",
"responses": {
"200": { "description": "The password was successfully reset." }
Expand Down

0 comments on commit 1b7cd28

Please sign in to comment.