Skip to content

Conversation

@reivilibre
Copy link
Contributor

No description provided.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 30, 2025

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f678334
Status:🚫  Build failed.

View logs

@reivilibre reivilibre force-pushed the rei/templatecheck_stabilise branch from be3ceff to 4793f53 Compare October 30, 2025 16:33
@reivilibre reivilibre marked this pull request as ready for review October 30, 2025 16:45
@reivilibre reivilibre requested a review from a team as a code owner October 30, 2025 16:45
Comment on lines 57 to 62
for name in &[
"src/shared.css",
"src/templates.css",
"src/main.tsx",
"src/swagger.ts",
] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't particularly like that this list is hard-coded like that, especially since you might have a fork of the templates & assets that include extra assets handled by the vite build pipeline?

Instead, if feasible I would have a 'fake' version of include_assets that doesn't use the manifest at all?

// XXX: we should disallow SeedableRng::from_entropy
let mut rng = rand_chacha::ChaChaRng::from_entropy();
let now = if stabilise {
DateTime::from_timestamp_secs(0).unwrap()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use a more believable timestamp so that the IDs look like they are not all zeros?


impl<T: TemplateContext> TemplateContext for WithCaptcha<T> {
fn sample(
fn sample<R: Rng + Clone>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmmm a cloneable Rng is a bit suspicious at this stage? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only samples :D

///
/// Returns an error if any template fails to render with any of the sample.
pub(crate) fn all(templates: &Templates, now: chrono::DateTime<chrono::Utc>, rng: &mut impl rand::Rng) -> anyhow::Result<::std::collections::BTreeMap<(&'static str, SampleIdentifier), String>> {
pub(crate) fn all<R: Rng + Clone>(templates: &Templates, now: chrono::DateTime<chrono::Utc>, rng: &R) -> anyhow::Result<::std::collections::BTreeMap<(&'static str, SampleIdentifier), String>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of requiring a cloneable RNG here, we could seed a ChaChaRng out of the rng passed as parameter and clone it within the function. That would be a lot less suspicious :p

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, either one is suspicious, but at least this one is a bit less prolific so sure.

@reivilibre reivilibre requested a review from sandhose November 7, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants