Skip to content

Commit d1e2f6e

Browse files
committed
fix: remove usage of Role.UPC
1 parent 1deb002 commit d1e2f6e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

api/src/unraid-api/auth/auth.service.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('AuthService', () => {
2222
id: '10f356da-1e9e-43b8-9028-a26a645539a6',
2323
name: 'Test API Key',
2424
description: 'Test API Key Description',
25-
roles: [Role.GUEST, Role.UPC],
25+
roles: [Role.GUEST, Role.CONNECT],
2626
createdAt: new Date().toISOString(),
2727
};
2828

@@ -39,7 +39,7 @@ describe('AuthService', () => {
3939
id: '-1',
4040
description: 'Test User',
4141
name: 'test_user',
42-
roles: [Role.GUEST, Role.UPC],
42+
roles: [Role.GUEST, Role.CONNECT],
4343
};
4444

4545
beforeEach(async () => {
@@ -134,13 +134,13 @@ describe('AuthService', () => {
134134

135135
const mockApiKeyWithoutRole = {
136136
...mockApiKey,
137-
roles: [Role.UPC],
137+
roles: [Role.ADMIN],
138138
};
139139

140140
vi.spyOn(apiKeyService, 'findById').mockResolvedValue(mockApiKeyWithoutRole);
141141
vi.spyOn(apiKeyService, 'findByIdWithSecret').mockResolvedValue({
142142
...mockApiKeyWithSecret,
143-
roles: [Role.UPC],
143+
roles: [Role.ADMIN],
144144
});
145145
vi.spyOn(apiKeyService, 'saveApiKey').mockResolvedValue();
146146
vi.spyOn(authzService, 'addRoleForUser').mockResolvedValue(true);
@@ -152,7 +152,7 @@ describe('AuthService', () => {
152152
expect(apiKeyService.findByIdWithSecret).toHaveBeenCalledWith(apiKeyId);
153153
expect(apiKeyService.saveApiKey).toHaveBeenCalledWith({
154154
...mockApiKeyWithSecret,
155-
roles: [Role.UPC, role],
155+
roles: [Role.ADMIN, role],
156156
});
157157
expect(authzService.addRoleForUser).toHaveBeenCalledWith(apiKeyId, role);
158158
});

api/src/unraid-api/auth/auth.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ export class AuthService {
220220
this.logger.debug('getSessionUser called!');
221221
return {
222222
id: '-1',
223-
description: 'UPC service account',
224-
name: 'upc',
225-
roles: [Role.UPC],
223+
description: 'Session receives administrator permissions',
224+
name: 'admin',
225+
roles: [Role.ADMIN],
226226
};
227227
}
228228
}

0 commit comments

Comments
 (0)