CORS
교차 출처 리소스 공유
CORS는 브라우저 HTTP 안전 규칙임. 서버는 어떤 다른 출처가 응답을 읽을 수 있는지 목록화함. 메서드, 헤더, 인증 정보를 제한할 수 있음.
다른 예시
app.example.com에 있는 대시보드는 api.example.net을 호출해요. API는 인증된 쓰기를 하기 전에 사전 확인을 거치고, 오직 배포 환경만 허용해요.
주요 부분
- 01Identity or input
- 02Policy or transformation
- 03Stored result and audit evidence
사용할 때
브라우저 코드가 다른 출처를 읽어야 할 때 서버 또는 게이트웨이에서 CORS 설정
다음 경우에는 사용하지 마세요
자격 증명이 있는 와일드카드 출처를 사용하거나 알 수 없는 출처를 반영하지 마세요. CORS는 인증이나 CSRF 보호를 대체하지 않습니다.
코드에서 사용된 이름
Origin / Access-Control-Allow-* / OPTIONS 출시하기 전에
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 교차 출처 리소스 공유 (CORS)。 User context:app.example.com에 있는 대시보드는 api.example.net을 호출해요. API는 인증된 쓰기를 하기 전에 사전 확인을 거치고, 오직 배포 환경만 허용해요. Technical concept or control:교차 출처 리소스 공유 (CORS)。 Why it fits:브라우저 코드가 다른 출처를 읽어야 할 때 서버 또는 게이트웨이에서 CORS 설정。 Do not use it when:자격 증명이 있는 와일드카드 출처를 사용하거나 알 수 없는 출처를 반영하지 마세요. CORS는 인증이나 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):이 표준은 나열된 범위만 적용합니다. 시각적 스타일, 제품 결정, 또는 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.
이 요청을 확인하세요
Review how 교차 출처 리소스 공유 (CORS) is used now. Definition: CORS는 브라우저 HTTP 안전 규칙임. 서버는 어떤 다른 출처가 응답을 읽을 수 있는지 목록화함. 메서드, 헤더, 인증 정보를 제한할 수 있음. 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.