- make SyncTimestamp::from_datetime generic over timezones
- compare expiry to CURRENT_TIMESTAMP now that they're TIMESTAMPTZ
- fix get_collection_timestamps not ignoring tombstones
- fix the gcs upload breaking due to failing tests
Closes STOR-420
* feat: add the remaining postgres get methods
- add a FromSql<Timestamp, _> for SyncTimestamp
- utilize Selectable for GetBso
- simplify bsos_query to rely on type inference of the result
Closes STOR-337
We need to create the Postgres specific Db struct and associated methods. The majority of API methods will be implemented upon this struct, so this is to initialize the main logic so that the traits can be implemented.
This also encompasses additions to the Postgres-specific database pool implementation.
Several of the trait bounds (methods) have to be satisfied, but this stubs them out so that the PgDb has a common interface that is the same as those for MySQL and Spanner.
Doc comments added in shared error.rs crate for clarity, since it is a shared interface for all databases.
Removed dead code annotations for clippy that are no longer needed in Tokenserver.
Closes STOR-399
See https://diesel.rs/guides/migration_guide.html.
- This pulls in mysqlclient-sys >=0.4.0, which allows using libmariadb instead of libmysqlclient.
That allows using Debian's bundled client library.
MySQL's APT repository only has packages for AMD64.
- Connections are now passed as mut refs, which requires RefCell/RwLock.
- Embedded migrations had a slight API change.
- put_bso_sync was calling update_collection without its transaction, which now causes a deadlock.
Updated to write inside its transaction.
Signed-off-by: Tommie Gannert <tommie@gannert.se>
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.
* 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
* 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
* 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
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
This is a breaking change. This commit separates syncstorage and tokenserver settings into separate structs that are contained by a parent `Settings` struct. This means that any env vars that hold settings specific to syncstorage (e.g. `SYNC_DATABASE_URL`) have been renamed to `SYNC_SYNCSTORAGE__DATABASE_URL`. Any settings that were moved from the top-level `Settings` struct to the lower level, syncstorage-specific struct will now have a `SYNC_SYNCSTORAGE__` prefix instead of a `SYNC_` prefix.
Closes#1276