-
Notifications
You must be signed in to change notification settings - Fork 11
Handle KAI token config and route normalization #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,10 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| const KAI_BEARER_TOKEN = process.env.KAI_BEARER_TOKEN?.trim() | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| export const KAI_HEADERS = { | ||||||||||||||||||||||||||||||||||||||||||||||
| "User-Agent": | ||||||||||||||||||||||||||||||||||||||||||||||
| "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:132.0) Gecko/20100101 Firefox/132.0", | ||||||||||||||||||||||||||||||||||||||||||||||
| Accept: "application/json, text/javascript, */*; q=0.01", | ||||||||||||||||||||||||||||||||||||||||||||||
| "Accept-Language": "en-US,en;q=0.5", | ||||||||||||||||||||||||||||||||||||||||||||||
| Authorization: | ||||||||||||||||||||||||||||||||||||||||||||||
| "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzIiwianRpIjoiMDYzNWIyOGMzYzg3YTY3ZTRjYWE4YTI0MjYxZGYwYzIxNjYzODA4NWM2NWU4ZjhiYzQ4OGNlM2JiZThmYWNmODU4YzY0YmI0MjgyM2EwOTUiLCJpYXQiOjE3MjI2MTc1MTQsIm5iZiI6MTcyMjYxNzUxNCwiZXhwIjoxNzU0MTUzNTE0LCJzdWIiOiI1Iiwic2NvcGVzIjpbXX0.Jz_sedcMtaZJ4dj0eWVc4_pr_wUQ3s1-UgpopFGhEmJt_iGzj6BdnOEEhcDDdIz-gydQL5ek0S_36v5h6P_X3OQyII3JmHp1SEDJMwrcy4FCY63-jGnhPBb4sprqUFruDRFSEIs1cNQ-3rv3qRDzJtGYc_bAkl2MfgZj85bvt2DDwBWPraZuCCkwz2fJvox-6qz6P7iK9YdQq8AjJfuNdl7t_1hMHixmtDG0KooVnfBV7PoChxvcWvs8FOmtYRdqD7RSEIoOXym2kcwqK-rmbWf9VuPQCN5gjLPimL4t2TbifBg5RWNIAAuHLcYzea48i3okbhkqGGlYTk3iVMU6Hf_Jruns1WJr3A961bd4rny62lNXyGPgNLRJJKedCs5lmtUTr4gZRec4Pz_MqDzlEYC3QzRAOZv0Ergp8-W1Vrv5gYyYNr-YQNdZ01mc7JH72N2dpU9G00K5kYxlcXDNVh8520-R-MrxYbmiFGVlNF2BzEH8qq6Ko9m0jT0NiKEOjetwegrbNdNq_oN4KmHvw2sHkGWY06rUeciYJMhBF1JZuRjj3JTwBUBVXcYZMFtwUAoikVByzKuaZZeTo1AtCiSjejSHNdpLxyKk_SFUzog5MOkUN1ktAhFnBFoz6SlWAJBJIS-lHYsdFLSug2YNiaNllkOUsDbYkiDtmPc9XWc", | ||||||||||||||||||||||||||||||||||||||||||||||
| Authorization: `Bearer ${KAI_BEARER_TOKEN}`, | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle missing If Proposed fix: fail fast if token is missing-const KAI_BEARER_TOKEN = process.env.KAI_BEARER_TOKEN?.trim()
+const KAI_BEARER_TOKEN = process.env.KAI_BEARER_TOKEN?.trim()
+
+if (!KAI_BEARER_TOKEN) {
+ throw new Error("KAI_BEARER_TOKEN environment variable is required")
+}
export const KAI_HEADERS = {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
| Priority: "u=0", | ||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,6 +48,25 @@ const sync = async () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const normalizeStationKey = (name: string) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let normalized = name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .toUpperCase() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .replace(/VIA\\s*MRI/g, "") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .replace(/VIAMRI/g, "") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .replace(/\\s+/g, "") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .replace(/[^A-Z0-9]/g, "") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (normalized === "TANJUNGPRIUK") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| normalized = "TANJUNGPRIOK" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return normalized | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+51
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regex escape sequences are incorrect. In JavaScript regex literals, Proposed fix const normalizeStationKey = (name: string) => {
let normalized = name
.toUpperCase()
- .replace(/VIA\\s*MRI/g, "")
- .replace(/VIAMRI/g, "")
- .replace(/\\s+/g, "")
- .replace(/[^A-Z0-9]/g, "")
+ .replace(/VIA\s*MRI/g, "")
+ .replace(/VIAMRI/g, "")
+ .replace(/\s+/g, "")
+ .replace(/[^A-Z0-9]/g, "")
if (normalized === "TANJUNGPRIUK") {
normalized = "TANJUNGPRIOK"
}
return normalized
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const stationIdByKey = new Map( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stations.map((station) => [normalizeStationKey(station.name), station.id]), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (let i = 0; i < totalBatches; i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const start = i * batchSizes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const end = start + batchSizes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -57,7 +76,7 @@ const sync = async () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| batch.map(async ({ id, metadata }) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await sleep(5000) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const url = `${process.env.KRL_ENDPOINT_BASE_URL}/schedule?stationid=${id}&timefrom=00:00&timeto=23:00` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const url = `${process.env.KRL_ENDPOINT_BASE_URL}/schedules?stationid=${id}&timefrom=00:00&timeto=23:00` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.info(`[SYNC][SCHEDULE][${id}] Send preflight`) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const optionsResponse = await fetch(url, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -94,52 +113,64 @@ const sync = async () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!parsed.success) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.error(`[SYNC][SCHEDULE][${id}] Error parse`) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const values = parsed.data.data.map((d) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let [origin, destination] = d.route_name.split("-") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const fixName = (name: string) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| switch (name) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "TANJUNGPRIUK": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return "TANJUNG PRIOK" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "JAKARTAKOTA": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return "JAKARTA KOTA" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "KAMPUNGBANDAN": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return "KAMPUNG BANDAN" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "TANAHABANG": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return "TANAH ABANG" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "PARUNGPANJANG": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return "PARUNG PANJANG" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "BANDARASOEKARNOHATTA": | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return "BANDARA SOEKARNO HATTA" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const missingRoutes: string[] = [] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const values = parsed.data.data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .map((d) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const routeParts = d.route_name.split("-") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (routeParts.length < 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| missingRoutes.push(d.route_name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| origin = fixName(origin) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| destination = fixName(destination) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: `sc_krl_${id}_${d.train_id}`.toLowerCase(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| station_id: id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| station_origin_id: stations.find( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ({ name }) => name === origin, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )?.id!, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| station_destination_id: stations.find( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ({ name }) => name === destination, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )?.id!, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| train_id: d.train_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| line: d.ka_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| route: d.route_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| departs_at: parseTime(d.time_est).toISOString(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrives_at: parseTime(d.dest_time).toISOString(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metadata: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| origin: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: d.color, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const originRaw = routeParts[0].trim() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const destinationRaw = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| routeParts[routeParts.length - 1].trim() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const originKey = normalizeStationKey(originRaw) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const destinationKey = normalizeStationKey(destinationRaw) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const originId = stationIdByKey.get(originKey) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const destinationId = stationIdByKey.get(destinationKey) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!originId || !destinationId) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| missingRoutes.push(d.route_name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: `sc_krl_${id}_${d.train_id}`.toLowerCase(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| station_id: id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| station_origin_id: originId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| station_destination_id: destinationId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| train_id: d.train_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| line: d.ka_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| route: d.route_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| departs_at: parseTime(d.time_est).toISOString(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrives_at: parseTime(d.dest_time).toISOString(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| metadata: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| origin: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: d.color, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } satisfies NewSchedule | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } satisfies NewSchedule | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .filter((value): value is NewSchedule => value !== null) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (missingRoutes.length > 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.warn( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `[SYNC][SCHEDULE][${id}] Skipped ${missingRoutes.length} rows with unknown stations. Sample: ${missingRoutes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .slice(0, 3) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .join(", ")}`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (values.length === 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.info( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `[SYNC][SCHEDULE][${id}] No valid schedule rows to insert`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const insert = await db | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .insert(scheduleTable) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -185,14 +216,25 @@ const sync = async () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `[SYNC][SCHEDULE][${id}] Updated station schedule availability status`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const err = await req.json() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const txt = await req.text() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const raw = await req.text() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let err: unknown = null | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (raw) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| err = JSON.parse(raw) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| err = raw | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.error( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `[SYNC][SCHEDULE][${id}] Error fetch schedule data. Trace: ${JSON.stringify( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| err, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )}. Status: ${req.status}. Req: ${txt}`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| err ?? "<empty>", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )}. Status: ${req.status}.`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw new Error( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| typeof err === "string" && err.length | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? err | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : `Request failed with status ${req.status}`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw new Error(JSON.stringify(err)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Remove real JWT token from example file.
This example file contains what appears to be a real, valid JWT token. Example files are committed to version control and should only contain placeholder values like
"your-bearer-token-here"or"<KAI_BEARER_TOKEN>". Real tokens risk exposure even after rotation if the repository history is public.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents