Commit Graph

5 Commits

Author SHA1 Message Date
Bartłomiej Dach 7e3564cb4a
Bring back matching by filename when performing online metadata lookups 2024-10-30 10:25:20 +01:00
Bartłomiej Dach 776fabd77c
Only use MD5 when performing metadata lookups
Both online and offline using the cache.

The rationale behind this change is that in the current state of
affairs, `TestPartiallyMaliciousSet()` fails in a way that cannot be
reconciled without this sort of change.

The test exercises a scenario where the beatmap being imported has an
online ID in the `.osu` file, but its hash does not match the online
hash of the beatmap. This turns out to be a more frequent scenario than
envisioned because of users doing stupid things with manual file editing
rather than reporting issues properly.

The scenario is realistic only because the behaviour of the endpoint
responsible for looking up beatmaps is such that if multiple parameters
are given (e.g. all three of beatmap MD5, online ID, and filename), it
will try the three in succession:

	f6b341813b/app/Http/Controllers/BeatmapsController.php (L260-L266)

and the local metadata cache implementation reflected this
implementation.

Because online ID and filename are inherently unreliable in this
scenario due to being directly manipulable by clueless or malicious
users, neither should not be used as a fallback.
2024-10-30 08:12:30 +01:00
Bartłomiej Dach c930ec97d6
Polish xmldocs 2023-06-08 19:11:48 +02:00
Bartłomiej Dach 29ce27098d
Refactor again to fix test failures 2023-06-08 19:11:48 +02:00
Bartłomiej Dach 7c8c6790d0
Refactor metadata lookup to streamline online metadata application logic 2023-06-08 19:11:48 +02:00