Clear remaining M0/M1 bugs on master (T-22, T-25, T-27, T-31, T-35)

This commit is contained in:
Boki 2026-11-27 16:19:09 -05:00
parent 9e259ca43b
commit b20fc28e45
8 changed files with 245 additions and 252 deletions

View file

@ -554,6 +554,33 @@ describe('Config Schemas', () => {
});
describe('mongodbConfigSchema', () => {
it('should reject no-credential URIs with unencoded @ after path/query while allowing credentialed URIs (T-31)', () => {
expect(() =>
mongodbConfigSchema.parse({
uri: 'mongodb://localhost:27017/db@foo',
database: 'testdb',
})
).toThrow();
expect(() =>
mongodbConfigSchema.parse({
uri: 'mongodb://localhost:27017/db?appName=a@b',
database: 'testdb',
})
).toThrow();
expect(() =>
mongodbConfigSchema.parse({
uri: 'mongodb://user:pass@localhost:27017/db?appName=a@b',
database: 'testdb',
})
).not.toThrow();
expect(() =>
mongodbConfigSchema.parse({
uri: 'mongodb://prod_user:strong-secret@%2Fvar%2Frun%2Fmongodb%2Fmongod.sock/stock',
database: 'stock',
})
).not.toThrow();
});
it('should accept minimal config', () => {
const config = mongodbConfigSchema.parse({
uri: 'mongodb://localhost:27017',