자동으로 생성된 함수 주석 파일(샌드박스 처리된 함수의 프로토타입을 제공하는 파일)은 Bazel 빌드 후 bazel-out/genfiles/sandboxed_api/examples/sum/lib/sum-sapi.sapi.h에서 찾을 수 있습니다.
내보낸 샌드박스 절차를 사용하는 실제 실행 로직 (호스트 코드라고도 함)은 main_sum.cc에서 확인할 수 있습니다.
zlib
이는 zlib 라이브러리의 데모 구현 (기능은 있지만 현재 프로덕션에서는 사용되지 않음)으로, 일부 함수를 내보내 호스트 코드에 제공합니다.
호스트 코드의 입증된 기능은 zlib 스트림을 stdin에서 stdout으로 디코딩하는 것입니다.
이 SAPI 라이브러리는 기본 Sandbox2 정책과 삽입된 SAPI 라이브러리를 사용하므로 sandbox.h 파일을 사용하지 않습니다. 따라서 sapi::Sandbox::GetLibPath() 또는 sapi::Sandbox::GetPolicy() 메서드를 제공할 필요가 없습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2023-12-06(UTC)"],[[["This page provides examples demonstrating how to implement Sandboxed API (SAPI) libraries."],["Examples include basic SAPI usage (`hello_sapi`), protobuf data exchange (`sum`), and sandboxed zlib functionality (`zlib`)."],["Google interns have created sandboxed versions of various open-source libraries, available on GitHub."],["Each example includes library code, sandbox definitions (if applicable), and host code for interaction."],["The `stringop` example showcases the use of protobufs for string operations and features a stricter sandbox policy."]]],[]]