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

Update admin/domain_blocks to include conflict response #1417

Merged
merged 2 commits into from
May 7, 2024

Conversation

ThisIsMissEm
Copy link
Contributor

When creating a domain block, if there is already a domain block rule for the domain, then the existing block is returned. This documents that behavior.

I've also documented the digest property which was added in mastodon/mastodon#29092

When creating a domain block, if there is already a domain block rule for the domain, then the existing block is returned. This documents that behavior.

I've also documented the `digest` property which was added in mastodon/mastodon#29092
}
```

##### 422: Unprocessable entity - Existing Domain Block
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably this shouldn't be a 422 but instead a 409 conflict, I'm not sure how easy that would be to change though, since the 422 is existing behaviour.


```json
{
"error": "You have already imposed stricter limits on example.com."
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also misleading kind of: The check is just "do we have a domain block for any of the variants of example.com", it doesn't actually check that the block that is found is "stricter" than the requested block to create.

i.e., if you have a block for foo.example.com where you want to suspend, but you already have a block for example.com which is a silence, then you cannot create foo.example.com's block with suspend, because the rule for example.com prevents you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does sound like a bug, we may want to let people block subdomains of domains they have merely limited, and that is something the admin interface allows afaict

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@ThisIsMissEm ThisIsMissEm Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In IFTAS FediCheck we basically had to reimplement the domain block redundancy code, and comparing severity.

i've also an issue to add webhooks to federation management (would certainly be also good to know when a new domain is noticed, but this is much harder to implement )

@andypiper andypiper merged commit 5f0bd3c into mastodon:main May 7, 2024
@ThisIsMissEm ThisIsMissEm mentioned this pull request May 17, 2024
74 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants