Upgrading deps. (#4196)

* Upgrading deps.

* Try to use native node-fetch function.

* Fixing image upload tests.
This commit is contained in:
Dessalines 2023-11-24 04:29:41 -05:00 committed by GitHub
parent d795c54a7a
commit 2b5a31b411
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 294 additions and 270 deletions

494
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -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 = [ activitypub_federation = { version = "0.5.0-beta.5", default-features = false, features = [
"actix-web", "actix-web",
] } ] }
diesel = "2.1.3" diesel = "2.1.4"
diesel_migrations = "2.1.0" diesel_migrations = "2.1.0"
diesel-async = "0.3.2" diesel-async = "0.3.2"
serde = { version = "1.0.189", features = ["derive"] } serde = { version = "1.0.193", features = ["derive"] }
serde_with = "3.4.0" serde_with = "3.4.0"
actix-web = { version = "4.4.0", default-features = false, features = [ actix-web = { version = "4.4.0", default-features = false, features = [
"macros", "macros",
@ -111,11 +111,11 @@ actix-web = { version = "4.4.0", default-features = false, features = [
"cookies", "cookies",
] } ] }
tracing = "0.1.40" 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-error = "0.2.0"
tracing-log = "0.1.4" tracing-log = "0.1.4"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
url = { version = "2.4.1", features = ["serde"] } url = { version = "2.5.0", features = ["serde"] }
reqwest = { version = "0.11.22", features = ["json", "blocking", "gzip"] } reqwest = { version = "0.11.22", features = ["json", "blocking", "gzip"] }
reqwest-middleware = "0.2.4" reqwest-middleware = "0.2.4"
reqwest-tracing = "0.4.6" reqwest-tracing = "0.4.6"
@ -123,9 +123,9 @@ clokwerk = "0.4.0"
doku = { version = "0.21.1", features = ["url-2"] } doku = { version = "0.21.1", features = ["url-2"] }
bcrypt = "0.15.0" bcrypt = "0.15.0"
chrono = { version = "0.4.31", features = ["serde"], default-features = false } 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" 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" async-trait = "0.1.74"
captcha = "0.0.9" captcha = "0.0.9"
anyhow = { version = "1.0.75", features = [ anyhow = { version = "1.0.75", features = [
@ -134,7 +134,7 @@ anyhow = { version = "1.0.75", features = [
diesel_ltree = "0.3.0" diesel_ltree = "0.3.0"
typed-builder = "0.15.2" typed-builder = "0.15.2"
serial_test = "2.0.0" serial_test = "2.0.0"
tokio = { version = "1.33.0", features = ["full"] } tokio = { version = "1.34.0", features = ["full"] }
regex = "1.10.2" regex = "1.10.2"
once_cell = "1.18.0" once_cell = "1.18.0"
diesel-derive-newtype = "2.1.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 = "0.25.0"
strum_macros = "0.25.3" strum_macros = "0.25.3"
itertools = "0.11.0" itertools = "0.11.0"
futures = "0.3.28" futures = "0.3.29"
http = "0.2.9" http = "0.2.11"
percent-encoding = "2.3.0" percent-encoding = "2.3.1"
rosetta-i18n = "0.1.3" rosetta-i18n = "0.1.3"
opentelemetry = { version = "0.19.0", features = ["rt-tokio"] } opentelemetry = { version = "0.19.0", features = ["rt-tokio"] }
tracing-opentelemetry = { version = "0.19.0" } tracing-opentelemetry = { version = "0.19.0" }
ts-rs = { version = "7.0.0", features = ["serde-compat", "chrono-impl"] } ts-rs = { version = "7.0.0", features = ["serde-compat", "chrono-impl"] }
rustls = { version = "0.21.8", features = ["dangerous_configuration"] } rustls = { version = "0.21.9", features = ["dangerous_configuration"] }
futures-util = "0.3.28" futures-util = "0.3.29"
tokio-postgres = "0.7.10" tokio-postgres = "0.7.10"
tokio-postgres-rustls = "0.10.0" tokio-postgres-rustls = "0.10.0"
enum-map = "2.7" enum-map = "2.7"
@ -190,4 +190,4 @@ futures-util = { workspace = true }
chrono = { workspace = true } chrono = { workspace = true }
prometheus = { version = "0.13.3", features = ["process"] } prometheus = { version = "0.13.3", features = ["process"] }
serial_test = { workspace = true } serial_test = { workspace = true }
clap = { version = "4.4.7", features = ["derive"] } clap = { version = "4.4.8", features = ["derive"] }

View file

@ -14,6 +14,7 @@
"@typescript-eslint/ban-ts-comment": 0, "@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-explicit-any": 0, "@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": 0, "@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-var-requires": 0,
"arrow-body-style": 0, "arrow-body-style": 0,
"curly": 0, "curly": 0,
"eol-last": 0, "eol-last": 0,

View file

@ -39,7 +39,6 @@ import {
delay, delay,
} from "./shared"; } from "./shared";
import { CommentView, CommunityView } from "lemmy-js-client"; import { CommentView, CommunityView } from "lemmy-js-client";
import { LemmyHttp } from "lemmy-js-client";
let betaCommunity: CommunityView | undefined; let betaCommunity: CommunityView | undefined;
let postOnAlphaRes: PostResponse; let postOnAlphaRes: PostResponse;

View file

@ -32,7 +32,7 @@ import {
resolveBetaCommunity, resolveBetaCommunity,
longDelay, longDelay,
} from "./shared"; } from "./shared";
import { EditSite, LemmyHttp } from "lemmy-js-client"; import { EditSite } from "lemmy-js-client";
beforeAll(setupLogins); beforeAll(setupLogins);

View file

@ -7,7 +7,7 @@ import {
PurgePost, PurgePost,
} from "lemmy-js-client"; } from "lemmy-js-client";
import { import {
alpha, alphaImage,
alphaUrl, alphaUrl,
beta, beta,
betaUrl, betaUrl,
@ -18,13 +18,13 @@ import {
setupLogins, setupLogins,
unfollowRemotes, unfollowRemotes,
} from "./shared"; } from "./shared";
import fs = require("fs"); import * as fs from "node:fs";
const downloadFileSync = require("download-file-sync"); const downloadFileSync = require("download-file-sync");
beforeAll(setupLogins); beforeAll(setupLogins);
afterAll(() => { afterAll(() => {
unfollowRemotes(alpha); unfollowRemotes(alphaImage);
}); });
test("Upload image and delete it", async () => { test("Upload image and delete it", async () => {
@ -33,7 +33,7 @@ test("Upload image and delete it", async () => {
const upload_form: UploadImage = { const upload_form: UploadImage = {
image: upload_image, 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].file).toBeDefined();
expect(upload.files![0].delete_token).toBeDefined(); expect(upload.files![0].delete_token).toBeDefined();
expect(upload.url).toBeDefined(); expect(upload.url).toBeDefined();
@ -48,7 +48,7 @@ test("Upload image and delete it", async () => {
token: upload.files![0].delete_token, token: upload.files![0].delete_token,
filename: upload.files![0].file, filename: upload.files![0].file,
}; };
const delete_ = await alpha.deleteImage(delete_form); const delete_ = await alphaImage.deleteImage(delete_form);
expect(delete_).toBe(true); expect(delete_).toBe(true);
// ensure that image is deleted // ensure that image is deleted
@ -57,7 +57,7 @@ test("Upload image and delete it", async () => {
}); });
test("Purge user, uploaded image removed", async () => { test("Purge user, uploaded image removed", async () => {
let user = await registerUser(alpha, alphaUrl); let user = await registerUser(alphaImage, alphaUrl);
// upload test image // upload test image
const upload_image = fs.readFileSync("test.png"); const upload_image = fs.readFileSync("test.png");
@ -79,7 +79,7 @@ test("Purge user, uploaded image removed", async () => {
const purge_form: PurgePerson = { const purge_form: PurgePerson = {
person_id: site.my_user!.local_user_view.person.id, 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); expect(delete_.success).toBe(true);
// ensure that image is deleted // ensure that image is deleted

View file

@ -39,7 +39,7 @@ import {
loginUser, loginUser,
} from "./shared"; } from "./shared";
import { PostView } from "lemmy-js-client/dist/types/PostView"; 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; let betaCommunity: CommunityView | undefined;

View file

@ -75,17 +75,20 @@ import { GetPersonDetailsResponse } from "lemmy-js-client/dist/types/GetPersonDe
import { GetPersonDetails } from "lemmy-js-client/dist/types/GetPersonDetails"; import { GetPersonDetails } from "lemmy-js-client/dist/types/GetPersonDetails";
import { ListingType } from "lemmy-js-client/dist/types/ListingType"; import { ListingType } from "lemmy-js-client/dist/types/ListingType";
export const fetchFunction = fetch;
export let alphaUrl = "http://127.0.0.1:8541"; export let alphaUrl = "http://127.0.0.1:8541";
export let betaUrl = "http://127.0.0.1:8551"; export let betaUrl = "http://127.0.0.1:8551";
export let gammaUrl = "http://127.0.0.1:8561"; export let gammaUrl = "http://127.0.0.1:8561";
export let deltaUrl = "http://127.0.0.1:8571"; export let deltaUrl = "http://127.0.0.1:8571";
export let epsilonUrl = "http://127.0.0.1:8581"; export let epsilonUrl = "http://127.0.0.1:8581";
export let alpha = new LemmyHttp(alphaUrl); export let alpha = new LemmyHttp(alphaUrl, { fetchFunction });
export let beta = new LemmyHttp(betaUrl); export let alphaImage = new LemmyHttp(alphaUrl);
export let gamma = new LemmyHttp(gammaUrl); export let beta = new LemmyHttp(betaUrl, { fetchFunction });
export let delta = new LemmyHttp(deltaUrl); export let gamma = new LemmyHttp(gammaUrl, { fetchFunction });
export let epsilon = new LemmyHttp(epsilonUrl); export let delta = new LemmyHttp(deltaUrl, { fetchFunction });
export let epsilon = new LemmyHttp(epsilonUrl, { fetchFunction });
export let betaAllowedInstances = [ export let betaAllowedInstances = [
"lemmy-alpha", "lemmy-alpha",
@ -135,6 +138,7 @@ export async function setupLogins() {
resEpsilon, resEpsilon,
]); ]);
alpha.setHeaders({ Authorization: `Bearer ${res[0].jwt ?? ""}` }); alpha.setHeaders({ Authorization: `Bearer ${res[0].jwt ?? ""}` });
alphaImage.setHeaders({ Authorization: `Bearer ${res[0].jwt ?? ""}` });
beta.setHeaders({ Authorization: `Bearer ${res[1].jwt ?? ""}` }); beta.setHeaders({ Authorization: `Bearer ${res[1].jwt ?? ""}` });
gamma.setHeaders({ Authorization: `Bearer ${res[2].jwt ?? ""}` }); gamma.setHeaders({ Authorization: `Bearer ${res[2].jwt ?? ""}` });
delta.setHeaders({ Authorization: `Bearer ${res[3].jwt ?? ""}` }); delta.setHeaders({ Authorization: `Bearer ${res[3].jwt ?? ""}` });

View file

@ -18,6 +18,7 @@ import {
saveUserSettings, saveUserSettings,
getPost, getPost,
getComments, getComments,
fetchFunction,
} from "./shared"; } from "./shared";
import { LemmyHttp, SaveUserSettings } from "lemmy-js-client"; import { LemmyHttp, SaveUserSettings } from "lemmy-js-client";
import { GetPosts } from "lemmy-js-client/dist/types/GetPosts"; 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 () => { test("Requests with invalid auth should be treated as unauthenticated", async () => {
let invalid_auth = new LemmyHttp(alphaUrl, { let invalid_auth = new LemmyHttp(alphaUrl, {
headers: { Authorization: "Bearer foobar" }, headers: { Authorization: "Bearer foobar" },
fetchFunction,
}); });
let site = await getSite(invalid_auth); let site = await getSite(invalid_auth);
expect(site.my_user).toBeUndefined(); expect(site.my_user).toBeUndefined();

View file

@ -68,7 +68,7 @@ once_cell = { workspace = true, optional = true }
actix-web = { workspace = true, optional = true } actix-web = { workspace = true, optional = true }
jsonwebtoken = { version = "8.3.0", optional = true } jsonwebtoken = { version = "8.3.0", optional = true }
# necessary for wasmt compilation # necessary for wasmt compilation
getrandom = { version = "0.2.10", features = ["js"] } getrandom = { version = "0.2.11", features = ["js"] }
enum-map = { workspace = true } enum-map = { workspace = true }
[package.metadata.cargo-machete] [package.metadata.cargo-machete]

View file

@ -31,4 +31,4 @@ serde_json.workspace = true
tokio = { workspace = true, features = ["full"] } tokio = { workspace = true, features = ["full"] }
tracing.workspace = true tracing.workspace = true
moka = { version = "0.11.3", features = ["future"] } moka = { version = "0.11.3", features = ["future"] }
tokio-util = "0.7.9" tokio-util = "0.7.10"

View file

@ -41,7 +41,7 @@ uuid = { workspace = true, features = ["serde", "v4"] }
rosetta-i18n = { workspace = true } rosetta-i18n = { workspace = true }
percent-encoding = { workspace = true } percent-encoding = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }
openssl = "0.10.57" openssl = "0.10.60"
html2text = "0.6.0" html2text = "0.6.0"
deser-hjson = "1.2.0" deser-hjson = "1.2.0"
smart-default = "0.7.1" smart-default = "0.7.1"