mirror of
https://github.com/mozilla-services/syncstorage-rs.git
synced 2026-05-05 12:16:21 +02:00
chore: update to Rust 1.64.0 (#1415)
This commit is contained in:
parent
d69508d3cc
commit
fca795e3c0
@ -160,7 +160,7 @@ commands:
|
||||
jobs:
|
||||
checks:
|
||||
docker:
|
||||
- image: cimg/rust:1.60.0
|
||||
- image: cimg/rust:1.64.0
|
||||
auth:
|
||||
username: $DOCKER_USER
|
||||
password: $DOCKER_PASS
|
||||
@ -176,7 +176,7 @@ jobs:
|
||||
|
||||
build-and-test:
|
||||
docker:
|
||||
- image: cimg/rust:1.60.0
|
||||
- image: cimg/rust:1.64.0
|
||||
auth:
|
||||
username: $DOCKER_USER
|
||||
password: $DOCKER_PASS
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM rust:1.60-buster as builder
|
||||
FROM rust:1.64-buster as builder
|
||||
WORKDIR /app
|
||||
ADD . /app
|
||||
ENV PATH=$PATH:/root/.cargo/bin
|
||||
|
||||
@ -264,7 +264,7 @@ impl<'a> Clone for Box<dyn Db<'a>> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone, PartialEq, Copy)]
|
||||
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Copy)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum Sorting {
|
||||
None,
|
||||
|
||||
@ -22,7 +22,7 @@ fn ms_since_epoch() -> i64 {
|
||||
/// Sync Timestamp
|
||||
///
|
||||
/// Internally represents a Sync timestamp as a u64 representing milliseconds since the epoch.
|
||||
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Deserialize, Serialize, FromSqlRow)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Deserialize, Serialize, FromSqlRow)]
|
||||
pub struct SyncTimestamp(
|
||||
#[serde(deserialize_with = "deserialize_ts", serialize_with = "serialize_ts")] u64,
|
||||
);
|
||||
|
||||
@ -410,7 +410,7 @@ async fn post_collection() {
|
||||
let bytes =
|
||||
test_endpoint_with_body(http::Method::POST, "/1.5/42/storage/bookmarks", res_body).await;
|
||||
let result: PostBsos =
|
||||
serde_json::from_slice(&bytes.to_vec()).expect("Could not get result in post_collection");
|
||||
serde_json::from_slice(&bytes).expect("Could not get result in post_collection");
|
||||
assert!(result.modified >= start);
|
||||
assert_eq!(result.success.len(), 1);
|
||||
assert_eq!(result.failed.len(), 0);
|
||||
@ -461,7 +461,7 @@ async fn bsos_can_have_a_collection_field() {
|
||||
{"id": "2", "collection": "foo", "payload": "SomePayload"},
|
||||
]);
|
||||
let bytes = test_endpoint_with_body(http::Method::POST, "/1.5/42/storage/meta", bsos).await;
|
||||
let result: PostBsos = serde_json::from_slice(&bytes.to_vec())
|
||||
let result: PostBsos = serde_json::from_slice(&bytes)
|
||||
.expect("Could not get result in bsos_can_have_a_collection_field");
|
||||
assert_eq!(result.success.len(), 2);
|
||||
assert_eq!(result.failed.len(), 0);
|
||||
|
||||
@ -9,7 +9,7 @@ use crate::tokenserver::settings::Settings;
|
||||
use std::{convert::TryFrom, time::Duration};
|
||||
|
||||
/// The information extracted from a valid BrowserID assertion.
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq)]
|
||||
pub struct VerifyOutput {
|
||||
pub device_id: Option<String>,
|
||||
pub email: String,
|
||||
|
||||
@ -16,7 +16,7 @@ use core::time::Duration;
|
||||
use std::convert::TryFrom;
|
||||
|
||||
/// The information extracted from a valid OAuth token.
|
||||
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
|
||||
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
|
||||
pub struct VerifyOutput {
|
||||
#[serde(rename = "user")]
|
||||
pub fxa_uid: String,
|
||||
|
||||
@ -25,7 +25,7 @@ pub struct GetRawUser {
|
||||
|
||||
pub type GetUsers = Vec<GetRawUser>;
|
||||
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub struct AllocateUser {
|
||||
pub uid: i64,
|
||||
pub node: String,
|
||||
@ -35,7 +35,7 @@ pub struct AllocateUser {
|
||||
/// Represents the relevant information from the most recently-created user record in the database
|
||||
/// for a given email and service ID, along with any previously-seen client states seen for the
|
||||
/// user.
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub struct GetOrCreateUser {
|
||||
pub uid: i64,
|
||||
pub email: String,
|
||||
@ -83,7 +83,7 @@ pub struct GetServiceId {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[derive(Debug, Default, PartialEq, QueryableByName)]
|
||||
#[derive(Debug, Default, Eq, PartialEq, QueryableByName)]
|
||||
pub struct GetUser {
|
||||
#[sql_type = "Integer"]
|
||||
#[column_name = "service"]
|
||||
|
||||
@ -34,7 +34,7 @@ lazy_static! {
|
||||
const SYNC_SERVICE_NAME: &str = "sync-1.5";
|
||||
|
||||
/// Information from the request needed to process a Tokenserver request.
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub struct TokenserverRequest {
|
||||
pub user: results::GetOrCreateUser,
|
||||
pub auth_data: AuthData,
|
||||
@ -414,7 +414,7 @@ impl FromRequest for Token {
|
||||
}
|
||||
|
||||
/// The data extracted from the authentication token.
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
#[derive(Debug, Default, Eq, PartialEq)]
|
||||
pub struct AuthData {
|
||||
pub client_state: String,
|
||||
pub device_id: Option<String>,
|
||||
|
||||
@ -83,7 +83,7 @@ impl ServerState {
|
||||
|
||||
pub struct TokenserverMetrics(Metrics);
|
||||
|
||||
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
|
||||
pub enum NodeType {
|
||||
#[serde(rename = "mysql")]
|
||||
MySql,
|
||||
|
||||
@ -1179,7 +1179,7 @@ impl FromRequest for HawkIdentifier {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy, Deserialize, Validate, PartialEq)]
|
||||
#[derive(Debug, Default, Clone, Copy, Deserialize, Eq, PartialEq, Validate)]
|
||||
#[serde(default)]
|
||||
pub struct Offset {
|
||||
pub timestamp: Option<SyncTimestamp>,
|
||||
@ -1481,14 +1481,14 @@ impl FromRequest for BatchRequestOpt {
|
||||
/// both.
|
||||
///
|
||||
/// Used with Option<PreConditionHeader> to extract a possible PreConditionHeader.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub enum PreConditionHeader {
|
||||
IfModifiedSince(SyncTimestamp),
|
||||
IfUnmodifiedSince(SyncTimestamp),
|
||||
NoHeader,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct PreConditionHeaderOpt {
|
||||
pub opt: Option<PreConditionHeader>,
|
||||
}
|
||||
@ -1576,7 +1576,7 @@ impl FromRequest for PreConditionHeaderOpt {
|
||||
}
|
||||
|
||||
/// Validation Error Location in the request
|
||||
#[derive(Debug, Deserialize, Serialize, PartialEq)]
|
||||
#[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum RequestErrorLocation {
|
||||
Body,
|
||||
@ -1628,7 +1628,7 @@ fn validate_qs_commit(commit: &str) -> Result<(), ValidationError> {
|
||||
|
||||
/// Verifies the BSO sortindex is in the valid range
|
||||
fn validate_body_bso_sortindex(sort: i32) -> Result<(), ValidationError> {
|
||||
if BSO_MIN_SORTINDEX_VALUE <= sort && sort <= BSO_MAX_SORTINDEX_VALUE {
|
||||
if (BSO_MIN_SORTINDEX_VALUE..=BSO_MAX_SORTINDEX_VALUE).contains(&sort) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(request_error("invalid value", RequestErrorLocation::Body))
|
||||
|
||||
@ -156,7 +156,7 @@ impl TokenserverError {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum ErrorLocation {
|
||||
Header,
|
||||
Url,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user