From 9498031dfb43fc0f76fb44b57cead30446b29920 Mon Sep 17 00:00:00 2001 From: Brandon Wilson Date: Tue, 15 Nov 2022 09:41:16 -0600 Subject: [PATCH] chore: replace connections with methods --- openapi/resource-server.yaml | 153 ++++++----------------------------- 1 file changed, 24 insertions(+), 129 deletions(-) diff --git a/openapi/resource-server.yaml b/openapi/resource-server.yaml index f1a91a4a..f27a00e8 100644 --- a/openapi/resource-server.yaml +++ b/openapi/resource-server.yaml @@ -103,42 +103,6 @@ paths: operationId: get-payment-pointer-keys description: Retrieve the public keys of the Payment Pointer. security: [] - '/connections/{id}': - servers: - - url: 'https://openpayments.guide' - get: - summary: Get ILP STREAM credentials for a connection - tags: - - stream-connection - responses: - '200': - description: Connection Found - content: - application/json: - schema: - $ref: '#/components/schemas/ilp-stream-connection' - examples: - Get connection: - value: - id: 'https://openpayments.guide/connections/016da9d5-c9a4-4c80-a354-86b915a04ff8' - ilpAddress: g.ilp.iwuyge987y.98y0f34tsrt8y - sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA - assetCode: USD - assetScale: 2 - '404': - description: Connection Not Found - operationId: get-ilp-stream-connection - description: |- - *NB* Use server url specific to this path. - - Fetch new connection credentials for an ILP STREAM connection. - - A connection is an ephemeral resource that is created to accommodate new incoming payments. - - A new set of credential will be generated each time this API is called. - security: [] - parameters: - - $ref: '#/components/parameters/id' /incoming-payments: post: summary: Create an Incoming Payment @@ -151,7 +115,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/incoming-payment-with-connection' + $ref: '#/components/schemas/incoming-payment-with-methods' examples: New Incoming Payment for $25: value: @@ -168,12 +132,11 @@ paths: completed: false expiresAt: '2022-02-03T23:20:50.52Z' externalRef: INV2022-02-0137 - ilpStreamConnection: - id: 'https://openpayments.guide/connections/ff394f02-7b7b-45e2-b645-51d04e7c345c' - ilpAddress: g.ilp.iwuyge987y.98y08y - sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA - assetCode: USD - assetScale: 2 + methods: + stream: + id: 'https://openpayments.guide/connections/ff394f02-7b7b-45e2-b645-51d04e7c345c' + ilpAddress: g.ilp.iwuyge987y.98y08y + sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA createdAt: '2022-03-12T23:20:50.52Z' updatedAt: '2022-04-01T10:24:36.11Z' '401': @@ -237,7 +200,7 @@ paths: result: type: array items: - $ref: '#/components/schemas/incoming-payment-with-connection-url' + $ref: '#/components/schemas/incoming-payment' examples: forward pagination: value: @@ -257,7 +220,6 @@ paths: value: '250' assetCode: USD assetScale: 2 - ilpStreamConnection: 'https://openpayments.guide/connections/376df9d5-c9a4-4c80-a354-86b915a04ff8' expiresAt: '2022-04-12T23:20:50.52Z' createdAt: '2022-03-12T23:20:50.52Z' updatedAt: '2022-04-01T10:24:36.11Z' @@ -270,7 +232,6 @@ paths: value: '100' assetCode: USD assetScale: 2 - ilpStreamConnection: 'https://openpayments.guide/connections/1f6df9d5-c9a4-4c80-a354-86b915a04ff8' expiresAt: '2022-04-12T23:20:50.52Z' createdAt: '2022-03-12T23:20:50.52Z' updatedAt: '2022-04-01T10:24:36.11Z' @@ -291,7 +252,6 @@ paths: assetCode: USD assetScale: 2 completed: true - ilpStreamConnection: 'https://openpayments.guide/connections/1f6df9d5-c9a4-4c80-a354-86b915a04ff8' expiresAt: '2022-04-12T23:20:50.52Z' createdAt: '2022-03-12T23:20:50.52Z' updatedAt: '2022-04-01T10:24:36.11Z' @@ -307,7 +267,6 @@ paths: assetCode: USD assetScale: 2 completed: true - ilpStreamConnection: 'https://openpayments.guide/connections/376df9d5-c9a4-4c80-a354-86b915a04ff8' expiresAt: '2022-04-12T23:20:50.52Z' createdAt: '2022-03-12T23:20:50.52Z' updatedAt: '2022-04-01T10:24:36.11Z' @@ -617,7 +576,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/incoming-payment-with-connection' + $ref: '#/components/schemas/incoming-payment-with-methods' examples: Incoming Payment for $25 with $12.34 received so far: value: @@ -637,12 +596,11 @@ paths: updatedAt: '2022-04-01T10:24:36.11Z' description: Thanks for the flowers! externalRef: INV-12876 - ilpStreamConnection: - id: 'https://openpayments.guide/connections/4a1b0150-db73-49e8-8713-628baa4a17ff' - ilpAddress: g.ilp.iwuyge987y.98y08y - sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA - assetCode: USD - assetScale: 2 + methods: + stream: + id: 'https://openpayments.guide/connections/4a1b0150-db73-49e8-8713-628baa4a17ff' + ilpAddress: g.ilp.iwuyge987y.98y08y + sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA '401': $ref: '#/components/responses/401' '403': @@ -849,42 +807,6 @@ components: kty: OKP crv: Ed25519 x: 11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo - ilp-stream-connection: - title: ILP Stream Connection - type: object - description: An **ILP STREAM Connection** is an endpoint that returns unique STREAM connection credentials to establish a STREAM connection to the underlying account. - additionalProperties: false - examples: - - id: 'https://openpayments.guide/connections/016da9d5-c9a4-4c80-a354-86b915a04ff8' - ilpApddress: g.ilp.iwuyge987y.98y08y - sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA - properties: - id: - type: string - format: uri - description: The URL identifying the endpoint. - readOnly: true - ilpAddress: - type: string - maxLength: 1023 - pattern: '^(g|private|example|peer|self|test[1-3]?|local)([.][a-zA-Z0-9_~-]+)+$' - description: The ILP address to use when establishing a STREAM connection. - readOnly: true - sharedSecret: - type: string - pattern: '^[a-zA-Z0-9-_]+$' - description: The base64 url-encoded shared secret to use when establishing a STREAM connection. - readOnly: true - assetCode: - $ref: ./schemas.yaml#/components/schemas/assetCode - assetScale: - $ref: ./schemas.yaml#/components/schemas/assetScale - required: - - id - - ilpAddress - - sharedSecret - - assetCode - - assetScale incoming-payment: title: Incoming Payment description: 'An **incoming payment** resource represents a payment that will be, is currently being, or has been received by the account.' @@ -965,9 +887,9 @@ components: - receivedAmount - createdAt - updatedAt - incoming-payment-with-connection: - title: Incoming Payment with Connection - description: An **incoming payment** resource with the Interledger STREAM Connection to use to pay into the payment pointer under this incoming payment. + incoming-payment-with-methods: + title: Incoming Payment with Methods + description: An **incoming payment** resource with the support methods to use to pay into the payment pointer under this incoming payment. type: object examples: - id: 'https://openpayments.guide/alice/incoming-payments/016da9d5-c9a4-4c80-a354-86b915a04ff8' @@ -986,45 +908,18 @@ components: updatedAt: '2022-04-01T10:24:36.11Z' description: 'Hi Mo, this is for the cappuccino I bought for you the other day.' externalRef: Coffee w/ Mo on 10 March 22 - ilpStreamConnection: - id: 'https://openpayments.guide/connections/032da9d5-c9a4-4c80-a354-86b915a04ff8' - ilpApddress: g.ilp.iwuyge987y.98y08y - sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA - allOf: - - $ref: '#/components/schemas/incoming-payment' - - type: object - properties: - ilpStreamConnection: - $ref: '#/components/schemas/ilp-stream-connection' - unevaluatedProperties: false - incoming-payment-with-connection-url: - title: Incoming Payment with Connection - description: An **incoming payment** resource with the url for the Interledger STREAM Connection resource to use to pay into the payment pointer under this incoming payment. - type: object - examples: - - id: 'https://openpayments.guide/alice/incoming-payments/456da9d5-c9a4-4c80-a354-86b915a04ff8' - paymentPointer: 'https://openpayments.guide/alice/' - incomingAmount: - value: '2500' - assetCode: USD - assetScale: 2 - receivedAmount: - value: '0' - assetCode: USD - assetScale: 2 - expiresAt: '2022-04-12T23:20:50.52Z' - createdAt: '2022-03-12T23:20:50.52Z' - updatedAt: '2022-03-12T23:20:50.52Z' - ilpStreamConnection: 'https://openpayments.guide/connections/782da9d5-c9a4-4c80-a354-86b915a04ff8' + methods: + stream: + id: 'https://openpayments.guide/connections/032da9d5-c9a4-4c80-a354-86b915a04ff8' + ilpAddress: g.ilp.iwuyge987y.98y08y + sharedSecret: 1c7eaXa4rd2fFOBl1iydvCT1tV5TbM3RW1WLCafu_JA allOf: - $ref: '#/components/schemas/incoming-payment' - type: object properties: - ilpStreamConnection: - type: string - format: uri - description: Endpoint that returns unique STREAM connection credentials to establish a STREAM connection to the underlying account. - readOnly: true + methods: + type: object + minProperties: 1 unevaluatedProperties: false outgoing-payment: title: Outgoing Payment