Tests galore
This commit is contained in:
@@ -156,6 +156,7 @@ export class MatrixAuthenticationServiceContainer extends GenericContainer {
|
|||||||
super(image);
|
super(image);
|
||||||
|
|
||||||
const initialConfig = deepCopy(DEFAULT_CONFIG);
|
const initialConfig = deepCopy(DEFAULT_CONFIG);
|
||||||
|
initialConfig.database.host = db.getHostname();
|
||||||
initialConfig.database.username = db.getUsername();
|
initialConfig.database.username = db.getUsername();
|
||||||
initialConfig.database.password = db.getPassword();
|
initialConfig.database.password = db.getPassword();
|
||||||
|
|
||||||
@@ -205,6 +206,7 @@ export class MatrixAuthenticationServiceContainer extends GenericContainer {
|
|||||||
await super.start(),
|
await super.start(),
|
||||||
`http://localhost:${port}`,
|
`http://localhost:${port}`,
|
||||||
this.args,
|
this.args,
|
||||||
|
this.config.matrix.secret,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,6 +221,7 @@ export class StartedMatrixAuthenticationServiceContainer extends AbstractStarted
|
|||||||
container: StartedTestContainer,
|
container: StartedTestContainer,
|
||||||
public readonly baseUrl: string,
|
public readonly baseUrl: string,
|
||||||
private readonly args: string[],
|
private readonly args: string[],
|
||||||
|
public readonly sharedSecret: string,
|
||||||
) {
|
) {
|
||||||
super(container);
|
super(container);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,6 +184,14 @@ const DEFAULT_CONFIG = {
|
|||||||
},
|
},
|
||||||
room_list_publication_rules: [{ action: "allow" }],
|
room_list_publication_rules: [{ action: "allow" }],
|
||||||
modules: [] as Array<{ module: string; config?: Record<string, unknown> }>,
|
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 {
|
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;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user