Skip to content

Commit a2bea57

Browse files
committed
fix formatting
1 parent c563225 commit a2bea57

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

src/couchdb/document-changes.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ export class DocumentChangesService implements OnModuleDestroy {
7171
this.couchdbService.get<ChangesResponse>(db, '_changes', params),
7272
),
7373
catchError((err) => {
74-
this.logger.error(`Changes feed error for "${db}":`, err?.stack || String(err));
74+
this.logger.error(
75+
`Changes feed error for "${db}":`,
76+
err?.stack || String(err),
77+
);
7578
throw err;
7679
}),
7780
retry({ delay: 1000 }),

src/permissions/permission-check/permission-check.controller.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ export class PermissionCheckController {
9595

9696
const uniqueUserIds = [...new Set(body.userIds)];
9797
const results = await Promise.all(
98-
uniqueUserIds.map((userId) => this.evaluatePermissionForUser(userId, action, entityDoc)),
98+
uniqueUserIds.map((userId) =>
99+
this.evaluatePermissionForUser(userId, action, entityDoc),
100+
),
99101
);
100102

101103
return Object.fromEntries(results);
@@ -119,8 +121,7 @@ export class PermissionCheckController {
119121
}
120122

121123
if (
122-
body.userIds.length >
123-
PermissionCheckController.MAX_USER_IDS_PER_REQUEST
124+
body.userIds.length > PermissionCheckController.MAX_USER_IDS_PER_REQUEST
124125
) {
125126
throw new BadRequestException(
126127
`userIds must contain at most ${PermissionCheckController.MAX_USER_IDS_PER_REQUEST} entries`,
@@ -172,12 +173,16 @@ export class PermissionCheckController {
172173
return [userId, { permitted: false, error: 'NOT_FOUND' }] as const;
173174
}
174175
// Infrastructure failure: server error, auth, or rate-limit -> fail the whole batch
175-
throw new BadGatewayException('Upstream identity provider is unavailable');
176+
throw new BadGatewayException(
177+
'Upstream identity provider is unavailable',
178+
);
176179
}
177180

178181
// Network-level failure (no response at all) -> fail the whole batch
179182
if (error instanceof AxiosError) {
180-
throw new BadGatewayException('Upstream identity provider is unavailable');
183+
throw new BadGatewayException(
184+
'Upstream identity provider is unavailable',
185+
);
181186
}
182187

183188
// Unknown/unexpected error -> log and report per-user

src/permissions/rules/rules.service.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ describe('RulesService', () => {
236236
it('should start without permissions when initial load fails and recover via changes feed', async () => {
237237
// Create a fresh service whose initial load will fail
238238
const failingCouchdbService = {
239-
get: jest.fn().mockReturnValue(throwError(() => new Error('connection refused'))),
239+
get: jest
240+
.fn()
241+
.mockReturnValue(throwError(() => new Error('connection refused'))),
240242
} as any;
241243
const freshChangesSubject = new Subject<ChangeResult>();
242244
const freshModule = await Test.createTestingModule({
@@ -253,7 +255,9 @@ describe('RulesService', () => {
253255
{ provide: CouchdbService, useValue: failingCouchdbService },
254256
{
255257
provide: DocumentChangesService,
256-
useValue: { getChanges: jest.fn().mockReturnValue(freshChangesSubject) },
258+
useValue: {
259+
getChanges: jest.fn().mockReturnValue(freshChangesSubject),
260+
},
257261
},
258262
],
259263
}).compile();

src/permissions/user-identity/keycloak-user-admin.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { HttpService } from '@nestjs/axios';
2-
import { Injectable, InternalServerErrorException, Logger } from '@nestjs/common';
2+
import {
3+
Injectable,
4+
InternalServerErrorException,
5+
Logger,
6+
} from '@nestjs/common';
37
import { ConfigService } from '@nestjs/config';
48
import { firstValueFrom } from 'rxjs';
59
import { UserAccount } from '../../restricted-endpoints/session/user-auth.dto';

0 commit comments

Comments
 (0)