Add everyone system user for anonymous registry pull.

Reserved PUBLIC ACLs can grant unauthenticated pull while blocking login, deletion, and anonymous push/delete.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ysj7705andCursor committed 2026-08-06 17:12:27 +09:00
1 parent 4f99a99083
commit 3fa4ae2b66
12 files changed
+196 -39

No files matched your search

+4
View File
@@ -9,6 +9,10 @@ export default defineEventHandler(async (event) => {
await ensureBootstrap()
const body = bodySchema.parse(await readBody(event))
if (isEveryoneUsername(body.username)) {
throw createError({ statusCode: 401, statusMessage: 'Invalid credentials' })
}
const user = await prisma.user.findUnique({ where: { username: body.username } })
if (!user || !user.active) {
throw createError({ statusCode: 401, statusMessage: 'Invalid credentials' })