From 575e6eb8a326e44cb89d50a1139c514670754961 Mon Sep 17 00:00:00 2001 From: NoahMaizels Date: Wed, 12 Mar 2025 13:50:09 +0700 Subject: [PATCH 1/2] removed auth from openapi specs --- openapi/Swarm.yaml | 76 ++-------------------------------------------- 1 file changed, 3 insertions(+), 73 deletions(-) diff --git a/openapi/Swarm.yaml b/openapi/Swarm.yaml index 8749081bf..654872a44 100644 --- a/openapi/Swarm.yaml +++ b/openapi/Swarm.yaml @@ -1175,8 +1175,6 @@ paths: "/balances": get: summary: Get the balances with all known peers including prepaid services - security: - - bearerAuth: [] tags: - Balance responses: @@ -1193,9 +1191,7 @@ paths: "/balances/{address}": get: - summary: Get the balances with a specific peer including prepaid services - security: - - bearerAuth: [] + summary: Get the balances with a specific peer including prepaid services tags: - Balance parameters: @@ -1222,8 +1218,6 @@ paths: "/blocklist": get: summary: Get a list of blocklisted peers - security: - - bearerAuth: [] tags: - Connectivity responses: @@ -1240,9 +1234,7 @@ paths: "/consumed": get: - summary: Get the past due consumption balances with all known peers - security: - - bearerAuth: [] + summary: Get the past due consumption balances with all known peers tags: - Balance responses: @@ -1260,8 +1252,6 @@ paths: "/consumed/{address}": get: summary: Get the past due consumption balance with a specific peer - security: - - bearerAuth: [] tags: - Balance parameters: @@ -1288,8 +1278,6 @@ paths: "/chequebook/address": get: summary: Get the address of the chequebook contract used - security: - - bearerAuth: [] tags: - Chequebook responses: @@ -1303,8 +1291,6 @@ paths: "/chequebook/balance": get: summary: Get the balance of the chequebook - security: - - bearerAuth: [] tags: - Chequebook responses: @@ -1409,8 +1395,6 @@ paths: "/connect/{multiAddress}": post: summary: Connect to address - security: - - bearerAuth: [] tags: - Connectivity parameters: @@ -1438,8 +1422,6 @@ paths: "/reservestate": get: summary: Get reserve state - security: - - bearerAuth: [] tags: - Status responses: @@ -1455,8 +1437,6 @@ paths: "/chainstate": get: summary: Get chain state - security: - - bearerAuth: [] tags: - Status responses: @@ -1487,8 +1467,6 @@ paths: "/peers": get: summary: Get a list of peers - security: - - bearerAuth: [] tags: - Connectivity responses: @@ -1504,8 +1482,6 @@ paths: "/peers/{address}": delete: summary: Remove peer - security: - - bearerAuth: [] tags: - Connectivity parameters: @@ -1532,8 +1508,6 @@ paths: "/pingpong/{address}": post: summary: Try connection to node - security: - - bearerAuth: [] tags: - Connectivity parameters: @@ -1562,8 +1536,6 @@ paths: "/settlements/{address}": get: summary: Get amount of sent and received from settlements with a peer - security: - - bearerAuth: [] tags: - Settlements parameters: @@ -1590,8 +1562,6 @@ paths: "/settlements": get: summary: Get settlements with all known peers and total amount sent or received - security: - - bearerAuth: [] tags: - Settlements responses: @@ -1609,8 +1579,6 @@ paths: "/timesettlements": get: summary: Get time based settlements with all known peers and total amount sent or received - security: - - bearerAuth: [] tags: - Settlements responses: @@ -1628,8 +1596,6 @@ paths: "/topology": get: summary: Get topology of known network - security: - - bearerAuth: [] tags: - Connectivity responses: @@ -1643,8 +1609,6 @@ paths: "/welcome-message": get: summary: Get configured P2P welcome message - security: - - bearerAuth: [] tags: - Connectivity responses: @@ -1660,8 +1624,6 @@ paths: description: Default response post: summary: Set P2P welcome message - security: - - bearerAuth: [] tags: - Connectivity requestBody: @@ -1686,8 +1648,6 @@ paths: "/chequebook/cashout/{peer-id}": get: summary: Get last cashout action for the peer - security: - - bearerAuth: [] parameters: - in: path name: peer-id @@ -1712,8 +1672,6 @@ paths: description: Default response post: summary: Cashout the last cheque for the peer - security: - - bearerAuth: [] parameters: - in: path name: peer-id @@ -1744,8 +1702,6 @@ paths: "/chequebook/cheque/{peer-id}": get: summary: Get last cheques for the peer - security: - - bearerAuth: [] parameters: - in: path name: peer-id @@ -1772,8 +1728,6 @@ paths: "/chequebook/cheque": get: summary: Get last cheques for all peers - security: - - bearerAuth: [] tags: - Chequebook responses: @@ -1793,8 +1747,6 @@ paths: "/chequebook/deposit": post: summary: Deposit tokens from overlay address into chequebook - security: - - bearerAuth: [] parameters: - in: query name: amount @@ -1822,8 +1774,6 @@ paths: "/chequebook/withdraw": post: summary: Withdraw tokens from the chequebook to the overlay address - security: - - bearerAuth: [] parameters: - in: query name: amount @@ -1943,8 +1893,6 @@ paths: "/stamps": get: summary: Get stamps for this node - security: - - bearerAuth: [] tags: - Postage Stamps responses: @@ -1970,8 +1918,6 @@ paths: description: Swarm address of the stamp get: summary: Get an individual postage batch status - security: - - bearerAuth: [] tags: - Postage Stamps responses: @@ -1998,8 +1944,6 @@ paths: description: Swarm address of the stamp get: summary: Get extended bucket data of a batch - security: - - bearerAuth: [] tags: - Postage Stamps responses: @@ -2018,9 +1962,7 @@ paths: "/stamps/{amount}/{depth}": post: - summary: Buy a new postage batch. - security: - - bearerAuth: [] + summary: Buy a new postage batch description: | Be aware, this endpoint creates an on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance! tags: @@ -2148,8 +2090,6 @@ paths: "/batches": get: summary: Get all globally available batches that were purchased by all nodes. - security: - - bearerAuth: [] tags: - Postage Stamps responses: @@ -2499,13 +2439,3 @@ paths: default: description: Default response. -components: - securitySchemes: - basicAuth: - type: http - scheme: basic - - bearerAuth: - type: http - scheme: bearer - bearerFormat: SecurityToken From 5aa9607d11f704055c0c84e38d56a8bb6187be5c Mon Sep 17 00:00:00 2001 From: NoahMaizels Date: Thu, 13 Mar 2025 07:30:35 +0700 Subject: [PATCH 2/2] remove remaining auth related entries --- openapi/Swarm.yaml | 80 ++++++++++++++++++++-------------------- openapi/SwarmCommon.yaml | 34 +++++------------ 2 files changed, 50 insertions(+), 64 deletions(-) diff --git a/openapi/Swarm.yaml b/openapi/Swarm.yaml index 654872a44..04c17b0ee 100644 --- a/openapi/Swarm.yaml +++ b/openapi/Swarm.yaml @@ -1,13 +1,10 @@ openapi: 3.0.3 info: - version: 7.2.0 + version: 7.3.0 title: Bee API description: "A list of the currently provided Interfaces to interact with the swarm, implementing file operations and sending messages" -security: - - {} - externalDocs: description: Browse the documentation @ the Swarm Docs url: "https://docs.ethswarm.org" @@ -70,7 +67,7 @@ paths: $ref: "SwarmCommon.yaml#/components/schemas/ActGranteesCreateRequest" responses: "201": - description: Ok + description: OK content: application/json: schema: @@ -94,7 +91,7 @@ paths: description: Grantee list reference responses: "200": - description: Ok + description: OK content: application/json: schema: @@ -150,7 +147,7 @@ paths: $ref: "SwarmCommon.yaml#/components/schemas/ActGranteesPatchRequest" responses: "200": - description: Ok + description: OK content: application/json: schema: @@ -205,7 +202,7 @@ paths: format: binary responses: "201": - description: Ok + description: OK headers: "swarm-tag": $ref: "SwarmCommon.yaml#/components/headers/SwarmTag" @@ -318,7 +315,7 @@ paths: format: binary responses: "201": - description: Ok + description: OK headers: "swarm-tag": description: Tag UID if it was passed to the request `swarm-tag` header. @@ -405,7 +402,7 @@ paths: format: binary responses: "201": - description: Ok + description: OK headers: "swarm-tag": $ref: "SwarmCommon.yaml#/components/headers/SwarmTag" @@ -448,7 +445,7 @@ paths: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress" responses: "200": - description: Ok + description: OK # "swarm-feed-index": # $ref: "SwarmCommon.yaml#/components/headers/SwarmFeedIndex" content: @@ -511,7 +508,7 @@ paths: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmChunkRetrievalTimeoutParameter" responses: "200": - description: Ok + description: OK content: application/octet-stream: schema: @@ -654,7 +651,7 @@ paths: $ref: "SwarmCommon.yaml#/components/schemas/Address" responses: "200": - description: Ok + description: OK content: application/json: schema: @@ -1111,7 +1108,7 @@ paths: description: Postage batch to use for re-upload. If none is provided and the file was uploaded on the same node before, it will reuse the same batch. If not found, it will return error. If a new batch is provided, the chunks are stamped again with the new batch. responses: "200": - description: Ok + description: OK "400": $ref: "SwarmCommon.yaml#/components/responses/400" "404": @@ -1191,7 +1188,7 @@ paths: "/balances/{address}": get: - summary: Get the balances with a specific peer including prepaid services + summary: Get the balances with a specific peer including prepaid services tags: - Balance parameters: @@ -1234,7 +1231,7 @@ paths: "/consumed": get: - summary: Get the past due consumption balances with all known peers + summary: Get the past due consumption balances with all known peers tags: - Balance responses: @@ -1378,7 +1375,7 @@ paths: required: true responses: "201": - description: Ok + description: OK content: application/json: schema: @@ -1962,7 +1959,7 @@ paths: "/stamps/{amount}/{depth}": post: - summary: Buy a new postage batch + summary: Buy a new postage batch. description: | Be aware, this endpoint creates an on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance! tags: @@ -2228,20 +2225,6 @@ paths: default: description: Default response - "/stake/migrate": - post: - summary: Withdraws all past staked amount back to the wallet. - description: Be aware, the endpoint call only be called when the contract is paused and is in the process of being migrated to a new contract. - tags: - - Staking - responses: - "200": - $ref: "SwarmCommon.yaml#/components/schemas/StakeTransactionResponse" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - "/stake/withdrawable": get: summary: Get the withdrawable staked amount. @@ -2250,7 +2233,11 @@ paths: - Staking responses: "200": - $ref: "SwarmCommon.yaml#/components/schemas/GetWithdrawableResponse" + description: OK + content: + application/json: + schema: + $ref: "SwarmCommon.yaml#/components/schemas/GetWithdrawableResponse" "500": $ref: "SwarmCommon.yaml#/components/responses/500" default: @@ -2265,7 +2252,11 @@ paths: - $ref: "SwarmCommon.yaml#/components/parameters/GasLimitParameter" responses: "200": - $ref: "SwarmCommon.yaml#/components/schemas/StakeTransactionResponse" + description: OK + content: + application/json: + schema: + $ref: "SwarmCommon.yaml#/components/schemas/StakeTransactionResponse" "400": $ref: "SwarmCommon.yaml#/components/responses/400" "500": @@ -2290,7 +2281,11 @@ paths: - $ref: "SwarmCommon.yaml#/components/parameters/GasLimitParameter" responses: "200": - $ref: "SwarmCommon.yaml#/components/schemas/StakeTransactionResponse" + description: OK + content: + application/json: + schema: + $ref: "SwarmCommon.yaml#/components/schemas/StakeTransactionResponse" "400": $ref: "SwarmCommon.yaml#/components/responses/400" "500": @@ -2306,7 +2301,11 @@ paths: - Staking responses: "200": - $ref: "SwarmCommon.yaml#/components/schemas/GetStakeResponse" + description: OK + content: + application/json: + schema: + $ref: "SwarmCommon.yaml#/components/schemas/GetStakeResponse" "500": $ref: "SwarmCommon.yaml#/components/responses/500" default: @@ -2321,7 +2320,11 @@ paths: - $ref: "SwarmCommon.yaml#/components/parameters/GasLimitParameter" responses: "200": - $ref: "SwarmCommon.yaml#/components/schemas/StakeTransactionResponse" + description: OK + content: + application/json: + schema: + $ref: "SwarmCommon.yaml#/components/schemas/StakeTransactionResponse" "400": $ref: "SwarmCommon.yaml#/components/responses/400" "500": @@ -2416,7 +2419,7 @@ paths: content: application/json: schema: - $ref: "SwarmCommon.yaml#/components/schemas/StatusResponse" + $ref: "SwarmCommon.yaml#/components/schemas/StatusPeersResponse" "400": $ref: "SwarmCommon.yaml#/components/responses/400" default: @@ -2438,4 +2441,3 @@ paths: $ref: "SwarmCommon.yaml#/components/responses/400" default: description: Default response. - diff --git a/openapi/SwarmCommon.yaml b/openapi/SwarmCommon.yaml index b8e97efc6..e4c30bc71 100644 --- a/openapi/SwarmCommon.yaml +++ b/openapi/SwarmCommon.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - version: 4.2.0 + version: 4.3.0 title: Common Data Types description: | \*****bzzz***** @@ -29,6 +29,8 @@ components: $ref: "#/components/schemas/P2PUnderlay" ethereum: $ref: "#/components/schemas/EthereumAddress" + chain_address: + $ref: "#/components/schemas/EthereumAddress" publicKey: $ref: "#/components/schemas/PublicKey" pssPublicKey: @@ -828,24 +830,6 @@ components: isRetrievable: type: boolean - SecurityTokenRequest: - type: object - properties: - role: - type: string - nullable: false - expiry: - type: integer - nullable: false - description: Expiration time in seconds - - SecurityTokenResponse: - type: object - properties: - key: - type: string - nullable: false - LoggerExp: type: string description: Base 64 encoded regular expression or subsystem string. @@ -897,6 +881,8 @@ components: properties: overlay: $ref: "#/components/schemas/SwarmAddress" + proximity: + type: integer beeMode: type: string enum: @@ -905,8 +891,6 @@ components: - "dev" - "ultra-light" - "unknown" - proximity: - type: integer reserveSize: type: integer reserveSizeWithinRadius: @@ -922,7 +906,7 @@ components: requestFailed: nullable: true type: boolean - BatchCommitment: + batchCommitment: type: integer isReachable: type: boolean @@ -931,10 +915,10 @@ components: committedDepth: type: integer - StatusResponse: + StatusPeersResponse: type: object properties: - stamps: + snapshots: type: array nullable: false items: @@ -958,7 +942,7 @@ components: StatusNeighborhoodsResponse: type: object properties: - stamps: + neighborhoods: type: array nullable: false items: