fix: negotiate downstream cmpp protocol versions
This commit is contained in:
@@ -69,6 +69,7 @@ function createPrismaMock() {
|
||||
id: 'app-1',
|
||||
tenantId: 'tenant-1',
|
||||
cmppAccount: '100001',
|
||||
cmppEnterpriseCode: 'SP0001',
|
||||
secretHash: 'secret-hash',
|
||||
status: 'active',
|
||||
interfaceEnabled: true,
|
||||
@@ -439,6 +440,20 @@ describe('SendChainService', () => {
|
||||
expect(prisma.smsBatchTask.create).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('returns the application enterprise code after Gateway authentication', async () => {
|
||||
const { service } = createService();
|
||||
|
||||
await expect(service.authenticateInboundApplication({
|
||||
account: '100001',
|
||||
password: 'secret-hash',
|
||||
remoteIp: '127.0.0.1',
|
||||
})).resolves.toEqual(expect.objectContaining({
|
||||
account: '100001',
|
||||
enterpriseCode: 'SP0001',
|
||||
status: 'authenticated',
|
||||
}));
|
||||
});
|
||||
|
||||
it('rejects Gateway authentication when application interface is disabled', async () => {
|
||||
const { service, prisma } = createService();
|
||||
prisma.smsApplication.findFirst.mockResolvedValue({
|
||||
|
||||
Reference in New Issue
Block a user