From 7281d3e80747fc5c44effc11cba7fa40e8144056 Mon Sep 17 00:00:00 2001 From: levis Date: Tue, 4 Jun 2024 12:08:23 +0000 Subject: [PATCH] Push from SwaggerHub. --- .swagger-codegen-ignore | 23 + .swagger-codegen/VERSION | 1 + README.md | 58 --- swagger.yaml | 953 ++++++++++----------------------------- 4 files changed, 273 insertions(+), 762 deletions(-) create mode 100644 .swagger-codegen-ignore create mode 100644 .swagger-codegen/VERSION diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION new file mode 100644 index 0000000..b1d249f --- /dev/null +++ b/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.56 \ No newline at end of file diff --git a/README.md b/README.md index 4c228d7..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,58 +0,0 @@ -# How to host Swagger API documentation with GitHub Pages -[The blog of Peter Evans: How to Host Swagger Documentation With Github Pages](https://peterevans.dev/posts/how-to-host-swagger-docs-with-github-pages/) - -This repository is a template for using the [Swagger UI](https://github.com/swagger-api/swagger-ui) to dynamically generate beautiful documentation for your API and host it for free with GitHub Pages. - -The template will periodically auto-update the Swagger UI dependency and create a pull request. See the [GitHub Actions workflow here](.github/workflows/update-swagger.yml). - -The example API specification used by this repository can be seen hosted at [https://peter-evans.github.io/swagger-github-pages](https://peter-evans.github.io/swagger-github-pages/). - -## Steps to use this template - -1. Click the `Use this template` button above to create a new repository from this template. - -2. Go to the settings for your repository at `https://github.com/{github-username}/{repository-name}/settings` and enable GitHub Pages. - - ![Headers](/screenshots/swagger-github-pages.png?raw=true) - -3. Browse to the Swagger documentation at `https://{github-username}.github.io/{repository-name}/`. - - -## Steps to manually configure in your own repository - -1. Download the latest stable release of the Swagger UI [here](https://github.com/swagger-api/swagger-ui/releases). - -2. Extract the contents and copy the "dist" directory to the root of your repository. - -3. Move the file "index.html" from the directory "dist" to the root of your repository. - ``` - mv dist/index.html . - ``` - -4. Copy the YAML specification file for your API to the root of your repository. - -5. Edit [dist/swagger-initializer.js](dist/swagger-initializer.js) and change the `url` property to reference your local YAML file. - ```javascript - window.ui = SwaggerUIBundle({ - url: "swagger.yaml", - ... - ``` - Then fix any references to files in the "dist" directory. - ```html - ... - - - - ... - - - ... - ``` - -6. Go to the settings for your repository at `https://github.com/{github-username}/{repository-name}/settings` and enable GitHub Pages. - - ![Headers](/screenshots/swagger-github-pages.png?raw=true) - -7. Browse to the Swagger documentation at `https://{github-username}.github.io/{repository-name}/`. - - The example API specification used by this repository can be seen hosted at [https://peter-evans.github.io/swagger-github-pages](https://peter-evans.github.io/swagger-github-pages/). diff --git a/swagger.yaml b/swagger.yaml index 62ada60..788a01d 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -1,718 +1,263 @@ ---- -swagger: "2.0" +openapi: 3.0.0 info: - description: "This is a sample server Petstore server. You can find out more about\ - \ Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\ - \ For this sample, you can use the api key `special-key` to test the authorization\ - \ filters." - version: "1.0.5" - title: "Swagger Petstore" - termsOfService: "http://swagger.io/terms/" + title: Wikey FIDO2 server API + description: This is wikey FIDO2 server API contact: - email: "apiteam@swagger.io" + email: levi@wikey.ai license: - name: "Apache 2.0" - url: "http://www.apache.org/licenses/LICENSE-2.0.html" -host: "petstore.swagger.io" -basePath: "/v2" -tags: -- name: "pet" - description: "Everything about your Pets" - externalDocs: - description: "Find out more" - url: "http://swagger.io" -- name: "store" - description: "Access to Petstore orders" -- name: "user" - description: "Operations about user" - externalDocs: - description: "Find out more about our store" - url: "http://swagger.io" -schemes: -- "https" -- "http" + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + version: 1.0.0 +servers: +- url: https://your-own-fido2-server.com + description: this should be your own wikey fido2 server paths: - /pet/{petId}/uploadImage: + /api/registration/begin: post: - tags: - - "pet" - summary: "uploads an image" - description: "" - operationId: "uploadFile" - consumes: - - "multipart/form-data" - produces: - - "application/json" - parameters: - - name: "petId" - in: "path" - description: "ID of pet to update" - required: true - type: "integer" - format: "int64" - - name: "additionalMetadata" - in: "formData" - description: "Additional data to pass to server" - required: false - type: "string" - - name: "file" - in: "formData" - description: "file to upload" - required: false - type: "file" + summary: Start FIDO2 registration + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterRequest' responses: - 200: - description: "successful operation" - schema: - $ref: "#/definitions/ApiResponse" - security: - - petstore_auth: - - "write:pets" - - "read:pets" - /pet: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterResponse' + "400": + description: bad request + "500": + description: internal server error + /api/registration/complete: post: - tags: - - "pet" - summary: "Add a new pet to the store" - description: "" - operationId: "addPet" - consumes: - - "application/json" - - "application/xml" - produces: - - "application/json" - - "application/xml" - parameters: - - in: "body" - name: "body" - description: "Pet object that needs to be added to the store" - required: true - schema: - $ref: "#/definitions/Pet" + summary: Complete FIDO2 registration + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompleteRegisterRequest' responses: - 405: - description: "Invalid input" - security: - - petstore_auth: - - "write:pets" - - "read:pets" - put: - tags: - - "pet" - summary: "Update an existing pet" - description: "" - operationId: "updatePet" - consumes: - - "application/json" - - "application/xml" - produces: - - "application/json" - - "application/xml" - parameters: - - in: "body" - name: "body" - description: "Pet object that needs to be added to the store" - required: true - schema: - $ref: "#/definitions/Pet" - responses: - 400: - description: "Invalid ID supplied" - 404: - description: "Pet not found" - 405: - description: "Validation exception" - security: - - petstore_auth: - - "write:pets" - - "read:pets" - /pet/findByStatus: - get: - tags: - - "pet" - summary: "Finds Pets by status" - description: "Multiple status values can be provided with comma separated strings" - operationId: "findPetsByStatus" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "status" - in: "query" - description: "Status values that need to be considered for filter" - required: true - type: "array" - items: - type: "string" - enum: - - "available" - - "pending" - - "sold" - default: "available" - collectionFormat: "multi" - responses: - 200: - description: "successful operation" - schema: - type: "array" - items: - $ref: "#/definitions/Pet" - 400: - description: "Invalid status value" - security: - - petstore_auth: - - "write:pets" - - "read:pets" - /pet/findByTags: - get: - tags: - - "pet" - summary: "Finds Pets by tags" - description: "Multiple tags can be provided with comma separated strings. Use\ - \ tag1, tag2, tag3 for testing." - operationId: "findPetsByTags" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "tags" - in: "query" - description: "Tags to filter by" - required: true - type: "array" - items: - type: "string" - collectionFormat: "multi" - responses: - 200: - description: "successful operation" - schema: - type: "array" - items: - $ref: "#/definitions/Pet" - 400: - description: "Invalid tag value" - security: - - petstore_auth: - - "write:pets" - - "read:pets" - deprecated: true - /pet/{petId}: - get: - tags: - - "pet" - summary: "Find pet by ID" - description: "Returns a single pet" - operationId: "getPetById" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "petId" - in: "path" - description: "ID of pet to return" - required: true - type: "integer" - format: "int64" - responses: - 200: - description: "successful operation" - schema: - $ref: "#/definitions/Pet" - 400: - description: "Invalid ID supplied" - 404: - description: "Pet not found" - security: - - api_key: [] + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/CompleteResponse' + "400": + description: bad request + "500": + description: internal server error + /api/authentication/begin: post: - tags: - - "pet" - summary: "Updates a pet in the store with form data" - description: "" - operationId: "updatePetWithForm" - consumes: - - "application/x-www-form-urlencoded" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "petId" - in: "path" - description: "ID of pet that needs to be updated" - required: true - type: "integer" - format: "int64" - - name: "name" - in: "formData" - description: "Updated name of the pet" - required: false - type: "string" - - name: "status" - in: "formData" - description: "Updated status of the pet" - required: false - type: "string" - responses: - 405: - description: "Invalid input" - security: - - petstore_auth: - - "write:pets" - - "read:pets" - delete: - tags: - - "pet" - summary: "Deletes a pet" - description: "" - operationId: "deletePet" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "api_key" - in: "header" - required: false - type: "string" - - name: "petId" - in: "path" - description: "Pet id to delete" - required: true - type: "integer" - format: "int64" + summary: Start FIDO2 authentication + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticateRequest' responses: - 400: - description: "Invalid ID supplied" - 404: - description: "Pet not found" - security: - - petstore_auth: - - "write:pets" - - "read:pets" - /store/order: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticateResponse' + "400": + description: bad request + "500": + description: internal server error + /api/authentication/complete: post: - tags: - - "store" - summary: "Place an order for a pet" - description: "" - operationId: "placeOrder" - consumes: - - "application/json" - produces: - - "application/json" - - "application/xml" - parameters: - - in: "body" - name: "body" - description: "order placed for purchasing the pet" - required: true - schema: - $ref: "#/definitions/Order" - responses: - 200: - description: "successful operation" - schema: - $ref: "#/definitions/Order" - 400: - description: "Invalid Order" - /store/order/{orderId}: - get: - tags: - - "store" - summary: "Find purchase order by ID" - description: "For valid response try integer IDs with value >= 1 and <= 10.\ - \ Other values will generated exceptions" - operationId: "getOrderById" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "orderId" - in: "path" - description: "ID of pet that needs to be fetched" - required: true - type: "integer" - maximum: 10 - minimum: 1 - format: "int64" + summary: Complete FIDO2 authentication + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompleteResponse' responses: - 200: - description: "successful operation" - schema: - $ref: "#/definitions/Order" - 400: - description: "Invalid ID supplied" - 404: - description: "Order not found" - delete: - tags: - - "store" - summary: "Delete purchase order by ID" - description: "For valid response try integer IDs with positive integer value.\ - \ Negative or non-integer values will generate API errors" - operationId: "deleteOrder" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "orderId" - in: "path" - description: "ID of the order that needs to be deleted" - required: true - type: "integer" - minimum: 1 - format: "int64" - responses: - 400: - description: "Invalid ID supplied" - 404: - description: "Order not found" - /store/inventory: - get: - tags: - - "store" - summary: "Returns pet inventories by status" - description: "Returns a map of status codes to quantities" - operationId: "getInventory" - produces: - - "application/json" - parameters: [] - responses: - 200: - description: "successful operation" - schema: - type: "object" - additionalProperties: - type: "integer" - format: "int32" - security: - - api_key: [] - /user/createWithArray: - post: - tags: - - "user" - summary: "Creates list of users with given input array" - description: "" - operationId: "createUsersWithArrayInput" - consumes: - - "application/json" - produces: - - "application/json" - - "application/xml" - parameters: - - in: "body" - name: "body" - description: "List of user object" - required: true - schema: - type: "array" + "200": + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticateResponse' + "400": + description: bad request + "500": + description: internal server error +components: + schemas: + RegisterRequest: + type: object + properties: + username: + type: string + format: email + CompleteRegisterRequest: + type: object + properties: + username: + type: string + format: email + response: + $ref: '#/components/schemas/CredentialCreationResponse' + AuthenticateRequest: + type: object + properties: + username: + type: string + format: email + cache_key: + type: string + format: uuid + CompleteAuthenticateRequest: + type: object + properties: + username: + type: string + format: email + cache_key: + type: string + format: uuid + response: + $ref: '#/components/schemas/CredentialAssertionResponse' + RegisterResponse: + type: object + properties: + publicKey: + $ref: '#/components/schemas/RegisterResponse_publicKey' + AuthenticateResponse: + type: object + properties: + challenge: + type: string + allowCredentials: + type: array items: - $ref: "#/definitions/User" - responses: - default: - description: "successful operation" - /user/createWithList: - post: - tags: - - "user" - summary: "Creates list of users with given input array" - description: "" - operationId: "createUsersWithListInput" - consumes: - - "application/json" - produces: - - "application/json" - - "application/xml" - parameters: - - in: "body" - name: "body" - description: "List of user object" - required: true - schema: - type: "array" + $ref: '#/components/schemas/PublicKeyCredentialDescriptor' + userVerification: + type: string + RelyingParty: + type: object + properties: + id: + type: string + name: + type: string + User: + type: object + properties: + id: + type: string + name: + type: string + displayName: + type: string + PublicKeyCredentialParameters: + type: object + properties: + type: + type: string + alg: + type: integer + PublicKeyCredentialDescriptor: + type: object + properties: + type: + type: string + id: + type: string + transports: + type: array items: - $ref: "#/definitions/User" - responses: - default: - description: "successful operation" - /user/{username}: - get: - tags: - - "user" - summary: "Get user by user name" - description: "" - operationId: "getUserByName" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "username" - in: "path" - description: "The name that needs to be fetched. Use user1 for testing. " - required: true - type: "string" - responses: - 200: - description: "successful operation" - schema: - $ref: "#/definitions/User" - 400: - description: "Invalid username supplied" - 404: - description: "User not found" - put: - tags: - - "user" - summary: "Updated user" - description: "This can only be done by the logged in user." - operationId: "updateUser" - consumes: - - "application/json" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "username" - in: "path" - description: "name that need to be updated" - required: true - type: "string" - - in: "body" - name: "body" - description: "Updated user object" - required: true - schema: - $ref: "#/definitions/User" - responses: - 400: - description: "Invalid user supplied" - 404: - description: "User not found" - delete: - tags: - - "user" - summary: "Delete user" - description: "This can only be done by the logged in user." - operationId: "deleteUser" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "username" - in: "path" - description: "The name that needs to be deleted" - required: true - type: "string" - responses: - 400: - description: "Invalid username supplied" - 404: - description: "User not found" - /user/login: - get: - tags: - - "user" - summary: "Logs user into the system" - description: "" - operationId: "loginUser" - produces: - - "application/json" - - "application/xml" - parameters: - - name: "username" - in: "query" - description: "The user name for login" - required: true - type: "string" - - name: "password" - in: "query" - description: "The password for login in clear text" - required: true - type: "string" - responses: - 200: - description: "successful operation" - headers: - X-Expires-After: - type: "string" - format: "date-time" - description: "date in UTC when token expires" - X-Rate-Limit: - type: "integer" - format: "int32" - description: "calls per hour allowed by the user" - schema: - type: "string" - 400: - description: "Invalid username/password supplied" - /user/logout: - get: - tags: - - "user" - summary: "Logs out current logged in user session" - description: "" - operationId: "logoutUser" - produces: - - "application/json" - - "application/xml" - parameters: [] - responses: - default: - description: "successful operation" - /user: - post: - tags: - - "user" - summary: "Create user" - description: "This can only be done by the logged in user." - operationId: "createUser" - consumes: - - "application/json" - produces: - - "application/json" - - "application/xml" - parameters: - - in: "body" - name: "body" - description: "Created user object" - required: true - schema: - $ref: "#/definitions/User" - responses: - default: - description: "successful operation" -securityDefinitions: - api_key: - type: "apiKey" - name: "api_key" - in: "header" - petstore_auth: - type: "oauth2" - authorizationUrl: "https://petstore.swagger.io/oauth/authorize" - flow: "implicit" - scopes: - read:pets: "read your pets" - write:pets: "modify pets in your account" -definitions: - ApiResponse: - type: "object" - properties: - code: - type: "integer" - format: "int32" - type: - type: "string" - message: - type: "string" - Category: - type: "object" - properties: - id: - type: "integer" - format: "int64" - name: - type: "string" - xml: - name: "Category" - Pet: - type: "object" - required: - - "name" - - "photoUrls" - properties: - id: - type: "integer" - format: "int64" - category: - $ref: "#/definitions/Category" - name: - type: "string" - example: "doggie" - photoUrls: - type: "array" - xml: - wrapped: true - items: - type: "string" - xml: - name: "photoUrl" - tags: - type: "array" - xml: - wrapped: true - items: - xml: - name: "tag" - $ref: "#/definitions/Tag" - status: - type: "string" - description: "pet status in the store" - enum: - - "available" - - "pending" - - "sold" - xml: - name: "Pet" - Tag: - type: "object" - properties: - id: - type: "integer" - format: "int64" - name: - type: "string" - xml: - name: "Tag" - Order: - type: "object" - properties: - id: - type: "integer" - format: "int64" - petId: - type: "integer" - format: "int64" - quantity: - type: "integer" - format: "int32" - shipDate: - type: "string" - format: "date-time" - status: - type: "string" - description: "Order Status" - enum: - - "placed" - - "approved" - - "delivered" - complete: - type: "boolean" - xml: - name: "Order" - User: - type: "object" - properties: - id: - type: "integer" - format: "int64" - username: - type: "string" - firstName: - type: "string" - lastName: - type: "string" - email: - type: "string" - password: - type: "string" - phone: - type: "string" - userStatus: - type: "integer" - format: "int32" - description: "User Status" - xml: - name: "User" -externalDocs: - description: "Find out more about Swagger" - url: "http://swagger.io" + type: string + CredentialCreationResponse: + type: object + properties: + rawId: + type: string + response: + $ref: '#/components/schemas/AuthenticatorAttestationResponse' + type: + type: string + transports: + type: array + items: + type: string + CredentialAssertionResponse: + required: + - authenticatorData + - clientDataJSON + - rawResponse + - signature + - userHandle + type: object + properties: + rawResponse: + type: string + description: The raw response from the authenticator. + format: binary + signature: + type: string + description: The signature of the authenticator response. + format: binary + userHandle: + type: string + description: The user handle associated with the credential. + format: binary + authenticatorData: + type: string + description: The authenticator data returned by the authenticator. + format: binary + clientDataJSON: + type: string + description: The client data JSON sent to the authenticator. + format: binary + extensions: + type: object + additionalProperties: + type: string + format: binary + description: Extensions returned by the authenticator. + AuthenticatorAttestationResponse: + type: object + properties: + attestationObject: + type: string + authenticatorData: + type: string + clientDataJSON: + type: string + CompleteResponse: + required: + - verified + type: object + properties: + verified: + type: boolean + RegisterResponse_publicKey: + type: object + properties: + challenge: + type: string + rp: + $ref: '#/components/schemas/RelyingParty' + user: + $ref: '#/components/schemas/User' + pubKeyCredParams: + type: array + items: + $ref: '#/components/schemas/PublicKeyCredentialParameters' + timeout: + type: integer + attestation: + type: string + excludeCredentials: + type: array + items: + $ref: '#/components/schemas/PublicKeyCredentialDescriptor' + extensions: + type: object