Case-insensitive webfinger response. Fixes #1955 & #1986 #2005
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Case-insensitive webfinger response
Case-insensitive database search
The sql_function “lower” has been added to crates/db_schema/src/lib.rs. This function allows one to perform a database searches applying lower(column) operations with diesel.
In /crates/db_schema/Cargo.toml, the [lib] block has been updated to be able to import the lib.rs functions.
The lower function is loaded by lemmy/crates/db_schema/src/impls/person.rs and lemmy/crates/db_schema/src/impls/community.rs, and used to perform a case-insensitive database searches via find_by_name and read_from_name, respectively. This allows the webfinger response to be case insensitive.
Include uppercase characters in the API_tests
Field tests
The user Sal can now be viewed in lemmy.ml:
https://lemmy.ml/u/Sal@mander.xyz
The following curls will trigger the correct webfinger responses for the user Sal and for the community main.
curl "https://mander.xyz/.well-known/webfinger?resource=acct:SaL@mander.xyz"
curl "https://mander.xyz/.well-known/webfinger?resource=acct:sal@mander.xyz"
curl "https://mander.xyz/.well-known/webfinger?resource=acct:main@mander.xyz"
curl "https://mander.xyz/.well-known/webfinger?resource=acct:MAIN@mander.xyz"
I have performed mastodon searches to fetch content as well, and the searches are now case-insensitive.
This commit would replace #2000. LemmyNet/lemmy-ui#525 can be reversed as users should be able to use uppercase names without problem. Issues #1955 and #1986 will be solved.