mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-21 22:27:08 +00:00
Upgrading deps. (#4196)
* Upgrading deps. * Try to use native node-fetch function. * Fixing image upload tests.
This commit is contained in:
parent
d795c54a7a
commit
2b5a31b411
494
Cargo.lock
generated
494
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
28
Cargo.toml
28
Cargo.toml
|
@ -97,10 +97,10 @@ lemmy_db_views_moderator = { version = "=0.19.0-rc.7", path = "./crates/db_views
|
|||
activitypub_federation = { version = "0.5.0-beta.5", default-features = false, features = [
|
||||
"actix-web",
|
||||
] }
|
||||
diesel = "2.1.3"
|
||||
diesel = "2.1.4"
|
||||
diesel_migrations = "2.1.0"
|
||||
diesel-async = "0.3.2"
|
||||
serde = { version = "1.0.189", features = ["derive"] }
|
||||
serde = { version = "1.0.193", features = ["derive"] }
|
||||
serde_with = "3.4.0"
|
||||
actix-web = { version = "4.4.0", default-features = false, features = [
|
||||
"macros",
|
||||
|
@ -111,11 +111,11 @@ actix-web = { version = "4.4.0", default-features = false, features = [
|
|||
"cookies",
|
||||
] }
|
||||
tracing = "0.1.40"
|
||||
tracing-actix-web = { version = "0.7.8", default-features = false }
|
||||
tracing-actix-web = { version = "0.7.9", default-features = false }
|
||||
tracing-error = "0.2.0"
|
||||
tracing-log = "0.1.4"
|
||||
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
|
||||
url = { version = "2.4.1", features = ["serde"] }
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
||||
url = { version = "2.5.0", features = ["serde"] }
|
||||
reqwest = { version = "0.11.22", features = ["json", "blocking", "gzip"] }
|
||||
reqwest-middleware = "0.2.4"
|
||||
reqwest-tracing = "0.4.6"
|
||||
|
@ -123,9 +123,9 @@ clokwerk = "0.4.0"
|
|||
doku = { version = "0.21.1", features = ["url-2"] }
|
||||
bcrypt = "0.15.0"
|
||||
chrono = { version = "0.4.31", features = ["serde"], default-features = false }
|
||||
serde_json = { version = "1.0.107", features = ["preserve_order"] }
|
||||
serde_json = { version = "1.0.108", features = ["preserve_order"] }
|
||||
base64 = "0.21.5"
|
||||
uuid = { version = "1.5.0", features = ["serde", "v4"] }
|
||||
uuid = { version = "1.6.1", features = ["serde", "v4"] }
|
||||
async-trait = "0.1.74"
|
||||
captcha = "0.0.9"
|
||||
anyhow = { version = "1.0.75", features = [
|
||||
|
@ -134,7 +134,7 @@ anyhow = { version = "1.0.75", features = [
|
|||
diesel_ltree = "0.3.0"
|
||||
typed-builder = "0.15.2"
|
||||
serial_test = "2.0.0"
|
||||
tokio = { version = "1.33.0", features = ["full"] }
|
||||
tokio = { version = "1.34.0", features = ["full"] }
|
||||
regex = "1.10.2"
|
||||
once_cell = "1.18.0"
|
||||
diesel-derive-newtype = "2.1.0"
|
||||
|
@ -142,15 +142,15 @@ diesel-derive-enum = { version = "2.1.0", features = ["postgres"] }
|
|||
strum = "0.25.0"
|
||||
strum_macros = "0.25.3"
|
||||
itertools = "0.11.0"
|
||||
futures = "0.3.28"
|
||||
http = "0.2.9"
|
||||
percent-encoding = "2.3.0"
|
||||
futures = "0.3.29"
|
||||
http = "0.2.11"
|
||||
percent-encoding = "2.3.1"
|
||||
rosetta-i18n = "0.1.3"
|
||||
opentelemetry = { version = "0.19.0", features = ["rt-tokio"] }
|
||||
tracing-opentelemetry = { version = "0.19.0" }
|
||||
ts-rs = { version = "7.0.0", features = ["serde-compat", "chrono-impl"] }
|
||||
rustls = { version = "0.21.8", features = ["dangerous_configuration"] }
|
||||
futures-util = "0.3.28"
|
||||
rustls = { version = "0.21.9", features = ["dangerous_configuration"] }
|
||||
futures-util = "0.3.29"
|
||||
tokio-postgres = "0.7.10"
|
||||
tokio-postgres-rustls = "0.10.0"
|
||||
enum-map = "2.7"
|
||||
|
@ -190,4 +190,4 @@ futures-util = { workspace = true }
|
|||
chrono = { workspace = true }
|
||||
prometheus = { version = "0.13.3", features = ["process"] }
|
||||
serial_test = { workspace = true }
|
||||
clap = { version = "4.4.7", features = ["derive"] }
|
||||
clap = { version = "4.4.8", features = ["derive"] }
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"@typescript-eslint/ban-ts-comment": 0,
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
"arrow-body-style": 0,
|
||||
"curly": 0,
|
||||
"eol-last": 0,
|
||||
|
|
|
@ -39,7 +39,6 @@ import {
|
|||
delay,
|
||||
} from "./shared";
|
||||
import { CommentView, CommunityView } from "lemmy-js-client";
|
||||
import { LemmyHttp } from "lemmy-js-client";
|
||||
|
||||
let betaCommunity: CommunityView | undefined;
|
||||
let postOnAlphaRes: PostResponse;
|
||||
|
|
|
@ -32,7 +32,7 @@ import {
|
|||
resolveBetaCommunity,
|
||||
longDelay,
|
||||
} from "./shared";
|
||||
import { EditSite, LemmyHttp } from "lemmy-js-client";
|
||||
import { EditSite } from "lemmy-js-client";
|
||||
|
||||
beforeAll(setupLogins);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
PurgePost,
|
||||
} from "lemmy-js-client";
|
||||
import {
|
||||
alpha,
|
||||
alphaImage,
|
||||
alphaUrl,
|
||||
beta,
|
||||
betaUrl,
|
||||
|
@ -18,13 +18,13 @@ import {
|
|||
setupLogins,
|
||||
unfollowRemotes,
|
||||
} from "./shared";
|
||||
import fs = require("fs");
|
||||
import * as fs from "node:fs";
|
||||
const downloadFileSync = require("download-file-sync");
|
||||
|
||||
beforeAll(setupLogins);
|
||||
|
||||
afterAll(() => {
|
||||
unfollowRemotes(alpha);
|
||||
unfollowRemotes(alphaImage);
|
||||
});
|
||||
|
||||
test("Upload image and delete it", async () => {
|
||||
|
@ -33,7 +33,7 @@ test("Upload image and delete it", async () => {
|
|||
const upload_form: UploadImage = {
|
||||
image: upload_image,
|
||||
};
|
||||
const upload = await alpha.uploadImage(upload_form);
|
||||
const upload = await alphaImage.uploadImage(upload_form);
|
||||
expect(upload.files![0].file).toBeDefined();
|
||||
expect(upload.files![0].delete_token).toBeDefined();
|
||||
expect(upload.url).toBeDefined();
|
||||
|
@ -48,7 +48,7 @@ test("Upload image and delete it", async () => {
|
|||
token: upload.files![0].delete_token,
|
||||
filename: upload.files![0].file,
|
||||
};
|
||||
const delete_ = await alpha.deleteImage(delete_form);
|
||||
const delete_ = await alphaImage.deleteImage(delete_form);
|
||||
expect(delete_).toBe(true);
|
||||
|
||||
// ensure that image is deleted
|
||||
|
@ -57,7 +57,7 @@ test("Upload image and delete it", async () => {
|
|||
});
|
||||
|
||||
test("Purge user, uploaded image removed", async () => {
|
||||
let user = await registerUser(alpha, alphaUrl);
|
||||
let user = await registerUser(alphaImage, alphaUrl);
|
||||
|
||||
// upload test image
|
||||
const upload_image = fs.readFileSync("test.png");
|
||||
|
@ -79,7 +79,7 @@ test("Purge user, uploaded image removed", async () => {
|
|||
const purge_form: PurgePerson = {
|
||||
person_id: site.my_user!.local_user_view.person.id,
|
||||
};
|
||||
const delete_ = await alpha.purgePerson(purge_form);
|
||||
const delete_ = await alphaImage.purgePerson(purge_form);
|
||||
expect(delete_.success).toBe(true);
|
||||
|
||||
// ensure that image is deleted
|
||||
|
|
|
@ -39,7 +39,7 @@ import {
|
|||
loginUser,
|
||||
} from "./shared";
|
||||
import { PostView } from "lemmy-js-client/dist/types/PostView";
|
||||
import { LemmyHttp, ResolveObject } from "lemmy-js-client";
|
||||
import { ResolveObject } from "lemmy-js-client";
|
||||
|
||||
let betaCommunity: CommunityView | undefined;
|
||||
|
||||
|
|
|
@ -75,17 +75,20 @@ import { GetPersonDetailsResponse } from "lemmy-js-client/dist/types/GetPersonDe
|
|||
import { GetPersonDetails } from "lemmy-js-client/dist/types/GetPersonDetails";
|
||||
import { ListingType } from "lemmy-js-client/dist/types/ListingType";
|
||||
|
||||
export const fetchFunction = fetch;
|
||||
|
||||
export let alphaUrl = "http://127.0.0.1:8541";
|
||||
export let betaUrl = "http://127.0.0.1:8551";
|
||||
export let gammaUrl = "http://127.0.0.1:8561";
|
||||
export let deltaUrl = "http://127.0.0.1:8571";
|
||||
export let epsilonUrl = "http://127.0.0.1:8581";
|
||||
|
||||
export let alpha = new LemmyHttp(alphaUrl);
|
||||
export let beta = new LemmyHttp(betaUrl);
|
||||
export let gamma = new LemmyHttp(gammaUrl);
|
||||
export let delta = new LemmyHttp(deltaUrl);
|
||||
export let epsilon = new LemmyHttp(epsilonUrl);
|
||||
export let alpha = new LemmyHttp(alphaUrl, { fetchFunction });
|
||||
export let alphaImage = new LemmyHttp(alphaUrl);
|
||||
export let beta = new LemmyHttp(betaUrl, { fetchFunction });
|
||||
export let gamma = new LemmyHttp(gammaUrl, { fetchFunction });
|
||||
export let delta = new LemmyHttp(deltaUrl, { fetchFunction });
|
||||
export let epsilon = new LemmyHttp(epsilonUrl, { fetchFunction });
|
||||
|
||||
export let betaAllowedInstances = [
|
||||
"lemmy-alpha",
|
||||
|
@ -135,6 +138,7 @@ export async function setupLogins() {
|
|||
resEpsilon,
|
||||
]);
|
||||
alpha.setHeaders({ Authorization: `Bearer ${res[0].jwt ?? ""}` });
|
||||
alphaImage.setHeaders({ Authorization: `Bearer ${res[0].jwt ?? ""}` });
|
||||
beta.setHeaders({ Authorization: `Bearer ${res[1].jwt ?? ""}` });
|
||||
gamma.setHeaders({ Authorization: `Bearer ${res[2].jwt ?? ""}` });
|
||||
delta.setHeaders({ Authorization: `Bearer ${res[3].jwt ?? ""}` });
|
||||
|
|
|
@ -18,6 +18,7 @@ import {
|
|||
saveUserSettings,
|
||||
getPost,
|
||||
getComments,
|
||||
fetchFunction,
|
||||
} from "./shared";
|
||||
import { LemmyHttp, SaveUserSettings } from "lemmy-js-client";
|
||||
import { GetPosts } from "lemmy-js-client/dist/types/GetPosts";
|
||||
|
@ -114,6 +115,7 @@ test("Delete user", async () => {
|
|||
test("Requests with invalid auth should be treated as unauthenticated", async () => {
|
||||
let invalid_auth = new LemmyHttp(alphaUrl, {
|
||||
headers: { Authorization: "Bearer foobar" },
|
||||
fetchFunction,
|
||||
});
|
||||
let site = await getSite(invalid_auth);
|
||||
expect(site.my_user).toBeUndefined();
|
||||
|
|
|
@ -68,7 +68,7 @@ once_cell = { workspace = true, optional = true }
|
|||
actix-web = { workspace = true, optional = true }
|
||||
jsonwebtoken = { version = "8.3.0", optional = true }
|
||||
# necessary for wasmt compilation
|
||||
getrandom = { version = "0.2.10", features = ["js"] }
|
||||
getrandom = { version = "0.2.11", features = ["js"] }
|
||||
enum-map = { workspace = true }
|
||||
|
||||
[package.metadata.cargo-machete]
|
||||
|
|
|
@ -31,4 +31,4 @@ serde_json.workspace = true
|
|||
tokio = { workspace = true, features = ["full"] }
|
||||
tracing.workspace = true
|
||||
moka = { version = "0.11.3", features = ["future"] }
|
||||
tokio-util = "0.7.9"
|
||||
tokio-util = "0.7.10"
|
||||
|
|
|
@ -41,7 +41,7 @@ uuid = { workspace = true, features = ["serde", "v4"] }
|
|||
rosetta-i18n = { workspace = true }
|
||||
percent-encoding = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
openssl = "0.10.57"
|
||||
openssl = "0.10.60"
|
||||
html2text = "0.6.0"
|
||||
deser-hjson = "1.2.0"
|
||||
smart-default = "0.7.1"
|
||||
|
|
Loading…
Reference in a new issue