Update deps

This commit is contained in:
asonix 2020-09-07 16:51:02 -05:00
parent e80ded92f5
commit 1f065385a0
26 changed files with 52 additions and 71 deletions

34
Cargo.lock generated
View file

@ -1,19 +1,10 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
[[package]] [[package]]
name = "activitystreams-ext" name = "activitystreams"
version = "0.1.0" version = "0.7.0-alpha.4"
source = "git+https://git.asonix.dog/asonix/activitystreams-ext?branch=main#9acc466c7cb550ada31b669a1c47ea088f1c8471" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ checksum = "261b423734cca2a170d7a76936f1f0f9e6c6fc297d36cfc5ea6aa15f9017f996"
"activitystreams-new",
"serde 1.0.115",
"serde_json",
]
[[package]]
name = "activitystreams-new"
version = "0.1.0"
source = "git+https://git.asonix.dog/asonix/activitystreams-sketch?branch=main#857d5167dfa13054dd0d21d3d54f8147eea0d546"
dependencies = [ dependencies = [
"chrono", "chrono",
"mime", "mime",
@ -23,6 +14,17 @@ dependencies = [
"url", "url",
] ]
[[package]]
name = "activitystreams-ext"
version = "0.1.0-alpha.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb8e19a0810cc25df3535061a08b7d8f8a734d309ea4411c57a9767e4a2ffa0e"
dependencies = [
"activitystreams",
"serde 1.0.115",
"serde_json",
]
[[package]] [[package]]
name = "actix-codec" name = "actix-codec"
version = "0.2.0" version = "0.2.0"
@ -1172,9 +1174,9 @@ dependencies = [
[[package]] [[package]]
name = "http-signature-normalization-actix" name = "http-signature-normalization-actix"
version = "0.4.0-alpha.2" version = "0.4.0-alpha.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "131fc982391a6b37847888b568cbe0e9cd302f1b0015f4f6f4a50234bebd049c" checksum = "b44149de8286e9a07aeb72f4dee198530c0fb95df77f36b11138a748788f5603"
dependencies = [ dependencies = [
"actix-http", "actix-http",
"actix-web", "actix-web",
@ -1948,8 +1950,8 @@ checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
name = "relay" name = "relay"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"activitystreams",
"activitystreams-ext", "activitystreams-ext",
"activitystreams-new",
"actix-rt", "actix-rt",
"actix-web", "actix-web",
"actix-webfinger", "actix-webfinger",

View file

@ -17,8 +17,8 @@ anyhow = "1.0"
actix-rt = "1.1.1" actix-rt = "1.1.1"
actix-web = { version = "3.0.0-beta.1", features = ["rustls"] } actix-web = { version = "3.0.0-beta.1", features = ["rustls"] }
actix-webfinger = "0.3.0-alpha.6" actix-webfinger = "0.3.0-alpha.6"
activitystreams-new = { git = "https://git.asonix.dog/asonix/activitystreams-sketch", branch = "main" } activitystreams = "0.7.0-alpha.4"
activitystreams-ext = { git = "https://git.asonix.dog/asonix/activitystreams-ext", branch = "main" } activitystreams-ext = "0.1.0-alpha.2"
ammonia = "3.1.0" ammonia = "3.1.0"
async-mutex = "1.0.1" async-mutex = "1.0.1"
async-trait = "0.1.24" async-trait = "0.1.24"
@ -31,7 +31,7 @@ deadpool-postgres = "0.5.5"
dotenv = "0.15.0" dotenv = "0.15.0"
env_logger = "0.7.1" env_logger = "0.7.1"
futures = "0.3.4" futures = "0.3.4"
http-signature-normalization-actix = { version = "0.4.0-alpha.1", default-features = false, features = ["sha-2"] } http-signature-normalization-actix = { version = "0.4.0-alpha.3", default-features = false, features = ["sha-2"] }
log = "0.4" log = "0.4"
lru = "0.6.0" lru = "0.6.0"
mime = "0.3.16" mime = "0.3.16"

View file

@ -1,5 +1,5 @@
use activitystreams_ext::{Ext1, UnparsedExtension}; use activitystreams_ext::{Ext1, UnparsedExtension};
use activitystreams_new::{ use activitystreams::{
activity::ActorAndObject, activity::ActorAndObject,
actor::{Actor, ApActor}, actor::{Actor, ApActor},
unparsed::UnparsedMutExt, unparsed::UnparsedMutExt,

View file

@ -1,5 +1,5 @@
use crate::{data::ActorCache, error::MyError, middleware::MyVerify, requests::Requests}; use crate::{data::ActorCache, error::MyError, middleware::MyVerify, requests::Requests};
use activitystreams_new::{uri, url::Url}; use activitystreams::{uri, url::Url};
use config::Environment; use config::Environment;
use http_signature_normalization_actix::prelude::{VerifyDigest, VerifySignature}; use http_signature_normalization_actix::prelude::{VerifyDigest, VerifySignature};
use sha2::{Digest, Sha256}; use sha2::{Digest, Sha256};

View file

@ -1,5 +1,5 @@
use crate::{apub::AcceptedActors, db::Db, error::MyError, requests::Requests}; use crate::{apub::AcceptedActors, db::Db, error::MyError, requests::Requests};
use activitystreams_new::{prelude::*, uri, url::Url}; use activitystreams::{prelude::*, uri, url::Url};
use log::error; use log::error;
use std::{collections::HashSet, sync::Arc, time::Duration}; use std::{collections::HashSet, sync::Arc, time::Duration};
use tokio::sync::RwLock; use tokio::sync::RwLock;

View file

@ -1,5 +1,5 @@
use crate::{db::Db, error::MyError}; use crate::{db::Db, error::MyError};
use activitystreams_new::url::Url; use activitystreams::url::Url;
use async_mutex::Mutex; use async_mutex::Mutex;
use bytes::Bytes; use bytes::Bytes;
use futures::join; use futures::join;

View file

@ -1,5 +1,5 @@
use crate::{db::Db, error::MyError}; use crate::{db::Db, error::MyError};
use activitystreams_new::{uri, url::Url}; use activitystreams::{uri, url::Url};
use log::{debug, error}; use log::{debug, error};
use std::{ use std::{
collections::{HashMap, HashSet}, collections::{HashMap, HashSet},

View file

@ -5,7 +5,7 @@ use crate::{
error::MyError, error::MyError,
requests::Requests, requests::Requests,
}; };
use activitystreams_new::url::Url; use activitystreams::url::Url;
use actix_rt::{ use actix_rt::{
spawn, spawn,
time::{interval_at, Instant}, time::{interval_at, Instant},

View file

@ -1,5 +1,5 @@
use crate::error::MyError; use crate::error::MyError;
use activitystreams_new::url::Url; use activitystreams::url::Url;
use deadpool_postgres::{Manager, Pool}; use deadpool_postgres::{Manager, Pool};
use log::{info, warn}; use log::{info, warn};
use rsa::RSAPrivateKey; use rsa::RSAPrivateKey;

View file

@ -1,4 +1,4 @@
use activitystreams_new::{error::DomainError, url::ParseError}; use activitystreams::{error::DomainError, url::ParseError};
use actix_web::{ use actix_web::{
error::{BlockingError, ResponseError}, error::{BlockingError, ResponseError},
http::StatusCode, http::StatusCode,

View file

@ -7,7 +7,7 @@ use crate::{
DeliverMany, JobState, DeliverMany, JobState,
}, },
}; };
use activitystreams_new::{activity::Announce as AsAnnounce, url::Url}; use activitystreams::{activity::Announce as AsAnnounce, url::Url};
use background_jobs::ActixJob; use background_jobs::ActixJob;
use std::{future::Future, pin::Pin}; use std::{future::Future, pin::Pin};

View file

@ -5,7 +5,7 @@ use crate::{
error::MyError, error::MyError,
jobs::{apub::prepare_activity, Deliver, JobState}, jobs::{apub::prepare_activity, Deliver, JobState},
}; };
use activitystreams_new::{ use activitystreams::{
activity::{Accept as AsAccept, Follow as AsFollow}, activity::{Accept as AsAccept, Follow as AsFollow},
prelude::*, prelude::*,
url::Url, url::Url,

View file

@ -4,7 +4,7 @@ use crate::{
error::MyError, error::MyError,
jobs::{apub::get_inboxes, DeliverMany, JobState}, jobs::{apub::get_inboxes, DeliverMany, JobState},
}; };
use activitystreams_new::prelude::*; use activitystreams::prelude::*;
use background_jobs::ActixJob; use background_jobs::ActixJob;
use std::{future::Future, pin::Pin}; use std::{future::Future, pin::Pin};

View file

@ -3,7 +3,7 @@ use crate::{
data::{Actor, State}, data::{Actor, State},
error::MyError, error::MyError,
}; };
use activitystreams_new::{ use activitystreams::{
activity::{Follow as AsFollow, Undo as AsUndo}, activity::{Follow as AsFollow, Undo as AsUndo},
context, context,
prelude::*, prelude::*,

View file

@ -1,5 +1,5 @@
use crate::{error::MyError, jobs::JobState}; use crate::{error::MyError, jobs::JobState};
use activitystreams_new::url::Url; use activitystreams::url::Url;
use anyhow::Error; use anyhow::Error;
use background_jobs::{ActixJob, Backoff}; use background_jobs::{ActixJob, Backoff};
use std::{future::Future, pin::Pin}; use std::{future::Future, pin::Pin};

View file

@ -2,7 +2,7 @@ use crate::{
error::MyError, error::MyError,
jobs::{Deliver, JobState}, jobs::{Deliver, JobState},
}; };
use activitystreams_new::url::Url; use activitystreams::url::Url;
use anyhow::Error; use anyhow::Error;
use background_jobs::ActixJob; use background_jobs::ActixJob;
use futures::future::{ready, Ready}; use futures::future::{ready, Ready};

View file

@ -2,7 +2,7 @@ use crate::{
config::UrlKind, config::UrlKind,
jobs::{cache_media::CacheMedia, JobState}, jobs::{cache_media::CacheMedia, JobState},
}; };
use activitystreams_new::url::Url; use activitystreams::url::Url;
use anyhow::Error; use anyhow::Error;
use background_jobs::ActixJob; use background_jobs::ActixJob;
use futures::join; use futures::join;

View file

@ -1,5 +1,5 @@
use crate::jobs::JobState; use crate::jobs::JobState;
use activitystreams_new::url::Url; use activitystreams::url::Url;
use anyhow::Error; use anyhow::Error;
use background_jobs::ActixJob; use background_jobs::ActixJob;
use std::{future::Future, pin::Pin}; use std::{future::Future, pin::Pin};

View file

@ -1,5 +1,5 @@
use crate::{data::ActorCache, error::MyError, requests::Requests}; use crate::{data::ActorCache, error::MyError, requests::Requests};
use activitystreams_new::uri; use activitystreams::uri;
use actix_web::web; use actix_web::web;
use http_signature_normalization_actix::{prelude::*, verify::DeprecatedAlgorithm}; use http_signature_normalization_actix::{prelude::*, verify::DeprecatedAlgorithm};
use log::error; use log::error;

View file

@ -3,7 +3,7 @@ use crate::{
db::listen, db::listen,
jobs::{JobServer, QueryInstance, QueryNodeinfo}, jobs::{JobServer, QueryInstance, QueryNodeinfo},
}; };
use activitystreams_new::url::Url; use activitystreams::url::Url;
use actix_rt::{spawn, time::delay_for}; use actix_rt::{spawn, time::delay_for};
use futures::stream::{poll_fn, StreamExt}; use futures::stream::{poll_fn, StreamExt};
use log::{debug, error, warn}; use log::{debug, error, warn};

View file

@ -1,5 +1,5 @@
use crate::error::MyError; use crate::error::MyError;
use activitystreams_new::url::Url; use activitystreams::url::Url;
use actix_web::{client::Client, http::header::Date}; use actix_web::{client::Client, http::header::Date};
use bytes::Bytes; use bytes::Bytes;
use http_signature_normalization_actix::prelude::*; use http_signature_normalization_actix::prelude::*;
@ -37,7 +37,7 @@ impl Requests {
key_id, key_id,
user_agent, user_agent,
private_key, private_key,
config: Config::default().dont_use_created_field(), config: Config::default().dont_use_created_field().set_host_header(),
} }
} }
@ -77,15 +77,8 @@ impl Requests {
let signer = self.signer(); let signer = self.signer();
let client: Client = self.client.borrow().clone(); let client: Client = self.client.borrow().clone();
let req = client.get(url); let res = client
let host = req .get(url)
.get_uri()
.host()
.ok_or(MyError::Host(url.to_string()))?
.to_string();
debug!("Host: {}", host);
let res = req
.header("Host", host)
.header("Accept", accept) .header("Accept", accept)
.set(Date(SystemTime::now().into())) .set(Date(SystemTime::now().into()))
.signature( .signature(
@ -130,15 +123,8 @@ impl Requests {
let signer = self.signer(); let signer = self.signer();
let client: Client = self.client.borrow().clone(); let client: Client = self.client.borrow().clone();
let req = client.get(url); let res = client
let host = req .get(url)
.get_uri()
.host()
.ok_or(MyError::Host(url.to_string()))?
.to_string();
debug!("Host: {}", host);
let res = req
.header("Host", host)
.header("Accept", "*/*") .header("Accept", "*/*")
.set(Date(SystemTime::now().into())) .set(Date(SystemTime::now().into()))
.signature( .signature(
@ -198,15 +184,8 @@ impl Requests {
let item_string = serde_json::to_string(item)?; let item_string = serde_json::to_string(item)?;
let client: Client = self.client.borrow().clone(); let client: Client = self.client.borrow().clone();
let req = client.post(inbox.as_str()); let res = client
let host = req .post(inbox.as_str())
.get_uri()
.host()
.ok_or(MyError::Host(inbox.to_string()))?
.to_string();
debug!("Host: {}", host);
let res = req
.header("Host", host)
.header("Accept", "application/activity+json") .header("Accept", "application/activity+json")
.header("Content-Type", "application/activity+json") .header("Content-Type", "application/activity+json")
.set(Date(SystemTime::now().into())) .set(Date(SystemTime::now().into()))

View file

@ -6,7 +6,7 @@ use crate::{
routes::ok, routes::ok,
}; };
use activitystreams_ext::Ext1; use activitystreams_ext::Ext1;
use activitystreams_new::{ use activitystreams::{
actor::{ApActor, Application, Endpoints}, actor::{ApActor, Application, Endpoints},
context, context,
prelude::*, prelude::*,

View file

@ -8,7 +8,7 @@ use crate::{
requests::Requests, requests::Requests,
routes::accepted, routes::accepted,
}; };
use activitystreams_new::{ use activitystreams::{
activity, base::AnyBase, prelude::*, primitives::OneOrMany, public, url::Url, activity, base::AnyBase, prelude::*, primitives::OneOrMany, public, url::Url,
}; };
use actix_web::{web, HttpResponse}; use actix_web::{web, HttpResponse};

View file

@ -1,5 +1,5 @@
@use crate::data::Contact; @use crate::data::Contact;
@use activitystreams_new::url::Url; @use activitystreams::url::Url;
@(contact: &Contact, base: &Url) @(contact: &Contact, base: &Url)

View file

@ -1,5 +1,5 @@
@use crate::data::Info; @use crate::data::Info;
@use activitystreams_new::url::Url; @use activitystreams::url::Url;
@(info: &Info, base: &Url) @(info: &Info, base: &Url)

View file

@ -1,5 +1,5 @@
@use crate::{data::{Contact, Instance}, templates::admin}; @use crate::{data::{Contact, Instance}, templates::admin};
@use activitystreams_new::url::Url; @use activitystreams::url::Url;
@(instance: &Instance, software: Option<&str>, contact: Option<&Contact>, base: &Url) @(instance: &Instance, software: Option<&str>, contact: Option<&Contact>, base: &Url)