0xtrr / cherry-server

A media server implementing the Blossom protocol.
3 stars 1 forks source link

Handle multiple x tags in auth event #6

Closed laanwj closed 2 months ago

laanwj commented 2 months ago

Implement handling of multiple x tags in auth event, as well as simplify some code.

Change the authentication flow to define a function validate_auth_event_x that checks if a certain filehash is allowed to be accessed according to an authentication event.

This function is used in the existing validate_file_hash. The function extract_file_hash_from_auth_event was removed because it's not compatible with this flow and also not really needed.

Changes per endpoint:

Closes #3.

0xtrr commented 2 months ago

This looks great, thanks! I actually have a patch for this too but I scope creeped that branch to include tests so you beat me to it 😄 I like yours better so I'll merge it and add tests in a separate patch. I have some ideas to clean up the code a bit too.