70 Commits

Author SHA1 Message Date
Philip Jenvey
ad62f454b8
refactor: String -> &str
Issue STOR-330
2025-10-17 12:20:42 -07:00
Barry Chen
3404150792
chore(syncserver): break up extractors.rs 2025-10-06 21:41:24 -04:00
Barry Chen
730d6b8173
refactor(db): return only a SyncTimestamp from post_bsos db fns
Co-authored-by: Philip Jenvey <pjenvey@underboss.org>
2025-09-29 14:36:09 -05:00
Philip Jenvey
192d64c7c3
feat: switch syncstorage to diesel-async
Closes STOR-364
2025-09-23 18:32:51 -07:00
Philip Jenvey
0400c2dd15
feat: adapt the test suite to the generic dyn DbPool (#1808)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
and moved the couple generic Db methods into the trait itself

Closes STOR-360
2025-09-19 13:20:49 -07:00
Barry Chen
204c13e75d
chore: use environment value from syncserver settings for Sentry
Co-authored-by: Philip Jenvey <pjenvey@underboss.org>
2025-09-18 08:14:38 -05:00
Philip Jenvey
f2698a4251
feat: switch tokenserver to diesel-async (#1790)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
Closes STOR-326
2025-09-08 13:08:29 -07:00
Philip Jenvey
b89b06d24f
feat: kill Db's impl of Clone (#1789)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
by utilizing async closures' improved borrowing semantics

Closes STOR-350
2025-09-04 14:58:11 -07:00
Philip Jenvey
38cb38fbd9
refactor: switch syncstorage Db methods to &mut self
Closes STOR-327
2025-09-02 13:50:20 -07:00
Philip Jenvey
614e3902d0
refactor: switch tokenserver Db methods to &mut self
Closes STOR-332
2025-09-02 13:50:19 -07:00
Taddes
f7197fefb8
chore: update syncstorage rust (#1749)
chore: update syncstorage rust
2025-08-13 15:14:34 -04:00
Philip Jenvey
2fb6b84ad4
fix: make pyo3 usage optional per the feature flag (#1731)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
and cleanup feature flag usage (only specifying defaults in syncserver's
Cargo.toml)

Closes STOR-295
2025-07-29 17:08:29 -07:00
Philip Jenvey
dd546f028e
chore: strip actix-web features (#1713)
Some checks are pending
Glean probe-scraper / glean-probe-scraper (push) Waiting to run
while providing an optional actix-compress feature

also disables actix-web's cookies and unicode features

Closes STOR-256
2025-07-02 14:04:43 -07:00
Taddes
0e3f7d162c
refactor: quiet dbg calls (#1701)
refactor: quiet dbg calls
2025-06-04 17:25:16 -04:00
Taddes
0768d4975d
chore: remove extraneous dependencies (#1700)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
chore: remove extraneous dependencies
2025-05-22 19:06:58 -04:00
Philip Jenvey
0148e04dd2
chore: bump to latest rust
for cargo nextest/backtrace
2025-05-07 16:49:09 -07:00
Philip Jenvey
624eced1e9
feat: emit oauth verification timeouts as metrics (not sentry) (#1694)
Some checks failed
Glean probe-scraper / glean-probe-scraper (push) Has been cancelled
and fix the sentry middleware to use ReportableError::tags

Closes STOR-201
2025-05-02 13:51:52 -07:00
Philip Jenvey
0ca435fb1a
refactor: simplify metric_label to return a &str
Issue STOR-64
2025-04-23 16:01:07 -07:00
Taddes
7c9bc0089d
docs: document pruning scripts (#1645)
* docs for tokenserver process_account_events

* add docs for spanner purge ttl

* add kubernetes workload references and status

* cargo update, update validator to 0.19, audit ignore due to diesel limitation
2025-01-07 13:23:09 -08:00
Taddes
c01021b87d
Feat: add task to release unused db conns (#1640)
Feat: add task to release unused db conns
2024-12-05 17:10:14 -05:00
Taddes
7f7cfb7897
move context of glean metrics into statsd get_collections metric (#1638)
Co-authored-by: JR Conlin <jconlin+git@mozilla.com>
2024-12-04 14:24:02 -08:00
Taddes
9e9869ee06
feat: glean metrics logic (#1626)
feat: glean metrics logic
2024-11-26 17:04:38 -06:00
Philip Jenvey
9b033edcb0
fix: don't add extra prefixes to middleware emitted metrics (#1630)
Closes SYNC-4478
2024-11-13 12:04:18 -08:00
Taddes
98ccc95482
feat: add metric values to get_collections (#1616)
feat: add metric values to get_collections
2024-11-06 10:33:42 -05:00
Taddes
cc6dd13749
feat: add hashed_device_id to HawkIdentifier (#1615)
feat: add hashed_device_id to HawkIdentifier and UserIdentifier
2024-10-25 10:24:57 -04:00
Taddes
715cf950ba
feat: add hashed_fxa_uid to HawkPayload (#1613)
add hashed_fxa_uid to HawkPayload, HawkIdentifier, UserIdentifier
2024-10-21 19:41:43 -04:00
Taddes
7f2ef062fc
feat: user agent parsing (#1607)
user agent parsing module for syncserver
2024-10-21 17:09:42 -04:00
Philip Jenvey
c535e5ae52
feat: wire MysqlError's ReportableError impl into TokenserverError (#1611)
* feat: wire MysqlError's ReportableError impl into TokenserverError

and quiet Pool errors

Closes SYNC-4424

* kluge: allow(clippy::result_large_err) for TokenserverError

(for now) we can get rid of this in a later refactoring
2024-10-17 14:23:45 -07:00
Philip Jenvey
1f0e28d7af
feat: track the pool's queued vs actually active tasks (#1605)
and consider idle threads as a "max" value as the underlying tokio threadpool
will exit threads idle for too long

Closes SYNC-4424
2024-09-30 16:13:51 -07:00
Philip Jenvey
5d9d203c62
refactor: move sentry middlware and Taggable to syncserver-common
Issue SYNC-4407
2024-09-18 13:26:45 -07:00
Philip Jenvey
2b8b1f5dde
fix: downcast to tokenserver's actual error type (#1596)
which its handlers (except hearbeat) return vs ApiError

otherwise we fail to take ReportableError::is_sentry_event into
account and flood sentry with all errors

also:
- revert:
"feat: debug "Invalid OAuth token" (verifier returns None) error cases (#1595)"

This reverts commit 1443b31e5af1f10f8a52bf1bb91dc817ce0b75f2.

- update quinn-proto per RUSTSEC-2024-0373

Issue SYNC-4262
2024-09-12 11:42:13 -07:00
Philip Jenvey
1edce04154
fix: don't hide TokenserverPool initialization errors on startup (#1584)
Closes SYNC-4346
2024-07-11 16:25:50 -07:00
JR Conlin
1713962c6a
Chore/update 2406 (#1576)
chore: Updates for Jun-2024

* f normalize diesel to 1.4

We're currenlty locked to diesel 1.4 due to some significant changes
in the `diesel_logger` crate and how it expects `Connections` to be
defined.
2024-06-25 13:29:42 -07:00
JR Conlin
dbbdd1dfc3
feat: Remove support for BrowserID (#1531)
* feat: Remove support for BrowserID
* mark test only functions as such. I think we can drop MapAndThenTrait for more recent implementations of rust.

Closes: SYNC-3684
2024-06-14 12:51:02 -07:00
JR Conlin
2584b977b8
feat: Add timeouts for tokenserver database calls. (#1561)
Closes: SYNC-4270
2024-05-31 13:53:51 -07:00
JR Conlin
5cdfd03498
docs: Remove commented code, unneeded TODO, unneeded collision tracking (#1563) 2024-05-20 12:52:36 -07:00
JR Conlin
771813087c
feat: Add normalized ReportableError to errors (#1559)
* feat: Add normalized ReportableError to errors

We want to do things like add tags and other features to sync errors the
way that we do in other packages. To do so, we're backporting
ReportableError from Autopush to Syncstorage.

This also addresses some clippy fixes required by 1.78

This continues to use the `Taggable` trait, which we may want to
port to autopush.

Closes SYNC-4262
2024-05-20 08:51:58 -07:00
JR Conlin
ab7b4221fd
bug: Allow threadpool size to be set. (#1560)
* bug: Allow threadpool size to be set.

It appears that the replacement for setting ACTIX_THREADPOOL would be to
call `ServiceBuilder.worker_max_blocking_threads()` This PR introduces
the ability to set this value by using the
`worker_max_blocking_threads`configuration variable.

Closes #SYNC-4271
2024-05-16 16:36:41 -07:00
JR Conlin
83079555fb
feat/SYNC-4244_stale (#1546)
* feat: log bad client state to stderr & metrics

Closes: SYNC-4244
2024-05-08 18:47:33 -07:00
Philip Jenvey
8faf7280de
fix: don't emit a content-type header for 304s (#1526)
or bodyless 412s

and kill the old periodic reporter (moved to
server::spawn_metric_periodic_reporter)

Closes SYNC-4162
2024-02-28 21:32:37 -08:00
Tarik Eshaq
ac3b479a58
chore: Cleans up TLS dependencies (#1519)
* Cleans up TLS dependencies

* Removes unused dependencies from syncserver
2024-02-12 20:33:23 -05:00
Tarik Eshaq
1b11684648
feat: Puts pyo3 behind feature flag and derives tokens directly in Rust (#1513)
* Removes pyo3 and derives tokens directly in Rust

* Adds tests for JWT verifying

* Adds tests for token generation

* Adds metrics for oauth verify error cases

* Updates jsonwebtoken to not include default features (including pem loading)

* Adds context and logs errors during oauth verify

* Uses ring for cryptographic rng

* Adds back python impl under feature flag

* Uses one cached http client for reqwest
2024-02-12 11:14:15 -05:00
Tarik Eshaq
f87293cc38
Upgrades rustc in CI and Docker to 1.75 2024-02-08 14:08:45 -05:00
Tarik Eshaq
8ff1b6385e
bump: hawk, resolving duplicate dependencies and fix advisory (#1516)
* bump hawk, resolving duplicate dependencies

* Updates shlex fixing advisory
2024-01-26 09:00:53 -08:00
bendk
97985586b4
feat: Upgrading to Actix 4.x (#1514)
* Upgrading to Actix 4.x

Also:
  - actix-http 3.x
  - actix-rt 2.x
  - actix-cors 0.6.x
  - tokio 1.x
  - reqwest 0.11.x
  - deadpool 0.7.x

* Update crates after Actix upgrade

Also cleared out the audit exception list.
2024-01-23 13:59:54 -08:00
JR Conlin
cc8d5847dc
Chore/update 2312 (#1510)
* chore: Update for 12-2023

Closes: #1503, #1502

switch to fetching mysql_pubkey.asc

Closes #1509 SYNC-4055
2024-01-12 15:44:44 -08:00
Philip Jenvey
8d9185e4a0
fix: disable sentry's debug-images feature (#1499)
which produced errors when sentry ingests events

https://github.com/getsentry/sentry-rust/issues/574

SYNC-4023
2023-11-20 16:57:42 -08:00
JR Conlin
1b9ebbf40f
Chore/contributor rollup (#1479)
* These needed to be rolled in due to various dependency changes.

 * Fix the URL people should set to use their Custom Server (https://github.com/mozilla-services/syncstorage-rs/pull/1453) -
[Ekleog](https://github.com/Ekleog)
 * Make docker files more podman friendly (https://github.com/mozilla-services/syncstorage-rs/pull/1431) -
[mb](https://github.com/mb)

* This PR also updates a number of dependencies
2023-10-18 14:24:41 -07:00
Philip Jenvey
dc98e95ff3
refactor: quiet latest clippy warnings 2023-09-25 12:24:16 -07:00
JR Conlin
1f9323b7b3
feat: convert dependencies to use workspaces
Update package description and some dependencies to use `workspace`
inheritance.

* Also updates circleci to produce dockerhub image.

Closes #1461
Issue #1362

* f touch to retry circleci

* f try to pre-emptively lock protobuf to the older 2.25.2 version

* f force Cargo.lock to use protobuf 2.25.2, dammit

* f move protobuf pin to syncstorage-spanner

* f revert cargo.lock

* f revert #448

* f update base64 / tickle circleci

* f update cadence (and kick circleci)

* f clippy

* f switch to latest google-cloud-rust

* f update to use google-cloud-rust
2023-08-29 13:57:53 -07:00