Skip to content

Commit a75f110

Browse files
ScottArbeitScott Arbeit
andauthored
Grace authentication + authorization test suite (#60)
* Add authz test suite and access endpoint security * Reuse Aspire test host and consolidate bootstrap tests * Restore repo delete auth and temp fallback --------- Co-authored-by: Scott Arbeit <scottarbeit@github.com>
1 parent d309a9d commit a75f110

31 files changed

+2944
-828
lines changed

CodexPlan.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

_endpoint_stub.txt

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
endpoint "GET" "/" Authenticated
2+
endpoint "POST" "/access/checkPermission" Authenticated
3+
endpoint "POST" "/access/grantRole" Authenticated
4+
endpoint "POST" "/access/listPathPermissions" Authenticated
5+
endpoint "POST" "/access/listRoleAssignments" Authenticated
6+
endpoint "GET" "/access/listRoles" Authenticated
7+
endpoint "POST" "/access/removePathPermission" Authenticated
8+
endpoint "POST" "/access/revokeRole" Authenticated
9+
endpoint "POST" "/access/upsertPathPermission" Authenticated
10+
endpoint "POST" "/admin/deleteAllFromCosmosDB" Authenticated
11+
endpoint "POST" "/admin/deleteAllRemindersFromCosmosDB" Authenticated
12+
endpoint "GET" "/auth/login" Authenticated
13+
endpoint "GET" "/auth/login/%s" Authenticated
14+
endpoint "GET" "/auth/logout" Authenticated
15+
endpoint "GET" "/auth/me" Authenticated
16+
endpoint "GET" "/auth/oidc/config" Authenticated
17+
endpoint "POST" "/auth/token/create" Authenticated
18+
endpoint "POST" "/auth/token/list" Authenticated
19+
endpoint "POST" "/auth/token/revoke" Authenticated
20+
endpoint "POST" "/branch/assign" Authenticated
21+
endpoint "POST" "/branch/checkpoint" Authenticated
22+
endpoint "POST" "/branch/commit" Authenticated
23+
endpoint "POST" "/branch/create" Authenticated
24+
endpoint "POST" "/branch/createExternal" Authenticated
25+
endpoint "POST" "/branch/delete" Authenticated
26+
endpoint "POST" "/branch/enableAssign" Authenticated
27+
endpoint "POST" "/branch/enableAutoRebase" Authenticated
28+
endpoint "POST" "/branch/enableCheckpoint" Authenticated
29+
endpoint "POST" "/branch/enableCommit" Authenticated
30+
endpoint "POST" "/branch/enableExternal" Authenticated
31+
endpoint "POST" "/branch/enablePromotion" Authenticated
32+
endpoint "POST" "/branch/enableSave" Authenticated
33+
endpoint "POST" "/branch/enableTag" Authenticated
34+
endpoint "POST" "/branch/get" Authenticated
35+
endpoint "POST" "/branch/getCheckpoints" Authenticated
36+
endpoint "POST" "/branch/getCommits" Authenticated
37+
endpoint "POST" "/branch/getDiffsForReferenceType" Authenticated
38+
endpoint "POST" "/branch/getEvents" Authenticated
39+
endpoint "POST" "/branch/getExternals" Authenticated
40+
endpoint "POST" "/branch/getParentBranch" Authenticated
41+
endpoint "POST" "/branch/getPromotions" Authenticated
42+
endpoint "POST" "/branch/getRecursiveSize" Authenticated
43+
endpoint "POST" "/branch/getReference" Authenticated
44+
endpoint "POST" "/branch/getReferences" Authenticated
45+
endpoint "POST" "/branch/getSaves" Authenticated
46+
endpoint "POST" "/branch/getTags" Authenticated
47+
endpoint "POST" "/branch/getVersion" Authenticated
48+
endpoint "POST" "/branch/listContents" Authenticated
49+
endpoint "POST" "/branch/promote" Authenticated
50+
endpoint "POST" "/branch/rebase" Authenticated
51+
endpoint "POST" "/branch/save" Authenticated
52+
endpoint "POST" "/branch/setPromotionMode" Authenticated
53+
endpoint "POST" "/branch/tag" Authenticated
54+
endpoint "POST" "/branch/updateParentBranch" Authenticated
55+
endpoint "POST" "/candidate/attestations" Authenticated
56+
endpoint "POST" "/candidate/cancel" Authenticated
57+
endpoint "POST" "/candidate/gate/rerun" Authenticated
58+
endpoint "POST" "/candidate/get" Authenticated
59+
endpoint "POST" "/candidate/required-actions" Authenticated
60+
endpoint "POST" "/candidate/retry" Authenticated
61+
endpoint "POST" "/diff/getDiff" Authenticated
62+
endpoint "POST" "/diff/getDiffBySha256Hash" Authenticated
63+
endpoint "POST" "/diff/populate" Authenticated
64+
endpoint "POST" "/directory/create" Authenticated
65+
endpoint "POST" "/directory/get" Authenticated
66+
endpoint "POST" "/directory/getByDirectoryIds" Authenticated
67+
endpoint "POST" "/directory/getBySha256Hash" Authenticated
68+
endpoint "POST" "/directory/getDirectoryVersionsRecursive" Authenticated
69+
endpoint "POST" "/directory/getZipFile" Authenticated
70+
endpoint "POST" "/directory/saveDirectoryVersions" Authenticated
71+
endpoint "GET" "/healthz" Authenticated
72+
endpoint "POST" "/organization/create" Authenticated
73+
endpoint "POST" "/organization/delete" Authenticated
74+
endpoint "POST" "/organization/get" Authenticated
75+
endpoint "POST" "/organization/listRepositories" Authenticated
76+
endpoint "POST" "/organization/setDescription" Authenticated
77+
endpoint "POST" "/organization/setName" Authenticated
78+
endpoint "POST" "/organization/setSearchVisibility" Authenticated
79+
endpoint "POST" "/organization/setType" Authenticated
80+
endpoint "POST" "/organization/undelete" Authenticated
81+
endpoint "POST" "/owner/create" Authenticated
82+
endpoint "POST" "/owner/delete" Authenticated
83+
endpoint "POST" "/owner/get" Authenticated
84+
endpoint "POST" "/owner/listOrganizations" Authenticated
85+
endpoint "POST" "/owner/setDescription" Authenticated
86+
endpoint "POST" "/owner/setName" Authenticated
87+
endpoint "POST" "/owner/setSearchVisibility" Authenticated
88+
endpoint "POST" "/owner/setType" Authenticated
89+
endpoint "POST" "/owner/undelete" Authenticated
90+
endpoint "POST" "/policy/acknowledge" Authenticated
91+
endpoint "POST" "/policy/current" Authenticated
92+
endpoint "POST" "/promotionGroup/addPromotion" Authenticated
93+
endpoint "POST" "/promotionGroup/block" Authenticated
94+
endpoint "POST" "/promotionGroup/complete" Authenticated
95+
endpoint "POST" "/promotionGroup/create" Authenticated
96+
endpoint "POST" "/promotionGroup/delete" Authenticated
97+
endpoint "POST" "/promotionGroup/get" Authenticated
98+
endpoint "POST" "/promotionGroup/getEvents" Authenticated
99+
endpoint "POST" "/promotionGroup/markReady" Authenticated
100+
endpoint "POST" "/promotionGroup/removePromotion" Authenticated
101+
endpoint "POST" "/promotionGroup/reorderPromotions" Authenticated
102+
endpoint "POST" "/promotionGroup/schedule" Authenticated
103+
endpoint "POST" "/promotionGroup/start" Authenticated
104+
endpoint "POST" "/queue/dequeue" Authenticated
105+
endpoint "POST" "/queue/enqueue" Authenticated
106+
endpoint "POST" "/queue/pause" Authenticated
107+
endpoint "POST" "/queue/resume" Authenticated
108+
endpoint "POST" "/queue/status" Authenticated
109+
endpoint "POST" "/reminder/create" Authenticated
110+
endpoint "POST" "/reminder/delete" Authenticated
111+
endpoint "POST" "/reminder/get" Authenticated
112+
endpoint "POST" "/reminder/list" Authenticated
113+
endpoint "POST" "/reminder/reschedule" Authenticated
114+
endpoint "POST" "/reminder/updateTime" Authenticated
115+
endpoint "POST" "/repository/create" Authenticated
116+
endpoint "POST" "/repository/delete" Authenticated
117+
endpoint "POST" "/repository/exists" Authenticated
118+
endpoint "POST" "/repository/get" Authenticated
119+
endpoint "POST" "/repository/getBranches" Authenticated
120+
endpoint "POST" "/repository/getBranchesByBranchId" Authenticated
121+
endpoint "POST" "/repository/getReferencesByReferenceId" Authenticated
122+
endpoint "POST" "/repository/isEmpty" Authenticated
123+
endpoint "POST" "/repository/setAllowsLargeFiles" Authenticated
124+
endpoint "POST" "/repository/setAnonymousAccess" Authenticated
125+
endpoint "POST" "/repository/setCheckpointDays" Authenticated
126+
endpoint "POST" "/repository/setConflictResolutionPolicy" Authenticated
127+
endpoint "POST" "/repository/setDefaultServerApiVersion" Authenticated
128+
endpoint "POST" "/repository/setDescription" Authenticated
129+
endpoint "POST" "/repository/setDiffCacheDays" Authenticated
130+
endpoint "POST" "/repository/setDirectoryVersionCacheDays" Authenticated
131+
endpoint "POST" "/repository/setLogicalDeleteDays" Authenticated
132+
endpoint "POST" "/repository/setName" Authenticated
133+
endpoint "POST" "/repository/setRecordSaves" Authenticated
134+
endpoint "POST" "/repository/setSaveDays" Authenticated
135+
endpoint "POST" "/repository/setStatus" Authenticated
136+
endpoint "POST" "/repository/setVisibility" Authenticated
137+
endpoint "POST" "/repository/undelete" Authenticated
138+
endpoint "POST" "/review/checkpoint" Authenticated
139+
endpoint "POST" "/review/deepen" Authenticated
140+
endpoint "POST" "/review/packet" Authenticated
141+
endpoint "POST" "/review/resolve" Authenticated
142+
endpoint "POST" "/storage/getDownloadUri" Authenticated
143+
endpoint "POST" "/storage/getUploadMetadataForFiles" Authenticated
144+
endpoint "POST" "/storage/getUploadUri" Authenticated
145+
endpoint "POST" "/work/create" Authenticated
146+
endpoint "POST" "/work/get" Authenticated
147+
endpoint "POST" "/work/link/promotion-group" Authenticated
148+
endpoint "POST" "/work/link/reference" Authenticated
149+
endpoint "POST" "/work/update" Authenticated

scripts/validate.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,29 @@ try {
182182

183183
if (-not $SkipBuild) {
184184
Write-Section "Build"
185+
if ($Full) {
186+
Invoke-External "Grace.Aspire.AppHost build" { dotnet build "src/Grace.Aspire.AppHost/Grace.Aspire.AppHost.csproj" -c $Configuration }
187+
}
185188
Invoke-External "Grace.Server build" { dotnet build "src/Grace.Server/Grace.Server.fsproj" -c $Configuration }
186189
Invoke-External "Grace.CLI build" { dotnet build "src/Grace.CLI/Grace.CLI.fsproj" -c $Configuration }
187190
Invoke-External "Grace.SDK build" { dotnet build "src/Grace.SDK/Grace.SDK.fsproj" -c $Configuration }
191+
Invoke-External "Grace.Authorization.Tests build" { dotnet build "src/Grace.Authorization.Tests/Grace.Authorization.Tests.fsproj" -c $Configuration }
192+
Invoke-External "Grace.CLI.Tests build" { dotnet build "src/Grace.CLI.Tests/Grace.CLI.Tests.fsproj" -c $Configuration }
193+
if ($Full) {
194+
Invoke-External "Grace.Server.Tests build" { dotnet build "src/Grace.Server.Tests/Grace.Server.Tests.fsproj" -c $Configuration }
195+
}
188196
} else {
189197
Write-Section "Build"
190198
Write-Host "Skipped (-SkipBuild)."
191199
}
192200

193201
if (-not $SkipTests) {
194202
Write-Section "Test"
195-
Invoke-External "Grace.CLI.Tests" { dotnet test "src/Grace.CLI.Tests/Grace.CLI.Tests.fsproj" -c $Configuration }
203+
Invoke-External "Grace.Authorization.Tests" { dotnet test "src/Grace.Authorization.Tests/Grace.Authorization.Tests.fsproj" -c $Configuration --no-build }
204+
Invoke-External "Grace.CLI.Tests" { dotnet test "src/Grace.CLI.Tests/Grace.CLI.Tests.fsproj" -c $Configuration --no-build }
196205

197206
if ($Full) {
198-
Invoke-External "Grace.Server.Tests" { dotnet test "src/Grace.Server.Tests/Grace.Server.Tests.fsproj" -c $Configuration }
207+
Invoke-External "Grace.Server.Tests" { dotnet test "src/Grace.Server.Tests/Grace.Server.Tests.fsproj" -c $Configuration --no-build }
199208
}
200209
} else {
201210
Write-Section "Test"

0 commit comments

Comments
 (0)