Skip to content

Commit

Permalink
feat(backend): add AuthServiceClient dep
Browse files Browse the repository at this point in the history
  • Loading branch information
BlairCurrey committed Dec 18, 2024
1 parent dba2cd4 commit 02cc1d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/backend/jest.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ process.env.ILP_CONNECTOR_URL = 'http://127.0.0.1:3002'
process.env.ILP_ADDRESS = 'test.rafiki'
process.env.AUTH_SERVER_GRANT_URL = 'http://127.0.0.1:3006'
process.env.AUTH_SERVER_INTROSPECTION_URL = 'http://127.0.0.1:3007/'
process.env.AUTH_SERVICE_API_URL = 'http://127.0.0.1:3010'
process.env.WEBHOOK_URL = 'http://127.0.0.1:4001/webhook'
process.env.STREAM_SECRET = '2/PxuRFV9PAp0yJlnAifJ+1OxujjjI16lN+DBnLNRLA='
process.env.USE_TIGERBEETLE = false
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import {
import { createWebhookService } from './webhook/service'
import { createInMemoryDataStore } from './middleware/cache/data-stores/in-memory'
import { createTenantService } from './tenants/service'
import { AuthServiceClient } from './auth-service-client/client'

BigInt.prototype.toJSON = function () {
return this.toString()
Expand Down Expand Up @@ -220,6 +221,10 @@ export function initIocContainer(
return createInMemoryDataStore(config.localCacheDuration)
})

container.singleton('authServiceClient', async () => {
return new AuthServiceClient(config.authServiceApiUrl)
})

container.singleton('tenantService', async (deps) => {
return createTenantService({
logger: await deps.use('logger'),
Expand Down

0 comments on commit 02cc1d5

Please sign in to comment.