From e5eb1b93d30a9c1d86e85cfde69694c30c528587 Mon Sep 17 00:00:00 2001 From: JoblersTune Date: Tue, 3 Dec 2024 12:10:55 +0200 Subject: [PATCH] chore: re-enable Prettier for docs --- .prettierignore | 1 - packages/documentation/astro.config.mjs | 6 ++--- .../docs/integration/playground/overview.mdx | 5 ++-- .../docs/integration/prod/docker-compose.mdx | 10 ++++--- .../requirements/wallet-addresses.mdx | 25 +++++++++--------- .../requirements/webhook-events.mdx | 2 ++ .../docs/overview/concepts/telemetry.mdx | 20 +++++++------- .../src/content/docs/resources/glossary.mdx | 11 ++++---- .../src/partials/auth-variables.mdx | 8 +++--- .../src/partials/backend-variables.mdx | 12 ++++----- .../src/partials/frontend-variables.mdx | 26 +++++++++---------- 11 files changed, 66 insertions(+), 60 deletions(-) diff --git a/.prettierignore b/.prettierignore index f26e8fdf24..9339b81f63 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,5 +14,4 @@ build **/styles/*.css .docusaurus .cache-loader -packages/documentation/** .astro \ No newline at end of file diff --git a/packages/documentation/astro.config.mjs b/packages/documentation/astro.config.mjs index 6fcebb9397..bc4c6da494 100644 --- a/packages/documentation/astro.config.mjs +++ b/packages/documentation/astro.config.mjs @@ -257,9 +257,9 @@ export default defineConfig({ ], plugins: [ starlightLinksValidator({ - errorOnLocalLinks: false, - }), - ], + errorOnLocalLinks: false + }) + ] }), GraphQL({ schema: '../backend/src/graphql/schema.graphql', diff --git a/packages/documentation/src/content/docs/integration/playground/overview.mdx b/packages/documentation/src/content/docs/integration/playground/overview.mdx index cdc5b4cb24..f078cdb9ef 100644 --- a/packages/documentation/src/content/docs/integration/playground/overview.mdx +++ b/packages/documentation/src/content/docs/integration/playground/overview.mdx @@ -178,6 +178,7 @@ You can either trigger the debugger by adding `debugger` statements in the code #### Debugging with VS Code: To debug with VS Code, add this configuration to your `.vscode/launch.json`: + ```json { "name": "Attach to docker (cloud-nine-backend)", @@ -220,7 +221,7 @@ The following are the most commonly used commands: | pnpm localenv:compose up | Start (with TigerBeetle) | | pnpm localenv:compose up -d | Start (with TigerBeetle) detached | | pnpm localenv:compose down | Down (with TigerBeetle) | -| pnpm localenv:compose down --volumes | Down and kill volumes (with TigerBeetle) +| pnpm localenv:compose down --volumes | Down and kill volumes (with TigerBeetle) | | pnpm localenv:compose down --volumes --rmi all | Down, kill volumes (with TigerBeetle) and images | | pnpm localenv:compose:psql config | Show all merged config (with PostgreSQL) | | pnpm localenv:compose build | Build all the containers (with TigerBeetle) | @@ -292,4 +293,4 @@ test.rafiki.viXmy1OVHgvmQakNjX1C6kQMri92DzHeISEv-5VzTDuFhrpsrkDzsq5OO9Lfa9yed0L2 #### TigerBeetle container exists with code 137 -There is a known issue when running TigerBeetle in Docker. The container exits without logs and simply shows error code 137. To fix this, increase the Docker memory limit. If you run the local Docker playground on a Windows machine via the Windows Subsystem for Linux (WSL), you can increase the memory limit by configuring your `.wslconfig` file. \ No newline at end of file +There is a known issue when running TigerBeetle in Docker. The container exits without logs and simply shows error code 137. To fix this, increase the Docker memory limit. If you run the local Docker playground on a Windows machine via the Windows Subsystem for Linux (WSL), you can increase the memory limit by configuring your `.wslconfig` file. diff --git a/packages/documentation/src/content/docs/integration/prod/docker-compose.mdx b/packages/documentation/src/content/docs/integration/prod/docker-compose.mdx index b214273aae..9f206994b4 100644 --- a/packages/documentation/src/content/docs/integration/prod/docker-compose.mdx +++ b/packages/documentation/src/content/docs/integration/prod/docker-compose.mdx @@ -37,8 +37,12 @@ Deploy a general purpose VM with the following minimum specifications: Install the following software on the VM: -- Docker Engine -- Docker Compose +- + Docker Engine + +- + Docker Compose + ### Install Nginx and Certbot @@ -263,7 +267,7 @@ Create nginx configuration files for every exposed domain: | Open Payments resource server | DOMAIN | myrafiki.com | /etc/nginx/sites-available/open_payments_resource_server.config | | ILP Connector | ilp.DOMAIN | ilp.myrafiki.com | /etc/nginx/sites-available/ilp.config | | Open Payments auth server | auth.DOMAIN | auth.myrafiki.com | /etc/nginx/sites-available/open_payments_auth_server.config | -| Admin UI | admin.DOMAIN | admin.myrafiki.com | /etc/nginx/sites-available/admin.config | +| Admin UI | admin.DOMAIN | admin.myrafiki.com | /etc/nginx/sites-available/admin.config | diff --git a/packages/documentation/src/content/docs/integration/requirements/wallet-addresses.mdx b/packages/documentation/src/content/docs/integration/requirements/wallet-addresses.mdx index 0cf5ace685..fec4af6a08 100644 --- a/packages/documentation/src/content/docs/integration/requirements/wallet-addresses.mdx +++ b/packages/documentation/src/content/docs/integration/requirements/wallet-addresses.mdx @@ -11,6 +11,7 @@ Each payment account belonging to your users (e.g., customers) must have at leas - Your Rafiki instance must be set up for at least one asset before wallet addresses can be created as each wallet address must have an asset assigned to it. - Wallet address URLs are treated as case-insensitive, meaning that both lowercase and uppercase variations of the same address will be recognized as identical. + ::: ## Create wallet addresses @@ -84,12 +85,12 @@ We strongly recommend you store at least the `walletAddress.id` in your internal
-|Variable | Description | -|-------- | ----------- | -| `assetId` | The unique ID of the asset, assigned by Rafiki when the asset was created, that the wallet address's underlying payment account is denominated in | -| `publicName` | The public name associated with the wallet address | -| `url` | The wallet address's case-insensitive URL | -| `additionalProperties` | Optional [additional properties](/apis/graphql/backend/inputobjects/#additionalpropertyinput) associated with the wallet address | +| Variable | Description | +| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `assetId` | The unique ID of the asset, assigned by Rafiki when the asset was created, that the wallet address's underlying payment account is denominated in | +| `publicName` | The public name associated with the wallet address | +| `url` | The wallet address's case-insensitive URL | +| `additionalProperties` | Optional [additional properties](/apis/graphql/backend/inputobjects/#additionalpropertyinput) associated with the wallet address |
@@ -194,11 +195,11 @@ Open Payments -| Parameter | Required value | Description | -| --------- | -------------- | ----------- | -| `alg` | `EdDSA` | The algorithm used to generate the key pair | -| `kty` | `OKP` | The key type identifying the cryptographic algorithm family used with the key | -| `crv` | `Ed25519` | The cryptographic curve used with the key | +| Parameter | Required value | Description | +| --------- | -------------- | ----------------------------------------------------------------------------- | +| `alg` | `EdDSA` | The algorithm used to generate the key pair | +| `kty` | `OKP` | The key type identifying the cryptographic algorithm family used with the key | +| `crv` | `Ed25519` | The cryptographic curve used with the key | @@ -285,4 +286,4 @@ mutation RevokeWalletAddressKey($input: RevokeWalletAddressKeyInput!) { } ``` - \ No newline at end of file + diff --git a/packages/documentation/src/content/docs/integration/requirements/webhook-events.mdx b/packages/documentation/src/content/docs/integration/requirements/webhook-events.mdx index 661635b3ed..756bb1a841 100644 --- a/packages/documentation/src/content/docs/integration/requirements/webhook-events.mdx +++ b/packages/documentation/src/content/docs/integration/requirements/webhook-events.mdx @@ -163,6 +163,7 @@ Rafiki-Signature: t=, v= ### Prepare the signed payload string To recreate the signed payload string, concatenate the following. + - The timestamp extracted from the header - A period (.) character - The actual JSON payload from the request body, containing the `id`, `type`, and `data` attributes @@ -178,6 +179,7 @@ Use HMAC SHA-256 with the `SIGNATURE_SECRET` environment variable as the key and Finally, compare the signature in the header to the expected signature you generated. For security, use a constant-time comparison function to prevent timing attacks. ### Example + Below is an example in JavaScript to verify Rafiki's webhook signature: diff --git a/packages/documentation/src/content/docs/overview/concepts/telemetry.mdx b/packages/documentation/src/content/docs/overview/concepts/telemetry.mdx index f24c3b01a7..96bc7319cb 100644 --- a/packages/documentation/src/content/docs/overview/concepts/telemetry.mdx +++ b/packages/documentation/src/content/docs/overview/concepts/telemetry.mdx @@ -167,9 +167,9 @@ When the `ENABLE_TELEMETRY` variable is `true`, the following are required.
-| Variable name | Type | Description | -| ------------- | ---- | ----------- | -| `INSTANCE_NAME` | String | Your Rafiki instance's name used to communicate for telemetry and auto-peering. For telemetry, it's used to distinguish between the different instances pushing data to the telemetry collector. | Y | +| Variable name | Type | Description | +| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | +| `INSTANCE_NAME` | String | Your Rafiki instance's name used to communicate for telemetry and auto-peering. For telemetry, it's used to distinguish between the different instances pushing data to the telemetry collector. | Y |
@@ -177,13 +177,13 @@ When the `ENABLE_TELEMETRY` variable is `true`, the following are required.
-| Variable name | Type | Description | -| ------------- | ---- | ----------- | -| `ENABLE_TELEMETRY` | Boolean | Enables the telemetry service on Rafiki. Defaults to `true`. | -| `LIVENET` | Boolean | Determines where to send metrics. Defaults to `false`, resulting in metrics being sent to the testnet OTEL Collector.

Set to `true` on production environments dealing with real money.

| -| `OPEN_TELEMETRY_COLLECTOR_URLS` | String | A CSV of URLs for OTEL Collectors (e.g., `http://otel-collector-NLB-e3172ff9d2f4bc8a.elb.eu-west-2.amazonaws.com:4317,http://happy-life-otel-collector:4317`). | -| `OPEN_TELEMETRY_EXPORT_INTERVAL` | Number | Indicates, in milliseconds, how often the instrumented Rafiki instance should send metrics. Defaults to`15000`. | -| `TELEMETRY_EXCHANGE_RATES_URL` | String |

Defines the endpoint Rafiki will query for exchange rates. Used as a fallback if/when [exchange rates](/integration/requirements/exchange-rates) aren’t provided.

When set, the response format of the external exchange rates API should be of type `rates`, as is expected by the rate service.

Defaults to `https://telemetry-exchange-rates.s3.amazonaws.com/exchange-rates-usd.json`, which points to a public S3 that has the previously mentioned required format, updated daily.

| +| Variable name | Type | Description | +| -------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ENABLE_TELEMETRY` | Boolean | Enables the telemetry service on Rafiki. Defaults to `true`. | +| `LIVENET` | Boolean | Determines where to send metrics. Defaults to `false`, resulting in metrics being sent to the testnet OTEL Collector.

Set to `true` on production environments dealing with real money.

| +| `OPEN_TELEMETRY_COLLECTOR_URLS` | String | A CSV of URLs for OTEL Collectors (e.g., `http://otel-collector-NLB-e3172ff9d2f4bc8a.elb.eu-west-2.amazonaws.com:4317,http://happy-life-otel-collector:4317`). | +| `OPEN_TELEMETRY_EXPORT_INTERVAL` | Number | Indicates, in milliseconds, how often the instrumented Rafiki instance should send metrics. Defaults to`15000`. | +| `TELEMETRY_EXCHANGE_RATES_URL` | String |

Defines the endpoint Rafiki will query for exchange rates. Used as a fallback if/when [exchange rates](/integration/requirements/exchange-rates) aren’t provided.

When set, the response format of the external exchange rates API should be of type `rates`, as is expected by the rate service.

Defaults to `https://telemetry-exchange-rates.s3.amazonaws.com/exchange-rates-usd.json`, which points to a public S3 that has the previously mentioned required format, updated daily.

|
diff --git a/packages/documentation/src/content/docs/resources/glossary.mdx b/packages/documentation/src/content/docs/resources/glossary.mdx index e2e7e0fbd7..4ac3065d05 100644 --- a/packages/documentation/src/content/docs/resources/glossary.mdx +++ b/packages/documentation/src/content/docs/resources/glossary.mdx @@ -62,7 +62,7 @@ An API standard and a set of APIs that allows clients to securely retrieve accou ## Outgoing payment -An object created by the sender’s ASE, on their resource server, that represents a payment being sent. This object contains information about the outgoing payment, such as the amount, currency, receiver’s wallet address, and payment status. +An object created by the sender’s ASE, on their resource server, that represents a payment being sent. This object contains information about the outgoing payment, such as the amount, currency, receiver’s wallet address, and payment status. ## Payment pointer @@ -78,14 +78,13 @@ An object created by the sender’s ASE, on their resource server, that represen ## Resource server -A server that hosts and manages access to protected Open Payments resources for incoming payments, quotes, and outgoing payments. +A server that hosts and manages access to protected Open Payments resources for incoming payments, quotes, and outgoing payments. Rafiki's `backend` service runs an Open Payments resource server. ## Simple Payment Setup Protocol (SPSP) -An Interledger application layer protocol for exchanging payment information between two counterparties to facilitate direct payments over Interledger. The information is then used to set up a STREAM connection. You can read more about SPSP in its specification -. +An Interledger application layer protocol for exchanging payment information between two counterparties to facilitate direct payments over Interledger. The information is then used to set up a STREAM connection. You can read more about SPSP in its specification. ## Streaming Transport for the Real-Time Exchange of Assets and Messages (STREAM) @@ -93,6 +92,6 @@ An Interledger transport layer protocol for sending and receiving authenticated ## Wallet address -A secure, unique URL that identifies an Open Payments-enabled account. It acts as an entry point to the Open Payments APIs, facilitating interactions like sending and receiving payments. +A secure, unique URL that identifies an Open Payments-enabled account. It acts as an entry point to the Open Payments APIs, facilitating interactions like sending and receiving payments. -A wallet address is publicly shareable and used to interact with the underlying payment account without compromising its security. Wallet address URLs are treated as case-insensitive, meaning that both lowercase and uppercase variations of the same address will be recognized as identical. \ No newline at end of file +A wallet address is publicly shareable and used to interact with the underlying payment account without compromising its security. Wallet address URLs are treated as case-insensitive, meaning that both lowercase and uppercase variations of the same address will be recognized as identical. diff --git a/packages/documentation/src/partials/auth-variables.mdx b/packages/documentation/src/partials/auth-variables.mdx index 663ee7a31d..d4851b48e3 100644 --- a/packages/documentation/src/partials/auth-variables.mdx +++ b/packages/documentation/src/partials/auth-variables.mdx @@ -4,8 +4,8 @@ import { LinkOut } from '@interledger/docs-design-system'
-| Variable | Helm value name | Default | Description | -| -------- | --------------- | ------- | ----------- | +| Variable | Helm value name | Default | Description | +| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | `AUTH_DATABASE_URL` | `auth.postgresql.host`,
`auth.postgresql.port`,
`auth.postgresql.username`,
`auth.postgresql.database`,
`auth.postgresql.password` | `postgresql://postgres:password@localhost:5432/auth_development` | The URL of the Postgres database storing your Open Payments grant data. For Helm, these components are provided individually. | | `AUTH_SERVER_URL` | `auth.server.domain` | _undefined_ | The public endpoint for your Rafiki instance’s public Open Payments routes. | | `COOKIE_KEY` | `auth.cookieKey` | _undefined_ | The koa KeyGrip key that is used to sign cookies for an interaction session. | @@ -19,8 +19,8 @@ import { LinkOut } from '@interledger/docs-design-system'
-| Variable | Helm value name | Default | Description | -| -------- | --------------- | ------- | ----------- | +| Variable | Helm value name | Default | Description | +| --------------------------------- | ----------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ACCESS_TOKEN_DELETION_DAYS` | `auth.accessToken.deletionDays` | `30` | The days until expired and/or revoked access tokens are deleted. | | `ACCESS_TOKEN_EXPIRY_SECONDS` | `auth.accessToken.expirySeconds` | `600` (10 minutes) | The expiry time, in seconds, for access tokens. | | `ADMIN_API_SIGNATURE_VERSION` | `auth.adminApi.signatureVersion` | `1` | The version of the request signing algorithm used to generate signatures. | diff --git a/packages/documentation/src/partials/backend-variables.mdx b/packages/documentation/src/partials/backend-variables.mdx index b68cd50c06..68fdb527b0 100644 --- a/packages/documentation/src/partials/backend-variables.mdx +++ b/packages/documentation/src/partials/backend-variables.mdx @@ -4,8 +4,8 @@ import { LinkOut } from '@interledger/docs-design-system'
-| Variable | Helm value name | Default | Description | -| -------- | --------------- | ------- | ----------- | +| Variable | Helm value name | Default | Description | +| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | | `AUTH_SERVER_GRANT_URL` | `backend.serviceUrls.AUTH_SERVER_GRANT_URL` | _undefined_ | The endpoint on your Open Payments authorization server to grant a request. | | `AUTH_SERVER_INTROSPECTION_URL` | `backend.serviceUrls.AUTH_SERVER_INTROSPECTION_URL` | _undefined_ | The endpoint on your Open Payments authorization server to introspect an access token. | | `DATABASE_URL` | `backend.postgresql.host`,
`backend.postgresql.port`,
`backend.postgresql.username`,
`backend.postgresql.database`,
`backend.postgresql.password` | `postgresql://postgres:password@localhost:5432/development` | The Postgres database URL of the database storing your resource data. For Helm, these components are provided individually. | @@ -24,8 +24,8 @@ import { LinkOut } from '@interledger/docs-design-system'
-| Variable | Helm value name | Default | Description | -| -------- | --------------- | ------- | ----------- | +| Variable | Helm value name | Default | Description | +| --------------- | ----------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `INSTANCE_NAME` | `backend.instance.name` | _undefined_ | Your Rafiki instance's name used to communicate for auto-peering and/or [telemetry](/overview/concepts/telemetry). Required when auto-peering and/or telemetry is enabled |
@@ -34,8 +34,8 @@ import { LinkOut } from '@interledger/docs-design-system'
-| Variable | Helm value name | Default | Description | -| -------- | --------------- | ------- | ----------- | +| Variable | Helm value name | Default | Description | +| ----------------------------------------------------- | -------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ADMIN_PORT` | `backend.port.admin` | `3001` | The port of your Backend Auth API server. | | `ADMIN_API_SIGNATURE_TTL_SECONDS` | _undefined_ | `30` | The TTL, in seconds, for which a request’s signature will be valid. | | `API_SECRET` | _undefined_ | _undefined_ | N/A | diff --git a/packages/documentation/src/partials/frontend-variables.mdx b/packages/documentation/src/partials/frontend-variables.mdx index a707bf1f54..6d39c11b15 100644 --- a/packages/documentation/src/partials/frontend-variables.mdx +++ b/packages/documentation/src/partials/frontend-variables.mdx @@ -4,11 +4,11 @@ import { LinkOut } from '@interledger/docs-design-system'
-| Variable | Helm value name | Default | Description | -| -------- | --------------- | ------- | ----------- | -| `GRAPHQL_URL` | `frontend.serviceUrls.GRAPHQL_URL` | _undefined_ | URL for Rafiki’s GraphQL Auth Admin API | -| `OPEN_PAYMENTS_URL` | `frontend.serviceUrls.OPEN_PAYMENTS_URL` | _undefined_ | Your Open Payments API endpoint | -| `PORT` | `frontend.port` | _undefined_ | Port from which to host the Rafiki Remix app | +| Variable | Helm value name | Default | Description | +| ------------------- | ---------------------------------------- | ----------- | -------------------------------------------- | +| `GRAPHQL_URL` | `frontend.serviceUrls.GRAPHQL_URL` | _undefined_ | URL for Rafiki’s GraphQL Auth Admin API | +| `OPEN_PAYMENTS_URL` | `frontend.serviceUrls.OPEN_PAYMENTS_URL` | _undefined_ | Your Open Payments API endpoint | +| `PORT` | `frontend.port` | _undefined_ | Port from which to host the Rafiki Remix app |
@@ -18,11 +18,11 @@ The following variables are required only when `AUTH_ENABLED` is set to `true`.
-| Variable | Helm value name | Default | Description | -| -------- | --------------- | ------- | ----------- | -| `KRATOS_ADMIN_URL` | `frontend.kratos.adminUrl` | _undefined_ | The admin endpoint/container address for Kratos | -| `KRATOS_CONTAINER_PUBLIC_URL` | `frontend.kratos.containerPublicUrl` | _undefined_ | The URL for you to access the Kratos Docker container from within the Docker network. This is used for backend calls to Kratos. | -| `KRATOS_BROWSER_PUBLIC_URL` | `frontend.kratos.browserPublicUrl` | _undefined_ | The URL for you to access the Kratos Docker container from a browser outside of the Docker network. This is used for calls from a browser (what you see in the Rafiki Admin UI) to the Kratos server on the backend. | +| Variable | Helm value name | Default | Description | +| ----------------------------- | ------------------------------------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `KRATOS_ADMIN_URL` | `frontend.kratos.adminUrl` | _undefined_ | The admin endpoint/container address for Kratos | +| `KRATOS_CONTAINER_PUBLIC_URL` | `frontend.kratos.containerPublicUrl` | _undefined_ | The URL for you to access the Kratos Docker container from within the Docker network. This is used for backend calls to Kratos. | +| `KRATOS_BROWSER_PUBLIC_URL` | `frontend.kratos.browserPublicUrl` | _undefined_ | The URL for you to access the Kratos Docker container from a browser outside of the Docker network. This is used for calls from a browser (what you see in the Rafiki Admin UI) to the Kratos server on the backend. |
@@ -30,8 +30,8 @@ The following variables are required only when `AUTH_ENABLED` is set to `true`.
-| Variable | Helm value name | Default | Description | -| -------- | --------------- | ------- | ----------- | +| Variable | Helm value name | Default | Description | +| -------------------------------- | -------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `AUTH_ENABLED` | `frontend.authEnabled` | `true` | When `true`, only authenticated users can be granted access to Rafiki Admin by an administrator | | `SIGNATURE_SECRET` | `frontend.quoteSignatureSecret` | _undefined_ | The signature secret used to authenticate requests to the Backend Admin API. | | `SIGNATURE_VERSION` | `frontend.signatureVersion` | `1` | The signature version number used to authenticate requests to the Backend Admin API. | @@ -39,4 +39,4 @@ The following variables are required only when `AUTH_ENABLED` is set to `true`. | `NODE_ENV` | `frontend.nodeEnv` | `production` | The type of node environment: `development`, `test`, or `production`. | | `LOG_LEVEL` | `frontend.logLevel` | `info` | Pino log level | -
\ No newline at end of file +