Commit graph

25 commits

Author SHA1 Message Date
Daniel M Brasil
cc5d2e22dd Improve test coverage for /api/v1/admin/canonical_email_blocks () 2023-05-22 15:27:35 +02:00
Daniel M Brasil
4d07793150 Fix POST /api/v1/admin/domain_allows returning 200 when no domain is specified () 2023-05-22 13:44:49 +02:00
Daniel M Brasil
67d0dfbc67 Improve test coverage for /api/v1/admin/email_domain_blocks () 2023-05-22 13:28:11 +02:00
Daniel M Brasil
90466ee43a Improve test coverage for /api/v1/admin/ip_blocks_controller () 2023-05-22 12:50:44 +02:00
Daniel M Brasil
7cf0ce19e2 Fix uncaught NoMethodError error in /api/v1/admin/canonical_email_blocks/test ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-12 13:46:16 +02:00
Matt Jankowski
cf86cc68b7 Fix RSpec/InferredSpecType cop () 2023-05-04 05:49:53 +02:00
Matt Jankowski
8dec215a57 Fix RSpec/ContextWording cop () 2023-05-04 05:49:08 +02:00
Robert R George
335b53ab48 Add trend management to admin API () 2023-04-18 11:33:30 +02:00
Matt Jankowski
9a16204737 Specs api v1 controllers () 2023-03-04 17:12:54 +01:00
Nick Schonning
dd46810e8a Enable Style/FrozenStringLiteralComment for specs () 2023-02-22 09:55:31 +09:00
Nick Schonning
0d47dee648 Autofix Rubocops RSpec/ScatteredLet () 2023-02-20 11:17:41 +09:00
Nick Schonning
35dbf602f2 Autofix Rubocop Lint/ParenthesesAsGroupedExpression () 2023-02-18 04:00:05 +01:00
Claire
94d294202b Fix changing domain block severity not undoing individual account effects ()
* Fix changing domain block severity not undoing individual account effects

Fixes 

* Add tests
2022-12-15 17:45:02 +01:00
Francis Murillo
5ad9fea52a Log admin approve and reject account ()
* Log admin approve and reject account

* Add unit tests for approve and reject logging
2022-12-07 00:25:18 +01:00
Eugen Rochko
2b3b063852 Fix error when invalid domain name is submitted ()
Fix 
2022-11-14 08:07:14 +01:00
Eugen Rochko
eedf46b243 Fix account action type validation ()
* Fix account action type validation

Fix 

* Fix 

* Fix code style issues
2022-10-30 02:44:32 +02:00
Eugen Rochko
e164d6a687 Add customizable user roles ()
* Add customizable user roles

* Various fixes and improvements

* Add migration for old settings and fix tootctl role management
2022-07-05 02:41:40 +02:00
Claire
d0cc795d0f Add /api/v1/admin/domain_allows ()
- `GET /api/v1/admin/domain_allows` lists allowed domains
- `GET /api/v1/admin/domain_allows/:id` shows one by ID
- `DELETE /api/v1/admin/domain_allows/:id` deletes a given domain from the list
  of allowed domains
- `POST /api/v1/admin/domain_allows` to allow a new domain:
  if that domain is already allowed, the existing DomainAllow will be returned
2022-06-23 23:12:01 +02:00
Claire
9f3bf956ad Add /api/v1/admin/domain_blocks ()
* Add /api/v1/admin/domain_blocks

Fixes 

- `GET /api/v1/admin/domain_blocks` lists domain blocks
- `GET /api/v1/admin/domain_blocks/:id` shows one by ID
- `DELETE /api/v1/admin/domain_blocks/:id` deletes a given domain block
- `POST /api/v1/admin/domain_blocks` to create a new domain block:
  if it conflicts with an existing one, returns an error with
  an attribute `existing_domain_block` with the rendered domain block

* Simplify conflict handling as suggested in review
2022-06-01 17:31:36 +02:00
Claire
0fde990a01 Fix /api/v1/admin/accounts ()
* Fix /api/v1/admin/accounts

Compatibility was broken since  which changed the underlying filter class
without changing the controller.

This commits restore support for the old parameters.

* Add /api/v2/admin/accounts with the new parameters

* Add tests

* Add missing filter for `silenced` status

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
2022-03-28 23:57:38 +02:00
Josh Soref
1c070bd94c Spelling ()
* spelling: account

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: affiliated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: appearance

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: autosuggest

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: cacheable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: component

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: conversations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: domain.example

Clarify what's distinct and use RFC friendly domain space.

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: environment

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exceeds

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: functional

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: inefficiency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: not

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: notifications

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurring

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: position

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: progress

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: promotable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: reblogging

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repetitive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: resolve

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: saturated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: similar

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: strategies

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: success

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: targeting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: thumbnails

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unauthorized

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unsensitizes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: validations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: various

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-03-06 22:51:40 +01:00
Claire
1f07ab014d Refactor and improve tests ()
* Change account and user fabricators to simplify and improve tests

- `Fabricate(:account)` implicitly fabricates an associated `user` if
  no `domain` attribute is given (an account with `domain: nil` is
  considered a local account, but no user record was created), unless
  `user: nil` is passed
- `Fabricate(:account, user: Fabricate(:user))` should still be possible
  but is discouraged.

* Fix and refactor tests

- avoid passing unneeded attributes to `Fabricate(:user)` or
  `Fabricate(:account)`
- avoid embedding `Fabricate(:user)` into a `Fabricate(:account)` or the other
  way around
- prefer `Fabricate(:user, account_attributes: …)` to
  `Fabricate(:user, account: Fabricate(:account, …)`
- also, some tests were using remote accounts with local user records, which is
  not representative of production code.
2022-01-28 00:46:42 +01:00
Eugen Rochko
38be9af436 Add support for reversible suspensions through ActivityPub () 2020-11-08 00:28:39 +01:00
Takeshi Umeda
385c2eac6f Add account sensitized ()
* Add account sensitized

* Fix i18n normalize

* Fix description and spec

* Fix spec

* Fix wording
2020-11-04 20:45:01 +01:00
Eugen Rochko
433036ab8c Add moderation API ()
Fix 
Fix 
2019-06-20 02:52:34 +02:00