mirror of
https://github.com/mozilla-services/syncstorage-rs.git
synced 2025-08-07 04:16:56 +02:00
Merge pull request #1696 from mozilla-services/fix/tokenserver-e2e-pyfxa-STOR-204
Some checks are pending
Glean probe-scraper / glean-probe-scraper (push) Waiting to run
Some checks are pending
Glean probe-scraper / glean-probe-scraper (push) Waiting to run
fix: re-enable tokensever e2e tests
This commit is contained in:
commit
4ba7b32dc8
@ -225,7 +225,7 @@ commands:
|
|||||||
jobs:
|
jobs:
|
||||||
checks:
|
checks:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.81.0 # RUST_VER
|
- image: cimg/rust:1.86 # RUST_VER
|
||||||
auth:
|
auth:
|
||||||
username: $DOCKER_USER
|
username: $DOCKER_USER
|
||||||
password: $DOCKER_PASS
|
password: $DOCKER_PASS
|
||||||
@ -242,7 +242,7 @@ jobs:
|
|||||||
|
|
||||||
build-and-test:
|
build-and-test:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.81.0 # RUST_VER
|
- image: cimg/rust:1.86 # RUST_VER
|
||||||
auth:
|
auth:
|
||||||
username: $DOCKER_USER
|
username: $DOCKER_USER
|
||||||
password: $DOCKER_PASS
|
password: $DOCKER_PASS
|
||||||
@ -296,7 +296,7 @@ jobs:
|
|||||||
#- save-sccache-cache
|
#- save-sccache-cache
|
||||||
build-mysql-image:
|
build-mysql-image:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.81.0 # RUST_VER
|
- image: cimg/rust:1.86 # RUST_VER
|
||||||
auth:
|
auth:
|
||||||
username: $DOCKER_USER
|
username: $DOCKER_USER
|
||||||
password: $DOCKER_PASS
|
password: $DOCKER_PASS
|
||||||
@ -331,7 +331,7 @@ jobs:
|
|||||||
|
|
||||||
build-spanner-image:
|
build-spanner-image:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/rust:1.81.0 # RUST_VER
|
- image: cimg/rust:1.86 # RUST_VER
|
||||||
auth:
|
auth:
|
||||||
username: $DOCKER_USER
|
username: $DOCKER_USER
|
||||||
password: $DOCKER_PASS
|
password: $DOCKER_PASS
|
||||||
|
@ -25,6 +25,7 @@ authors = [
|
|||||||
"Mozilla Services Engineering <services-engineering+code@mozilla.com>",
|
"Mozilla Services Engineering <services-engineering+code@mozilla.com>",
|
||||||
]
|
]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
rust-version = "1.86"
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
@ -3,7 +3,8 @@ ARG DATABASE_BACKEND=spanner
|
|||||||
ARG MYSQLCLIENT_PKG=libmariadb-dev-compat
|
ARG MYSQLCLIENT_PKG=libmariadb-dev-compat
|
||||||
|
|
||||||
# NOTE: Ensure builder's Rust version matches CI's in .circleci/config.yml
|
# NOTE: Ensure builder's Rust version matches CI's in .circleci/config.yml
|
||||||
FROM docker.io/lukemathwalker/cargo-chef:0.1.67-rust-1.81-bullseye AS chef
|
# RUST_VER
|
||||||
|
FROM docker.io/lukemathwalker/cargo-chef:0.1.71-rust-1.86-bullseye AS chef
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
FROM chef AS planner
|
FROM chef AS planner
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
cryptography==44.0.2
|
cryptography==44.0.2
|
||||||
pyfxa==0.7.7
|
pyfxa==0.8.1
|
||||||
tokenlib==2.0.0
|
tokenlib==2.0.0
|
||||||
|
@ -69,7 +69,6 @@ pub trait ReportableError: std::fmt::Display + std::fmt::Debug {
|
|||||||
/// [ReportableError] if it implements the trait. Otherwise callers of this
|
/// [ReportableError] if it implements the trait. Otherwise callers of this
|
||||||
/// method will likely subsequently call [Error::source] to return the
|
/// method will likely subsequently call [Error::source] to return the
|
||||||
/// source (if any) as the parent [Error] trait.
|
/// source (if any) as the parent [Error] trait.
|
||||||
|
|
||||||
fn reportable_source(&self) -> Option<&(dyn ReportableError + 'static)> {
|
fn reportable_source(&self) -> Option<&(dyn ReportableError + 'static)> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ impl fmt::Display for LogItems {
|
|||||||
|
|
||||||
struct LogItemsMutator<'a>(&'a HttpRequest);
|
struct LogItemsMutator<'a>(&'a HttpRequest);
|
||||||
|
|
||||||
impl<'a> LogItemsMutator<'a> {
|
impl LogItemsMutator<'_> {
|
||||||
pub fn insert(&mut self, k: String, v: String) {
|
pub fn insert(&mut self, k: String, v: String) {
|
||||||
let mut exts = self.0.extensions_mut();
|
let mut exts = self.0.extensions_mut();
|
||||||
|
|
||||||
|
@ -1557,7 +1557,7 @@ impl FromRequest for PreConditionHeaderOpt {
|
|||||||
/// Extract and validate the precondition headers
|
/// Extract and validate the precondition headers
|
||||||
fn from_request(req: &HttpRequest, _payload: &mut Payload) -> Self::Future {
|
fn from_request(req: &HttpRequest, _payload: &mut Payload) -> Self::Future {
|
||||||
let req = req.clone();
|
let req = req.clone();
|
||||||
Box::pin(async move { Self::extrude(req.headers()).map_err(Into::into) })
|
Box::pin(async move { Self::extrude(req.headers()) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,6 @@ pub async fn delete_collection(
|
|||||||
Ok(resp.json(timestamp))
|
Ok(resp.json(timestamp))
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.map_err(Into::into)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_collection(
|
pub async fn get_collection(
|
||||||
|
@ -37,7 +37,7 @@ pub fn reject_user_agent<B>(
|
|||||||
+ 'static),
|
+ 'static),
|
||||||
) -> LocalBoxFuture<'static, Result<ServiceResponse<EitherBody<B>>, actix_web::Error>> {
|
) -> LocalBoxFuture<'static, Result<ServiceResponse<EitherBody<B>>, actix_web::Error>> {
|
||||||
match request.headers().get(USER_AGENT).cloned() {
|
match request.headers().get(USER_AGENT).cloned() {
|
||||||
Some(header) if header.to_str().map_or(false, should_reject) => Box::pin(async move {
|
Some(header) if header.to_str().is_ok_and(should_reject) => Box::pin(async move {
|
||||||
trace!("Rejecting User-Agent: {:?}", header);
|
trace!("Rejecting User-Agent: {:?}", header);
|
||||||
let (req, payload) = request.into_parts();
|
let (req, payload) = request.into_parts();
|
||||||
MetricsWrapper::extract(&req)
|
MetricsWrapper::extract(&req)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(non_local_definitions)]
|
||||||
pub mod error;
|
pub mod error;
|
||||||
pub mod params;
|
pub mod params;
|
||||||
pub mod results;
|
pub mod results;
|
||||||
@ -229,7 +230,7 @@ pub trait Db: Debug {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Internal methods used by the db tests
|
// Internal methods used by the db tests
|
||||||
|
|
||||||
fn get_collection_id(&self, name: String) -> DbFuture<'_, i32, Self::Error>;
|
fn get_collection_id(&self, name: String) -> DbFuture<'_, i32, Self::Error>;
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(non_local_definitions)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate diesel;
|
extern crate diesel;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -776,7 +776,6 @@ impl SpannerDb {
|
|||||||
} else {
|
} else {
|
||||||
sync_timestamp_from_rfc3339(row[0].get_string_value())
|
sync_timestamp_from_rfc3339(row[0].get_string_value())
|
||||||
}
|
}
|
||||||
.map_err(Into::into)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_storage_usage_async(
|
async fn get_storage_usage_async(
|
||||||
@ -1502,7 +1501,6 @@ impl SpannerDb {
|
|||||||
} else {
|
} else {
|
||||||
SyncTimestamp::from_i64(0).map_err(|e| DbError::integrity(e.to_string()))
|
SyncTimestamp::from_i64(0).map_err(|e| DbError::integrity(e.to_string()))
|
||||||
}
|
}
|
||||||
.map_err(Into::into)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn put_bso_async(&self, params: params::PutBso) -> DbResult<results::PutBso> {
|
async fn put_bso_async(&self, params: params::PutBso) -> DbResult<results::PutBso> {
|
||||||
|
@ -124,11 +124,10 @@ impl DbPool for SpannerDbPool {
|
|||||||
self.get_async()
|
self.get_async()
|
||||||
.await
|
.await
|
||||||
.map(|db| Box::new(db) as Box<dyn Db<Error = Self::Error>>)
|
.map(|db| Box::new(db) as Box<dyn Db<Error = Self::Error>>)
|
||||||
.map_err(Into::into)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn validate_batch_id(&self, id: String) -> DbResult<()> {
|
fn validate_batch_id(&self, id: String) -> DbResult<()> {
|
||||||
super::batch::validate_batch_id(&id).map_err(Into::into)
|
super::batch::validate_batch_id(&id)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn box_clone(&self) -> Box<dyn DbPool<Error = Self::Error>> {
|
fn box_clone(&self) -> Box<dyn DbPool<Error = Self::Error>> {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![allow(non_local_definitions)]
|
||||||
extern crate diesel;
|
extern crate diesel;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate diesel_migrations;
|
extern crate diesel_migrations;
|
||||||
|
@ -6,11 +6,11 @@ psutil
|
|||||||
pyjwt
|
pyjwt
|
||||||
pyramid
|
pyramid
|
||||||
pyramid_hawkauth
|
pyramid_hawkauth
|
||||||
pyfxa
|
pyfxa==0.8.1
|
||||||
pytest
|
pytest
|
||||||
requests
|
requests
|
||||||
simplejson
|
simplejson
|
||||||
sqlalchemy
|
sqlalchemy==1.4.46
|
||||||
tokenlib
|
tokenlib
|
||||||
webtest
|
webtest
|
||||||
wsgiproxy2
|
wsgiproxy2
|
||||||
|
@ -33,8 +33,6 @@ PASSWORD_LENGTH = 32
|
|||||||
SCOPE = 'https://identity.mozilla.com/apps/oldsync'
|
SCOPE = 'https://identity.mozilla.com/apps/oldsync'
|
||||||
|
|
||||||
|
|
||||||
@unittest.skip("Pending PyFxA oauth fix: "
|
|
||||||
"https://github.com/mozilla/PyFxA/issues/101")
|
|
||||||
class TestE2e(TestCase, unittest.TestCase):
|
class TestE2e(TestCase, unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user