Nutomic
f6a24e133a
Replace clippy allow annotation with expect ( fixes #5012 ) ( #5048 )
2024-09-24 13:29:02 -04:00
Nutomic
dea6ee462c
Upgrade http crate ( #5006 )
...
* Remove opentelemetry
* remove unused deps, use backtrace
* always print db migration messages regardless of log level (fixes #4725 )
* fix ci
* Remove useless root span builder
* Upgrade http and opentelemetry crates
* more fixes
* cleanup
* use release
* upgrade more deps
2024-09-12 05:49:09 -04:00
Dessalines
ba044c7d98
Adding checks for higher admin and mod. ( #4860 )
...
* Adding checks for higher admin and mod.
* Adding admin/mod checks for ban and comment removal.
* Combining mod or admin check with an SQL union.
* Making community ban or add mod also allow higher admins.
* Making sure remove post also checks higher mods or admins.
* Add unit test for is_higher_mod_or_admin_check
* Fixing comment.
* Addressing PR comments.
* Get rid of pointless wrapper functions, return lemmyresult directly.
2024-07-16 12:22:47 +02:00
dullbananas
79e6dbf0de
Remove PersonInsertForm builder ( #4779 )
...
* Update session_middleware.rs
* Update private_message_report_view.rs
* Update session_middleware.rs
* Update private_message_view.rs
* Update private_message.rs
* Update registration_application_view.rs
* Update actor_language.rs
* Update vote_view.rs
* Update code_migrations.rs
* Update comment_aggregates.rs
* Update person_view.rs
* Update user_settings_backup.rs
* Update person.rs
* Update create.rs
* Update comment_view.rs
* Update moderator.rs
* Update site_aggregates.rs
* Update claims.rs
* Update community_aggregates.rs
* Update post_report.rs
* Update person_mention_view.rs
* Update community_view.rs
* Update comment_report_view.rs
* Update post_report_view.rs
* Update community_moderators.rs
* Update comment.rs
* Update person_aggregates.rs
* Update comment_reply_view.rs
* Update password_reset_request.rs
* Update post_aggregates.rs
* Update community.rs
* Update main.rs
* Update post.rs
* Update person.rs
* Update person.rs
* Update claims.rs
* Update person.rs
* Update create.rs
* Update user_settings_backup.rs
* Update community_moderators.rs
* Update main.rs
* Update comment_aggregates.rs
* Update community_aggregates.rs
* Update person.rs
* Update Cargo.toml
* Update Cargo.toml
* Update person.rs
* fix
* Update code_migrations.rs
* fix submodule
* Update person.rs
2024-06-06 08:29:18 -04:00
Dessalines
d075acce43
Make all single-fetch database calls return an Option. ( #4617 )
...
- Diesel ordinarily throws an error when no results are returned for a
single fetch, which is a bit confusing. This PR ensures that the
missing value cases are all caught, and wrapped with new LemmyErrors,
rather than diesel errors.
- Fixes #4601
2024-04-16 14:48:15 +02:00
Dessalines
95069d7648
Fixing some clippy and woodpecker lints. ( #4565 )
...
* Fixing some clippy and woodpecker lints.
* Try fixing woodpecker 1.
* Revert "Try fixing woodpecker 1."
This reverts commit 7c2020a08d
.
2024-03-26 10:17:42 +01:00
Nutomic
846848c4f6
On registration, automatically set content languages from accept-language
header ( #4550 )
...
* On registration, automatically set content languages from accept header
* no need to set site language or default language for new user anymore
* fix test
* fix langs
* avoid duplicate writing of new user languages
2024-03-25 16:02:12 -04:00
Nutomic
3d6f7ff911
Revert "Dont ignore errors during login ( fixes #4319 ) ( #4321 )" ( #4380 )
...
This reverts commit 4163e0465e
.
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2024-01-19 11:21:43 -05:00
Nutomic
3cad3b2119
Dont overwrite cache-control header in session middleware ( #4337 )
2024-01-04 11:44:36 -05:00
ALEX11BR
a5289dd4cf
Use pretty_assertions
for assertions ( #4347 )
...
* Use `pretty_assertions` for assertions
* fixed ordering of `use`s
* ci
---------
Co-authored-by: Felix Ableitner <me@nutomic.com>
2024-01-04 04:47:18 -05:00
Nutomic
4163e0465e
Dont ignore errors during login ( fixes #4319 ) ( #4321 )
...
* Dont ignore errors during login (fixes #4319 )
* fix test
* fmt
2024-01-03 10:34:03 -05:00
Nutomic
a790a24c4d
Revert debug auth ( #4232 )
...
* Revert "Some changes to help debug auth problems on lemmy.ml (#4220 )"
This reverts commit 16ac893e15
.
* Rename auth cookie back to jwt
2023-12-05 11:22:08 -05:00
Nutomic
16ac893e15
Some changes to help debug auth problems on lemmy.ml ( #4220 )
...
* Some changes to help debug auth problems on lemmy.ml
* fix
* clippy
2023-12-01 09:18:29 -05:00
dullbananas
a14657d124
Refactor rate limiter and improve rate limit bucket cleanup ( #3937 )
...
* Update rate_limiter.rs
* Update mod.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update mod.rs
* Update scheduled_tasks.rs
* Shrink `RateLimitBucket`
* Update rate_limiter.rs
* Update mod.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update mod.rs
* Update rate_limiter.rs
* fmt
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* Update rate_limiter.rs
* rerun ci
* Update rate_limiter.rs
* Undo changes to fields
* Manually undo changes to RateLimitBucket fields
* fmt
* Bucket cleanup loop in rate_limit/mod.rs
* Remove rate limit bucket cleanup from scheduled_tasks.rs
* Remove ;
* Remove UNINITIALIZED_TOKEN_AMOUNT
* Update rate_limiter.rs
* fmt
* Update rate_limiter.rs
* fmt
* Update rate_limiter.rs
* fmt
* Update rate_limiter.rs
* stuff
* MapLevel trait
* fix merge
* Prevent negative numbers in buckets
* Clean up MapLevel::check
* MapLevel::remove_full_buckets
* stuff
* Use remove_full_buckets to avoid allocations
* stuff
* remove tx
* Remove RateLimitConfig
* Rename settings_updated_channel to rate_limit_cell
* Remove global rate limit cell
* impl Default for RateLimitCell
* bucket_configs doc comment to explain EnumMap
* improve test_rate_limiter
* rename default to with_test_config
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
2023-10-19 15:31:51 +02:00
Nutomic
3f62135083
Add validate_auth api endpoint ( fixes #3702 ) ( #4049 )
...
* Add validate_auth api endpoint (fixes #3702 )
* clippy
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-17 11:25:48 -04:00
Nutomic
9e099726e6
Cleanup checks for community actions ( fixes #2858 , fixes #2868 ) ( #4028 )
...
* Cleanup checks for community actions (fixes #2858 , fixes #2868 )
* allow restoring deleted community
* review changes
* remove unneeded sql
* remove joins
* change mod log check
2023-10-13 09:48:18 -04:00
Nutomic
dc327652a5
Add db table for login tokens which allows for invalidation ( #3818 )
...
* wip
* stuff
* fmt
* fmt 2
* fmt 3
* fix default feature
* use Authorization header
* store ip and user agent for each login
* add list_logins endpoint
* serde(skip) for token
* fix api tests
* A few suggestions for login_token (#3991 )
* A few suggestions.
* Fixing SQL format.
* review
* review
* rename cookie
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-10-09 12:46:12 +02:00
SleeplessOne1917
3a76a10931
chore: Run rust format
2023-09-22 21:48:27 -04:00
SleeplessOne1917
519e800b33
feat: Replace ad hoc auth header with internet standard bearer token
...
auth header
2023-09-22 21:26:27 -04:00
Nutomic
f858d8cbce
Remove explicit auth params ( #3946 )
...
* Remove explicit auth params (ref #3725 )
Only take auth via header or cookie. This requires a new version
of lemmy-js-client for api tests to pass.
* rework api_crud
* remove remaining auth params, move logic to session middleware
* fmt, fix test
* update js client
* remove auth param from api tests
* Pass auth as header
* add !
* url vars, setHeader
* cleanup
* fmt
* update
* Updating for new lemmy-js-client.
---------
Co-authored-by: Dessalines <tyhou13@gmx.com>
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-09-21 06:42:28 -04:00
Nutomic
b2aee565f3
Allow passing auth via header or cookie ( #3725 )
...
* Allow passing auth via header or cookie
* revert submodule
* taplo
* fix build
* working
* convert apub api methods
* also set cache-control header
* opt
* clippy
* deduplicate code, ignore invalid auth
* clippy
---------
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-08-29 10:47:57 -04:00