-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extract wallet address from RS (#315)
* feat: extract wallet address from RS * fix: address comments from @sabineschaller * fix: validate OpenAPI spec * fix: linting issues * fix: remove spectral config * fix: add code generation * fix: add types and fix mocks * fix: lint and format * fix: update open-payments client * docs: update docs autogen * fix: add changesets * test: add tests for DID Document * fix: accept suggestions
- Loading branch information
1 parent
ca08398
commit ec04a61
Showing
14 changed files
with
481 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@interledger/open-payments': minor | ||
--- | ||
|
||
Mapped wallet address and jwks get to new stand along Open API spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,4 @@ dist | |
**/.terraform | ||
|
||
tmp | ||
.spectral.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Wallet Address API | ||
version: '1.4' | ||
license: | ||
name: Apache 2.0 | ||
identifier: Apache-2.0 | ||
description: |- | ||
The Wallet Address API is a simple REST API to get basic details about a wallet address. | ||
contact: | ||
email: [email protected] | ||
servers: | ||
- url: 'https://rafiki.money/alice' | ||
description: "Server for Alice's wallet address" | ||
- url: 'https://rafiki.money/bob' | ||
description: "Server for Bob's wallet address" | ||
tags: | ||
- name: wallet-address | ||
description: wallet address operations | ||
paths: | ||
/: | ||
get: | ||
summary: Get a Wallet Address | ||
tags: | ||
- wallet-address | ||
responses: | ||
'200': | ||
description: Wallet Address Found | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/wallet-address' | ||
examples: | ||
Get wallet address for $rafiki.money/alice: | ||
value: | ||
id: 'https://rafiki.money/alice' | ||
publicName: Alice | ||
assetCode: USD | ||
assetScale: 2 | ||
authServer: 'https://rafiki.money/auth' | ||
resourceServer: 'https://rafiki.money/op' | ||
'404': | ||
description: Wallet Address Not Found | ||
operationId: get-wallet-address | ||
description: |- | ||
Retrieve the public information of the Wallet Address. | ||
This end-point should be open to anonymous requests as it allows clients to verify a Wallet Address URL and get the basic information required to construct new transactions and discover the grant request URL. | ||
The content should be slow changing and cacheable for long periods. Servers SHOULD use cache control headers. | ||
security: [] | ||
x-internal: false | ||
/jwks.json: | ||
get: | ||
summary: Get the keys bound to a Wallet Address | ||
tags: | ||
- wallet-address | ||
responses: | ||
'200': | ||
description: JWKS Document Found | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/json-web-key-set' | ||
examples: {} | ||
'404': | ||
description: JWKS Document Not Found | ||
operationId: get-wallet-address-keys | ||
description: Retrieve the public keys of the Wallet Address. | ||
security: [] | ||
/did.json: | ||
get: | ||
summary: Get the DID Document for this wallet | ||
tags: | ||
- wallet-address | ||
responses: | ||
'200': | ||
description: DID Document Found | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/did-document' | ||
'500': | ||
description: DID Document not yet implemented | ||
operationId: get-wallet-address-did-document | ||
description: Retrieve the DID Document of the Wallet Address. | ||
security: [] | ||
components: | ||
schemas: | ||
wallet-address: | ||
title: Wallet Address | ||
type: object | ||
description: A **wallet address** resource is the root of the API and contains the public details of the financial account represented by the Wallet Address that is also the service endpoint URL. | ||
additionalProperties: true | ||
examples: | ||
- id: 'https://rafiki.money/alice' | ||
publicName: Alice | ||
assetCode: USD | ||
assetScale: 2 | ||
authServer: 'https://rafiki.money/auth' | ||
resourceServer: 'https://rafiki.money/op' | ||
properties: | ||
id: | ||
type: string | ||
format: uri | ||
description: The URL identifying the wallet address. | ||
readOnly: true | ||
publicName: | ||
type: string | ||
description: A public name for the account. This should be set by the account holder with their provider to provide a hint to counterparties as to the identity of the account holder. | ||
readOnly: true | ||
assetCode: | ||
$ref: ./schemas.yaml#/components/schemas/assetCode | ||
assetScale: | ||
$ref: ./schemas.yaml#/components/schemas/assetScale | ||
authServer: | ||
type: string | ||
format: uri | ||
description: The URL of the authorization server endpoint for getting grants and access tokens for this wallet address. | ||
readOnly: true | ||
resourceServer: | ||
type: string | ||
format: uri | ||
description: The URL of the resource server endpoint for performing Open Payments with this wallet address. | ||
readOnly: true | ||
required: | ||
- id | ||
- assetCode | ||
- assetScale | ||
- authServer | ||
- resourceServer | ||
json-web-key-set: | ||
title: JSON Web Key Set document | ||
type: object | ||
description: 'A JSON Web Key Set document according to [rfc7517](https://datatracker.ietf.org/doc/html/rfc7517) listing the keys associated with this wallet address. These keys are used to sign requests made by this wallet address.' | ||
additionalProperties: false | ||
properties: | ||
keys: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/json-web-key' | ||
readOnly: true | ||
required: | ||
- keys | ||
examples: | ||
- keys: | ||
- kid: key-1 | ||
alg: EdDSA | ||
use: sig | ||
kty: OKP | ||
crv: Ed25519 | ||
x: 11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo | ||
json-web-key: | ||
type: object | ||
properties: | ||
kid: | ||
type: string | ||
alg: | ||
type: string | ||
description: 'The cryptographic algorithm family used with the key. The only allowed value is `EdDSA`. ' | ||
enum: | ||
- EdDSA | ||
use: | ||
type: string | ||
enum: | ||
- sig | ||
kty: | ||
type: string | ||
enum: | ||
- OKP | ||
crv: | ||
type: string | ||
enum: | ||
- Ed25519 | ||
x: | ||
type: string | ||
pattern: '^[a-zA-Z0-9-_]+$' | ||
description: The base64 url-encoded public key. | ||
required: | ||
- kid | ||
- alg | ||
- kty | ||
- crv | ||
- x | ||
title: Ed25519 Public Key | ||
description: A JWK representation of an Ed25519 Public Key | ||
examples: | ||
- kid: key-1 | ||
use: sig | ||
kty: OKP | ||
crv: Ed25519 | ||
x: 11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo | ||
- kid: '2022-09-02' | ||
use: sig | ||
kty: OKP | ||
crv: Ed25519 | ||
x: oy0L_vTygNE4IogRyn_F5GmHXdqYVjIXkWs2jky7zsI | ||
did-document: | ||
type: object | ||
title: DID Document | ||
description: A DID Document using JSON encoding |
Oops, something went wrong.