fix: Autenticación por token para MCP Server
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 36s

- Ruta /api/mcp agregada a rutas públicas de Traefik
- Validación de token Bearer en el endpoint
- Token configurado como secret MCP_AUTH_TOKEN
This commit is contained in:
2025-11-25 12:56:04 -06:00
parent 0e86f9d7a9
commit bc5eb826e8
15 changed files with 154 additions and 1 deletions

49
pwa/sw.js Normal file
View File

@@ -0,0 +1,49 @@
const CACHE_NAME = 'printer-central-cache-v1';
const urlsToCache = [
'index.html',
'manifest.json',
'icon.png',
'icons/icon-72.png',
'icons/icon-96.png',
'icons/icon-128.png',
'icons/icon-144.png',
'icons/icon-152.png',
'icons/icon-192.png',
'icons/icon-384.png',
'icons/icon-512.png'
];
self.addEventListener('install', event => {
event.waitUntil(
caches.open(CACHE_NAME)
.then(cache => {
return cache.addAll(urlsToCache);
})
);
});
self.addEventListener('fetch', event => {
event.respondWith(
caches.match(event.request)
.then(response => {
// Cache hit - return response
if (response) {
return response;
}
return fetch(event.request);
})
);
});
self.addEventListener('activate', event => {
const cacheWhitelist = [CACHE_NAME];
event.waitUntil(
caches.keys().then(keyList => {
return Promise.all(keyList.map(key => {
if (cacheWhitelist.indexOf(key) === -1) {
return caches.delete(key);
}
}));
})
);
});