Skip to content

Commit d6388d0

Browse files
authored
Merge pull request #4 from Paca-AI/feature/enhance-backend-routes
fix: update backend routes to include middleware for authentication a…
2 parents 17d7dd6 + ff22db4 commit d6388d0

1 file changed

Lines changed: 164 additions & 14 deletions

File tree

plugin.json

Lines changed: 164 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,175 @@
22
"id": "com.paca.github",
33
"displayName": "GitHub Integration",
44
"description": "Integrates GitHub repositories, pull requests, and branches with Paca projects and tasks.",
5-
"version": "0.1.0",
5+
"version": "0.1.2",
66
"permissions": ["db.read", "db.write"],
77
"backend": {
88
"allowedConfigKeys": ["ENCRYPTION_KEY", "PUBLIC_URL"],
99
"allowedOutboundDomains": ["api.github.com"],
1010
"routes": [
11-
{ "method": "GET", "path": "/github" },
12-
{ "method": "POST", "path": "/github/token" },
13-
{ "method": "DELETE", "path": "/github/token" },
14-
{ "method": "GET", "path": "/github/repositories" },
15-
{ "method": "GET", "path": "/github/linked-repositories" },
16-
{ "method": "POST", "path": "/github/linked-repositories" },
17-
{ "method": "DELETE", "path": "/github/linked-repositories/:repoId" },
18-
{ "method": "GET", "path": "/tasks/:taskId/github/pull-requests" },
19-
{ "method": "POST", "path": "/tasks/:taskId/github/pull-requests" },
20-
{ "method": "DELETE", "path": "/tasks/:taskId/github/pull-requests/:prId" },
21-
{ "method": "POST", "path": "/tasks/:taskId/github/branches" },
22-
{ "method": "GET", "path": "/tasks/:taskId/github/branches" },
23-
{ "method": "POST", "path": "/webhook", "public": true }
11+
{
12+
"method": "GET",
13+
"path": "/github",
14+
"middlewares": [
15+
{ "name": "optionalAuthn" },
16+
{ "name": "requireFreshPassword" },
17+
{
18+
"name": "requirePermissions",
19+
"scope": "project",
20+
"permissions": ["projects.read"]
21+
}
22+
]
23+
},
24+
{
25+
"method": "POST",
26+
"path": "/github/token",
27+
"middlewares": [
28+
{ "name": "optionalAuthn" },
29+
{ "name": "requireFreshPassword" },
30+
{
31+
"name": "requirePermissions",
32+
"scope": "project",
33+
"permissions": ["projects.write"]
34+
}
35+
]
36+
},
37+
{
38+
"method": "DELETE",
39+
"path": "/github/token",
40+
"middlewares": [
41+
{ "name": "optionalAuthn" },
42+
{ "name": "requireFreshPassword" },
43+
{
44+
"name": "requirePermissions",
45+
"scope": "project",
46+
"permissions": ["projects.write"]
47+
}
48+
]
49+
},
50+
{
51+
"method": "GET",
52+
"path": "/github/repositories",
53+
"middlewares": [
54+
{ "name": "optionalAuthn" },
55+
{ "name": "requireFreshPassword" },
56+
{
57+
"name": "requirePermissions",
58+
"scope": "project",
59+
"permissions": ["projects.read"]
60+
}
61+
]
62+
},
63+
{
64+
"method": "GET",
65+
"path": "/github/linked-repositories",
66+
"middlewares": [
67+
{ "name": "optionalAuthn" },
68+
{ "name": "requireFreshPassword" },
69+
{
70+
"name": "requirePermissions",
71+
"scope": "project",
72+
"permissions": ["projects.read"]
73+
}
74+
]
75+
},
76+
{
77+
"method": "POST",
78+
"path": "/github/linked-repositories",
79+
"middlewares": [
80+
{ "name": "optionalAuthn" },
81+
{ "name": "requireFreshPassword" },
82+
{
83+
"name": "requirePermissions",
84+
"scope": "project",
85+
"permissions": ["projects.write"]
86+
}
87+
]
88+
},
89+
{
90+
"method": "DELETE",
91+
"path": "/github/linked-repositories/:repoId",
92+
"middlewares": [
93+
{ "name": "optionalAuthn" },
94+
{ "name": "requireFreshPassword" },
95+
{
96+
"name": "requirePermissions",
97+
"scope": "project",
98+
"permissions": ["projects.write"]
99+
}
100+
]
101+
},
102+
{
103+
"method": "GET",
104+
"path": "/tasks/:taskId/github/pull-requests",
105+
"middlewares": [
106+
{ "name": "optionalAuthn" },
107+
{ "name": "requireFreshPassword" },
108+
{
109+
"name": "requirePermissions",
110+
"scope": "project",
111+
"permissions": ["tasks.read"]
112+
}
113+
]
114+
},
115+
{
116+
"method": "POST",
117+
"path": "/tasks/:taskId/github/pull-requests",
118+
"middlewares": [
119+
{ "name": "optionalAuthn" },
120+
{ "name": "requireFreshPassword" },
121+
{
122+
"name": "requirePermissions",
123+
"scope": "project",
124+
"permissions": ["tasks.write"]
125+
}
126+
]
127+
},
128+
{
129+
"method": "DELETE",
130+
"path": "/tasks/:taskId/github/pull-requests/:prId",
131+
"middlewares": [
132+
{ "name": "optionalAuthn" },
133+
{ "name": "requireFreshPassword" },
134+
{
135+
"name": "requirePermissions",
136+
"scope": "project",
137+
"permissions": ["tasks.write"]
138+
}
139+
]
140+
},
141+
{
142+
"method": "POST",
143+
"path": "/tasks/:taskId/github/branches",
144+
"middlewares": [
145+
{ "name": "optionalAuthn" },
146+
{ "name": "requireFreshPassword" },
147+
{
148+
"name": "requirePermissions",
149+
"scope": "project",
150+
"permissions": ["tasks.write"]
151+
}
152+
]
153+
},
154+
{
155+
"method": "GET",
156+
"path": "/tasks/:taskId/github/branches",
157+
"middlewares": [
158+
{ "name": "optionalAuthn" },
159+
{ "name": "requireFreshPassword" },
160+
{
161+
"name": "requirePermissions",
162+
"scope": "project",
163+
"permissions": ["tasks.read"]
164+
}
165+
]
166+
},
167+
{
168+
"method": "POST",
169+
"path": "/webhook",
170+
"middlewares": [
171+
{ "name": "optionalAuthn" }
172+
]
173+
}
24174
]
25175
},
26176
"frontend": {

0 commit comments

Comments
 (0)