CORS
Cross-Origin Resource Sharing
CORS es una regla de seguridad HTTP del navegador. Un servidor lista qué otros orígenes pueden leer sus respuestas. Puede limitar métodos, headers y credenciales.
Otro ejemplo
Un panel en app.example.com llama a api.example.net. La API revisa el preflight antes de las escrituras autenticadas y solo permite el origen de producción.
Partes principales
- 01Identity or input
- 02Policy or transformation
- 03Stored result and audit evidence
Úsalo cuando
Configure CORS en el servidor o gateway cuando el código del navegador deba leer otro origen.
No lo uses cuando
No uses orígenes con comodín junto con credenciales ni devuelvas orígenes desconocidos. CORS no reemplaza la autenticación ni la protección CSRF.
Nombre usado en código
Origin / Access-Control-Allow-* / OPTIONS Antes de lanzarlo
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome: Complete the task with Cross-Origin Resource Sharing (CORS). User context: Un panel en app.example.com llama a api.example.net. La API revisa el preflight antes de las escrituras autenticadas y solo permite el origen de producción. Technical concept or control: Cross-Origin Resource Sharing (CORS). Why it fits: Configure CORS en el servidor o gateway cuando el código del navegador deba leer otro origen. Do not use it when: No uses orígenes con comodín junto con credenciales ni devuelvas orígenes desconocidos. CORS no reemplaza la autenticación ni la protección CSRF. Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary): El estándar cubre únicamente el alcance listado. No elige el estilo visual, la decisión del producto ni el ejemplo de Vibulary. Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
Revisa esta petición
Review how Cross-Origin Resource Sharing (CORS) is used now. Definition: CORS es una regla de seguridad HTTP del navegador. Un servidor lista qué otros orígenes pueden leer sus respuestas. Puede limitar métodos, headers y credenciales. Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.