diff --git a/local.db-shm b/local.db-shm
new file mode 100644
index 0000000..56400d5
Binary files /dev/null and b/local.db-shm differ
diff --git a/local.db-wal b/local.db-wal
new file mode 100644
index 0000000..103f226
Binary files /dev/null and b/local.db-wal differ
diff --git a/src/lib/components/AddRepositoryModal.svelte b/src/lib/components/AddRepositoryModal.svelte
index d620cd1..ca9fa9b 100644
--- a/src/lib/components/AddRepositoryModal.svelte
+++ b/src/lib/components/AddRepositoryModal.svelte
@@ -67,6 +67,7 @@
Add Repository
(showAddModal = true)}
class="flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700"
>
@@ -139,6 +140,7 @@
retrieval.
(showAddModal = true)}
class="mt-6 flex items-center gap-1.5 rounded-lg bg-blue-600 px-5 py-2.5 text-sm font-medium text-white hover:bg-blue-700"
>
diff --git a/src/routes/api/v1/libs/+server.ts b/src/routes/api/v1/libs/+server.ts
index b84e195..2ef09bd 100644
--- a/src/routes/api/v1/libs/+server.ts
+++ b/src/routes/api/v1/libs/+server.ts
@@ -28,8 +28,8 @@ export const GET: RequestHandler = ({ url }) => {
const libraries = service.list({ state: state ?? undefined, limit, offset });
const total = service.count(state ?? undefined);
- // Augment each library with its versions array
- const enriched = libraries.map((repo) => ({
+ // Augment each library with its versions array; strip sensitive fields.
+ const enriched = libraries.map(({ githubToken: _token, ...repo }) => ({
...repo,
versions: service.getVersions(repo.id)
}));
@@ -63,8 +63,9 @@ export const POST: RequestHandler = async ({ request }) => {
jobResponse = { id: job.id, status: job.status };
}
+ const { githubToken: _token, ...safeRepo } = repo;
return json(
- { library: repo, ...(jobResponse ? { job: jobResponse } : {}) },
+ { library: safeRepo, ...(jobResponse ? { job: jobResponse } : {}) },
{ status: 201 }
);
} catch (err) {
diff --git a/src/routes/api/v1/libs/[id]/+server.ts b/src/routes/api/v1/libs/[id]/+server.ts
index 8934b1e..2aa79f7 100644
--- a/src/routes/api/v1/libs/[id]/+server.ts
+++ b/src/routes/api/v1/libs/[id]/+server.ts
@@ -22,7 +22,8 @@ export const GET: RequestHandler = ({ params }) => {
return json({ error: 'Repository not found', code: 'NOT_FOUND' }, { status: 404 });
}
const versions = service.getVersions(id);
- return json({ ...repo, versions });
+ const { githubToken: _token, ...safeRepo } = repo;
+ return json({ ...safeRepo, versions });
} catch (err) {
return handleServiceError(err);
}
@@ -39,7 +40,8 @@ export const PATCH: RequestHandler = async ({ params, request }) => {
branch: body.branch,
githubToken: body.githubToken
});
- return json(updated);
+ const { githubToken: _token, ...safeUpdated } = updated;
+ return json(safeUpdated);
} catch (err) {
return handleServiceError(err);
}