feat: implement whitelist for self-hosted instances (#3939)

* whitelist for username based endpoints

* added gist whitelist

* review

* fix

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
Kyle Upton
2025-09-15 23:13:42 +03:00
committed by GitHub
co-authored by Alexandr
parent 70add4cfcf
commit 3987991058
11 changed files with 168 additions and 32 deletions
+5 -1
View File
@@ -307,7 +307,11 @@ describe("Test /api/", () => {
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(
renderError("Something went wrong", "This username is blacklisted"),
renderError(
"This username is blacklisted",
"Please deploy your own instance",
{ show_repo_link: false },
),
);
});
+5 -1
View File
@@ -156,7 +156,11 @@ describe("Test /api/pin", () => {
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(
renderError("Something went wrong", "This username is blacklisted"),
renderError(
"This username is blacklisted",
"Please deploy your own instance",
{ show_repo_link: false },
),
);
});
+5 -1
View File
@@ -184,7 +184,11 @@ describe("Test /api/top-langs", () => {
expect(res.setHeader).toBeCalledWith("Content-Type", "image/svg+xml");
expect(res.send).toBeCalledWith(
renderError("Something went wrong", "This username is blacklisted"),
renderError(
"This username is blacklisted",
"Please deploy your own instance",
{ show_repo_link: false },
),
);
});