Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for other instances #5

Open
ornato-t opened this issue Nov 1, 2023 · 0 comments
Open

Add support for other instances #5

ornato-t opened this issue Nov 1, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ornato-t
Copy link
Contributor

ornato-t commented Nov 1, 2023

Right now the API assumes every user calling it has an account on the same instance where Flair is running, and automatically polls localhost or the lemmy address on the docker-compose network. This is, however, often not the case.

This issue is part of a larger effort to add Federation support to Flair.

Flair needs to know where it is

A new environment variable should save the domain of the Flair server. The presence of this variable should be mandatory.

The variable should be preserved and passed down to the verify_user and verify_mod functions through the AppState struct.

It should know it, by knowing where it isn't

Users from instances different than the local one should be verified with a query to their own instance.

The "verify" handlers should extract the instance domain from the actor_id, match it with the aforementioned environment variable and, if necessary, poll the remote instance instead.

⚠️ When called over the internet, the endpoint tends to be extremely slow (> 2s). This will impact the response time of PUT and DELETE requests.

@ornato-t ornato-t added the enhancement New feature or request label Nov 1, 2023
@ornato-t ornato-t added this to the Federation milestone Nov 1, 2023
@ornato-t ornato-t self-assigned this Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant