Skip to content

Commit 006affc

Browse files
committed
refactor: move GitHub GraphQL API logic to server
Changed architecture from Extension directly calling GitHub GraphQL API to routing through server for better separation of concerns - Add /api/issues/status and /api/issues/status/update endpoints to server - Simplify Extension's github-api.service.ts - Move GraphQL query building/parsing logic to Go server - Improve security by removing direct GitHub token exposure in Extension fix #81
1 parent 34de5f2 commit 006affc

12 files changed

Lines changed: 1630 additions & 816 deletions

File tree

extension/src/constants/api.spec.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { API, ERROR_MESSAGES, GRAPHQL } from "./api";
1+
import { API, ERROR_MESSAGES } from "./api";
22

33
describe("API Constants", () => {
44
describe("API", () => {
55
it("should have valid URL formats", () => {
66
const urlPattern = /^https?:\/\/.+/;
77
expect(API.BASE_URL).toMatch(urlPattern);
8-
expect(API.GITHUB.GRAPHQL_URL).toMatch(urlPattern);
98
expect(API.GITHUB.OAUTH_URL).toMatch(urlPattern);
109
});
1110

@@ -22,14 +21,6 @@ describe("API Constants", () => {
2221
it("should have correct structure", () => {
2322
expect(API.BASE_URL).toBeDefined();
2423
expect(API.GITHUB).toBeDefined();
25-
expect(API.GITHUB.GRAPHQL_URL).toBeDefined();
26-
});
27-
});
28-
29-
describe("GRAPHQL", () => {
30-
it("should have valid field names", () => {
31-
expect(GRAPHQL.ISSUE_ALIAS_PREFIX).toBe("issue");
32-
expect(GRAPHQL.STATUS_FIELD_NAME).toBe("Status");
3324
});
3425
});
3526

@@ -40,7 +31,6 @@ describe("API Constants", () => {
4031
});
4132

4233
it("should have correct structure", () => {
43-
// Verify the error message exists and is a string
4434
expect(typeof ERROR_MESSAGES.AUTH_REQUIRED).toBe("string");
4535
expect(ERROR_MESSAGES.AUTH_REQUIRED.length).toBeGreaterThan(0);
4636
});

extension/src/constants/api.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ export const API = {
22
BASE_URL: "https://github-project-status-viewer.vercel.app/api",
33
GITHUB: {
44
CLIENT_ID: "Ov23liFFkeCk13ofhM7c",
5-
GRAPHQL_URL: "https://api.github.com/graphql",
65
OAUTH_URL: "https://github.com/login/oauth/authorize",
76
SCOPE: "repo project",
87
},
@@ -11,8 +10,3 @@ export const API = {
1110
export const ERROR_MESSAGES = {
1211
AUTH_REQUIRED: "Authentication required. Please log in via the extension popup.",
1312
} as const;
14-
15-
export const GRAPHQL = {
16-
ISSUE_ALIAS_PREFIX: "issue",
17-
STATUS_FIELD_NAME: "Status",
18-
} as const;

0 commit comments

Comments
 (0)