Skip to content

Conversation

@amCap1712
Copy link
Member

TBA

@amCap1712 amCap1712 mentioned this pull request Dec 21, 2024
@github-actions
Copy link

github-actions bot commented Dec 21, 2024

Test Results

236 tests  +37   231 ✅ +37   48s ⏱️ +21s
  1 suites ± 0     5 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit da8e04c. ± Comparison against base commit 4003c6b.

This pull request removes 24 and adds 61 tests. Note that renamed tests count towards both.
metabrainz.admin.views_test.AdminViewsTestCase ‑ test_index
metabrainz.supporter.views_test.SupportersViewsTestCase ‑ test_login
metabrainz.supporter.views_test.SupportersViewsTestCase ‑ test_logout
metabrainz.supporter.views_test.SupportersViewsTestCase ‑ test_musicbrainz
metabrainz.supporter.views_test.SupportersViewsTestCase ‑ test_musicbrainz_post
metabrainz.supporter.views_test.SupportersViewsTestCase ‑ test_signup
metabrainz.views_test.IndexViewsTestCase ‑ test_about
metabrainz.views_test.IndexViewsTestCase ‑ test_about_customers
metabrainz.views_test.IndexViewsTestCase ‑ test_bad_customers
metabrainz.views_test.IndexViewsTestCase ‑ test_code_of_conduct
…
metabrainz.admin.views_test.AdminViewsTestCase ‑ test_supporter_admin_index
metabrainz.admin.views_test.AdminViewsTestCase ‑ test_user_admin_index
metabrainz.index.views_test.IndexViewsTestCase ‑ test_about
metabrainz.index.views_test.IndexViewsTestCase ‑ test_about_customers
metabrainz.index.views_test.IndexViewsTestCase ‑ test_bad_customers
metabrainz.index.views_test.IndexViewsTestCase ‑ test_code_of_conduct
metabrainz.index.views_test.IndexViewsTestCase ‑ test_contact
metabrainz.index.views_test.IndexViewsTestCase ‑ test_dataset_download
metabrainz.index.views_test.IndexViewsTestCase ‑ test_dataset_signup
metabrainz.index.views_test.IndexViewsTestCase ‑ test_datasets
…

♻️ This comment has been updated with latest results.

@MonkeyDo
Copy link
Member

Reviewed and cleaned up the sign in and sign up pages (user and supporters, commercial and non-commercial)

Supporters
image
image

End users
image
image

amCap1712 and others added 24 commits October 16, 2025 21:51
Add a moderation log to keep track of decisions as well.
It was duplicated and unused on two pages
and add a button to show/hide the password
Fix form validation and UI hints, rework the UI to be more user-friendly, cleanup markup, make it more mobile friendly
same as other pages, big call-to-action button as in the design files
We don't want end-users to create accounts directly on MeB.org, but it might just happen, so adding a link to the signup page they would be looking for.
Otherwise the entire test suite fails
@amCap1712 amCap1712 requested review from MonkeyDo and mayhem November 4, 2025 09:39
@amCap1712 amCap1712 changed the base branch from master to oauth-phase-2 November 4, 2025 09:58
Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

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

A very cursory scan, but looks good from that distance. I think we should make a great effort testing this codebase and be really picky about ongoing PRs. We'll need lots of eyes on the new site.

@@ -1,5 +1,7 @@
BEGIN;

-- TODO: Add some, if needed.
Copy link
Member

Choose a reason for hiding this comment

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

cleanup?



class MeBFlaskForm(FlaskForm):

Copy link
Member

Choose a reason for hiding this comment

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

docstrings.

from brainzutils.mail import send_mail
from metabrainz.model.user import User

VERIFY_EMAIL = "verify-email"
Copy link
Member

Choose a reason for hiding this comment

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

These are oddly named. What do they do?

EMAIL_VERIFICATION_EXPIRY = timedelta(hours=24)
EMAIL_RESET_PASSWORD_EXPIRY = timedelta(hours=24)

# Bcrypt
Copy link
Member

Choose a reason for hiding this comment

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

What are these config items? Some explanation or a link to possible values would be good.

@mayhem
Copy link
Member

mayhem commented Nov 4, 2025

One request: The admin interface was always ugly and now its gotten even worse. :( No need to design a masterpiece, but it would be nice to make some improvements so we dont have giant black bars and then like. :)

response.headers["Pragma"] = "no-cache"
response.headers["X-Frame-Options"] = "DENY"
response.headers["Referrer-Policy"] = "no-referrer"
# todo: add content-security-policy headers
Copy link
Contributor

@julian45 julian45 Nov 9, 2025

Choose a reason for hiding this comment

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

Perhaps while working with this file, it may be worthwhile to resolve this todo.

For example, knowing that X-Frame-Options: DENY is in place (i.e., this is not to be displayed in a frame anywhere), and assuming that this is only meant to be shown on meb.o (or self-hosted equivalents) and possibly draw from static media, we could use:

Content-Security-Policy: frame-ancestors 'none'; frame-src 'none'; object-src 'none'; img-src 'self' https://staticbrainz.org/

...but that's an approximation. (ref: MDN Content-Security-Policy documentation)

def after_oauth2_request(response):
""" Add security headers for Referrer-Policy, Content-Security-Policy, Cache-Control and X-Frame-Options """
response.headers["Cache-Control"] = "no-store"
response.headers["Pragma"] = "no-cache"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you expect relevant endpoints to be called by HTTP/1.0 clients? If not, we should consider removing this header, as it is deprecated.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, since Cache-Control: no-store per the preceding line, I believe this setting is also kind of ignored since no-store seems to be the most restrictive directive among possible Cache-Control values; see MDN Pragma, Cache-Control pages.

- "8150"

meb_db:
image: postgres:12.3
Copy link
Contributor

Choose a reason for hiding this comment

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

Change would be out of scope for this specific PR, but even though this Compose file is for a dev environment, I still feel obliged to point out that Postgres 12 is well past end-of-life. 13 goes EoL in a few days as well, so 14 should be the minimum at this point.

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.

6 participants