export function createRegistryAuthMiddleware(r){return(t,e,o)=>{const s=t.method.toUpperCase();if("GET"===s||"HEAD"===s)return void o();const i="string"==typeof t.headers.authorization?t.headers.authorization:void 0;if(!i||!i.startsWith("Bearer "))return void e.status(401).json({error:"UNAUTHORIZED"});i.slice(7)===r?o():e.status(401).json({error:"UNAUTHORIZED"})}}