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:
1 parent
4f99a99083
commit
3fa4ae2b66
12 files changed
+196
-39
No files matched your search
@@ -24,6 +24,10 @@ export default defineEventHandler(async (event) => {
|
||||
await ensureBootstrap()
|
||||
|
||||
const body = bodySchema.parse(await readBody(event))
|
||||
if (isEveryoneUsername(body.username)) {
|
||||
throw createError({ statusCode: 409, statusMessage: 'Username "everyone" is reserved' })
|
||||
}
|
||||
|
||||
const existing = await prisma.user.findUnique({ where: { username: body.username } })
|
||||
if (existing) {
|
||||
throw createError({ statusCode: 409, statusMessage: 'Username already exists' })
|
||||
|
||||
Reference in new issue
Block a user