Skip to content

Add support for other instances #5

@ornato-t

Description

@ornato-t

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions