-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-tests.http
More file actions
147 lines (117 loc) · 4.5 KB
/
Copy pathapi-tests.http
File metadata and controls
147 lines (117 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
### PoRepoLineTracker API Test Suite
### Base URL: https://localhost:5003 (launch profile `https`)
### Requires: Azurite running (docker compose up -d) and the app in Development.
###
### Auth: there is no login route for tools — Development/Test requests authenticate by
### sending X-Fake-User (a GUID verbatim; any other string hashes to a stable GUID).
### Writes additionally need the antiforgery pair: GET /api/antiforgery/token first (the
### response sets the cookie and returns the token), then echo it as X-CSRF-TOKEN.
@baseUrl = https://localhost:5003
@fakeUser = 00000000-0000-0000-0000-000000000001
# ============================================================
# Health & Diagnostics
# ============================================================
### Health check (anonymous)
GET {{baseUrl}}/health
Accept: application/json
### Diagnostics page payload (auth required)
GET {{baseUrl}}/diag
X-Fake-User: {{fakeUser}}
Accept: application/json
### Structured diagnostics (auth required)
GET {{baseUrl}}/api/diagnostics
X-Fake-User: {{fakeUser}}
Accept: application/json
# ============================================================
# Auth
# ============================================================
### Current session (anonymous returns isAuthenticated: false)
GET {{baseUrl}}/auth/me
Accept: application/json
### Antiforgery token — run before any POST/PUT/DELETE, copy `requestToken`
# @name antiforgery
GET {{baseUrl}}/api/antiforgery/token
X-Fake-User: {{fakeUser}}
Accept: application/json
# ============================================================
# Repositories
# ============================================================
### List my repositories
GET {{baseUrl}}/api/repositories
X-Fake-User: {{fakeUser}}
Accept: application/json
### All-repos chart series (last 30 days)
GET {{baseUrl}}/api/repositories/allcharts/30
X-Fake-User: {{fakeUser}}
Accept: application/json
### Bulk add repositories (the only write path — single add was removed)
POST {{baseUrl}}/api/repositories/bulk
X-Fake-User: {{fakeUser}}
X-CSRF-TOKEN: {{antiforgery.response.body.requestToken}}
Content-Type: application/json
[
{ "owner": "dotnet", "repoName": "roslyn", "cloneUrl": "https://github.com/dotnet/roslyn.git" }
]
### Line count history (replace {id})
# GET {{baseUrl}}/api/repositories/{id}/linehistory/30
# X-Fake-User: {{fakeUser}}
### File extension percentages (replace {id})
# GET {{baseUrl}}/api/repositories/{id}/file-extension-percentages
# X-Fake-User: {{fakeUser}}
### Contributor stats (replace {id})
# GET {{baseUrl}}/api/repositories/{id}/contributors/90
# X-Fake-User: {{fakeUser}}
### Re-analyze (replace {id})
# POST {{baseUrl}}/api/repositories/{id}/reanalyze
# X-Fake-User: {{fakeUser}}
# X-CSRF-TOKEN: {{antiforgery.response.body.requestToken}}
### Analysis progress (replace {id})
# GET {{baseUrl}}/api/repositories/{id}/analysis-progress
# X-Fake-User: {{fakeUser}}
### Delete one repository (replace {id})
# DELETE {{baseUrl}}/api/repositories/{id}
# X-Fake-User: {{fakeUser}}
# X-CSRF-TOKEN: {{antiforgery.response.body.requestToken}}
### Delete all my repositories
# DELETE {{baseUrl}}/api/repositories/all
# X-Fake-User: {{fakeUser}}
# X-CSRF-TOKEN: {{antiforgery.response.body.requestToken}}
# ============================================================
# GitHub
# ============================================================
### List the signed-in user's GitHub repositories (needs a real token or GitHub:PAT)
GET {{baseUrl}}/api/github/user-repositories
X-Fake-User: {{fakeUser}}
Accept: application/json
# ============================================================
# Settings
# ============================================================
### Get user preferences
GET {{baseUrl}}/api/settings/user-preferences
X-Fake-User: {{fakeUser}}
Accept: application/json
### Save user preferences
PUT {{baseUrl}}/api/settings/user-preferences
X-Fake-User: {{fakeUser}}
X-CSRF-TOKEN: {{antiforgery.response.body.requestToken}}
Content-Type: application/json
{
"fileExtensions": [".cs", ".razor", ".ts"]
}
# ============================================================
# Insights & Dev seeding
# ============================================================
### Portfolio insights
GET {{baseUrl}}/api/insights/portfolio
X-Fake-User: {{fakeUser}}
Accept: application/json
### Seed synthetic history (Development only, idempotent)
POST {{baseUrl}}/api/dev/seed/repository
X-Fake-User: {{fakeUser}}
X-CSRF-TOKEN: {{antiforgery.response.body.requestToken}}
Content-Type: application/json
{
"owner": "e2e",
"name": "seeded",
"days": 30
}