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 UptonandAlexandr authored and GitHub committed 2025-09-15 23:13:42 +03:00
1 parent 70add4cfcf
commit 3987991058
11 files changed
+168 -32

No files matched your search

+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 },
),
);
});