mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-04 19:56:45 +02:00
Tests galore
This commit is contained in:
parent
d11c2e880b
commit
fd4bb50a14
@ -156,6 +156,7 @@ export class MatrixAuthenticationServiceContainer extends GenericContainer {
|
||||
super(image);
|
||||
|
||||
const initialConfig = deepCopy(DEFAULT_CONFIG);
|
||||
initialConfig.database.host = db.getHostname();
|
||||
initialConfig.database.username = db.getUsername();
|
||||
initialConfig.database.password = db.getPassword();
|
||||
|
||||
@ -205,6 +206,7 @@ export class MatrixAuthenticationServiceContainer extends GenericContainer {
|
||||
await super.start(),
|
||||
`http://localhost:${port}`,
|
||||
this.args,
|
||||
this.config.matrix.secret,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -219,6 +221,7 @@ export class StartedMatrixAuthenticationServiceContainer extends AbstractStarted
|
||||
container: StartedTestContainer,
|
||||
public readonly baseUrl: string,
|
||||
private readonly args: string[],
|
||||
public readonly sharedSecret: string,
|
||||
) {
|
||||
super(container);
|
||||
}
|
||||
|
||||
@ -184,6 +184,14 @@ const DEFAULT_CONFIG = {
|
||||
},
|
||||
room_list_publication_rules: [{ action: "allow" }],
|
||||
modules: [] as Array<{ module: string; config?: Record<string, unknown> }>,
|
||||
matrix_authentication_service: undefined as
|
||||
| undefined
|
||||
| {
|
||||
enabled?: boolean;
|
||||
endpoint?: string;
|
||||
secret?: string | null;
|
||||
secret_path?: string | null;
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
@ -278,7 +286,22 @@ export class SynapseContainer extends GenericContainer implements HomeserverCont
|
||||
}
|
||||
|
||||
public withMatrixAuthenticationService(mas?: StartedMatrixAuthenticationServiceContainer): this {
|
||||
this.mas = mas;
|
||||
if (mas) {
|
||||
this.mas = mas;
|
||||
this.withConfig({
|
||||
matrix_authentication_service: {
|
||||
enabled: true,
|
||||
endpoint: `http://${mas.getHostname()}:8080/`,
|
||||
secret: mas.sharedSecret,
|
||||
},
|
||||
// Must be disabled when using MAS.
|
||||
password_config: {
|
||||
enabled: false,
|
||||
},
|
||||
// Must be disabled when using MAS.
|
||||
enable_registration: false,
|
||||
});
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user