Skip to content

Commit e8c1c09

Browse files
committed
refactor: update StalwartService and tests for credential structure
1 parent b72879f commit e8c1c09

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/modules/infrastructure/stalwart/stalwart.service.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ describe('StalwartService', () => {
137137
name: 'alice',
138138
domainId: 'dom1',
139139
description: 'Alice',
140-
credentials: { '@type': 'Password', secret: 'pw' },
140+
credentials: { '0': { '@type': 'Password', secret: 'pw' } },
141141
roles: { '@type': 'User' },
142+
permissions: { '@type': 'Inherit' },
142143
quotas: { maxDiskQuota: 5_000_000 },
143144
});
144145
});

src/modules/infrastructure/stalwart/stalwart.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ export class StalwartService implements OnModuleInit, OnModuleDestroy {
8989
'@type': TYPE_USER,
9090
name: params.name,
9191
domainId: params.domainId,
92-
credentials: { '@type': TYPE_PASSWORD, secret: params.password },
92+
credentials: { '0': { '@type': TYPE_PASSWORD, secret: params.password } },
9393
roles: { '@type': TYPE_USER },
94+
permissions: { '@type': 'Inherit' },
9495
};
9596
if (params.description !== undefined) {
9697
create.description = params.description;

0 commit comments

Comments
 (0)