Skip to content

Commit f363ad3

Browse files
authored
chore: upgrade rafiki and open payments (#2182)
1 parent 726ed28 commit f363ad3

5 files changed

Lines changed: 29 additions & 19 deletions

File tree

docker/dev/docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ services:
117117
# Rafiki
118118
rafiki-auth:
119119
container_name: rafiki-auth
120-
image: ghcr.io/interledger/rafiki-auth:v2.2.0-beta
120+
image: ghcr.io/interledger/rafiki-auth:v2.3.0-beta
121121
restart: always
122122
networks:
123123
- testnet
@@ -146,7 +146,7 @@ services:
146146

147147
rafiki-backend:
148148
container_name: rafiki-backend
149-
image: ghcr.io/interledger/rafiki-backend:v2.2.0-beta
149+
image: ghcr.io/interledger/rafiki-backend:v2.3.0-beta
150150
restart: always
151151
privileged: true
152152
volumes:
@@ -204,7 +204,7 @@ services:
204204

205205
rafiki-frontend:
206206
container_name: rafiki-frontend
207-
image: ghcr.io/interledger/rafiki-frontend:v2.2.0-beta
207+
image: ghcr.io/interledger/rafiki-frontend:v2.3.0-beta
208208
depends_on:
209209
- rafiki-backend
210210
restart: always
@@ -227,7 +227,7 @@ services:
227227

228228
rafiki-card-service:
229229
container_name: rafiki-card-service
230-
image: ghcr.io/interledger/rafiki-card-service:v2.2.0-beta
230+
image: ghcr.io/interledger/rafiki-card-service:v2.3.0-beta
231231
restart: always
232232
privileged: true
233233
networks:
@@ -247,7 +247,7 @@ services:
247247

248248
rafiki-pos-service:
249249
container_name: rafiki-pos-service
250-
image: ghcr.io/interledger/rafiki-point-of-sale:v2.2.0-beta
250+
image: ghcr.io/interledger/rafiki-point-of-sale:v2.3.0-beta
251251
restart: always
252252
privileged: true
253253
networks:

packages/boutique/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"dependencies": {
1111
"@google-cloud/logging-winston": "^6.0.1",
12-
"@interledger/open-payments": "^7.1.3",
12+
"@interledger/open-payments": "^7.3.0",
1313
"@shared/backend": "workspace:*",
1414
"@boutique/shared": "workspace:*",
1515
"awilix": "^12.0.5",

packages/boutique/backend/src/cache/token.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ export class TokenCache extends InMemoryCache<string> {
3131
url: this.env.PAYMENT_POINTER
3232
})
3333
const grant = await this.getGrant()
34+
if (!grant.access_token) {
35+
this.logger.error('Grant missing access_token.')
36+
throw new InternalServerError()
37+
}
3438
this.cacheToken({ access_token: grant.access_token })
3539
return grant.access_token.value
3640
}

packages/boutique/backend/src/open-payments/service.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ export class OpenPayments implements IOpenPayments {
323323
throw new InternalServerError()
324324
}
325325

326+
if (!continuation.access_token) {
327+
this.logger.error('Grant missing access_token.')
328+
throw new InternalServerError()
329+
}
330+
326331
return {
327332
accessToken: continuation.access_token.value,
328333
manageUrl: continuation.access_token.manage.replace(
@@ -334,7 +339,9 @@ export class OpenPayments implements IOpenPayments {
334339

335340
private isGrant(
336341
continuation: GrantContinuation | Grant
337-
): continuation is Grant {
342+
): continuation is Grant & {
343+
access_token: NonNullable<Grant['access_token']>
344+
} {
338345
return (continuation as Grant).access_token !== undefined
339346
}
340347

@@ -545,6 +552,11 @@ export class OpenPayments implements IOpenPayments {
545552
throw new InternalServerError()
546553
})
547554

555+
if (!grant.access_token) {
556+
this.logger.error('Grant missing access_token.')
557+
throw new InternalServerError()
558+
}
559+
548560
return await this.opClient.quote
549561
.create(
550562
{

pnpm-lock.yaml

Lines changed: 6 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)