| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 4 | 4 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 0 | 3 | 1 | 0% |
What each file covers
Sections
0 shared · 4 only in A · 4 only in B- − gRPC C++ Agents Collaboration Guide
- − Preferred Tools & Libraries
- − Code Style & Conventions
- − About gRPC
- + Transport Security Interface (TSI)
- + Overarching Purpose
- + Files and Subdirectories
- + Notes
Commands
neither file has anySection tags
0 shared · 3 only in A · 1 only in B- − code-style
- − dependencies
- − do-not
- + security
Line diff
grpc/grpc · AGENTS.md
@@ −1 @@
1# gRPC C++ Agents Collaboration Guide
2
3This document outlines conventions and best practices for AI-assisted development in the gRPC C++ codebase.
4
5## Preferred Tools & Libraries
6* Prefer gRPC types before absl.
7* Prefer std types when available, use absl types when not
8* Prefer `std::optional` over `absl::optional`
9* gRPC uses C++17, so we can't use C++20 onwards types.
10* The Python implementation cannot depend on the protobuf library, so any shared libraries must expose a C-style API that does not rely on C++ protobuf types.
11
12## Code Style & Conventions
13* `#include <grpc/support/port_platform.h>` is not required unless its macros are needed for compilation.
14* Only include headers that are actively used.
15* Abseil headers are sorted before gRPC headers.
16* For public api headers (in `include/grpc`) we use `<grpc/...>`.
17 * Example: `#include <grpc/grpc.h>`
18* Prefer explicit types over `std::pair` or `std::tuple` for return types.
19* Use `LOG(ERROR)` from `absl/log/log.h` for logging errors, never use `std::cerr` or `gpr_log`.
20* The `fuzztest.h` header is located at `fuzztest/fuzztest.h`.
21
22## About gRPC
23* gRPC uses its own macros for Bazel libraries, tests, etc. Each directory should have a `grpc_package` declaration. For libraries use `grpc_cc_library`, for tests `grpc_cc_test`.
24* Dependencies on non-gRPC libraries (like gtest or absl) are listed in the `external_deps` attribute.
25* The `:grpc` BUILD target is not allowed to depend on the C++ protobuf library, either directly or transitively.
26* Build files for implementation code are typically located in `src/core/BUILD` and `BUILD`. Do not add new `BUILD` files under the `src/` tree without explicit instruction.
27* Tests are located in `test/core` and `test/cpp` (corresponding to the `src` directories). These test directories contain their own `BUILD` files.
28* Fuzz tests use `fuzztest_main` instead of `gtest_main`.
29* When depending on a `grpc_proto_library`, the name of the `cc_library` target is the same as the `name` of the `grpc_proto_library` rule itself, not `[name]_cc_proto` as one might expect from standard Bazel `cc_proto_library` rules. The build system error messages can be misleading in this case.
30* The 'gtest' external_dep also includes 'gmock'.
31* All `upb` related build rules (`grpc_upb_proto_library`, `grpc_upb_proto_reflection_library`) for protos defined anywhere in the repository must be defined in the root `BUILD` file. They should not be placed in the `BUILD` file of the subdirectory where the proto is located.
32* Core end-to-end tests are defined in `test/core/end2end/BUILD` using the `grpc_core_end2end_test_suite` macro. This macro generates multiple `grpc_cc_test` targets by combining a configuration file (like `end2end_http2_config.cc`) with individual test implementation files located in `test/core/end2end/tests/`. The final test target name is created by appending `_test` to the `name` attribute of the macro. For example, `grpc_core_end2end_test_suite(name = "end2end_http2", ...)` generates the test target `//test/core/end2end:end2end_http2_test`.
33* Unused named parameters is a compilation failure.
34
grpc/grpc · src/core/tsi/AGENTS.md
@@ +1 @@
1# Transport Security Interface (TSI)
2
3This directory contains the implementation of gRPC's Transport Security Interface (TSI), which is an abstraction for different transport security mechanisms like TLS and ALTS.
4
5## Overarching Purpose
6
7TSI provides a unified interface for performing transport-level security handshakes and protecting data. This allows gRPC to support different security mechanisms without having to change the core transport code.
8
9## Files and Subdirectories
10
11- **`transport_security_interface.h`**: Defines the core `tsi_handshaker` and `tsi_frame_protector` interfaces.
12- **`transport_security.h` / `transport_security.cc`**: Defines the `tsi_transport_security` interface, which is a higher-level abstraction that combines the `tsi_handshaker` and `tsi_frame_protector` interfaces.
13- **`transport_security_grpc.h` / `transport_security_grpc.cc`**: Provides a gRPC-specific implementation of the `tsi_transport_security` interface.
14- **`ssl/`**: An implementation of TSI that uses OpenSSL.
15- **`alts/`**: An implementation of TSI that uses ALTS.
16- **`fake_transport_security.h` / `fake_transport_security.cc`**: A fake implementation of TSI for testing.
17- **`local_transport_security.h` / `local_transport_security.cc`**: An implementation of TSI for local (e.g., UDS) connections.
18
19## Notes
20
21- TSI is a key component of gRPC's security infrastructure.
22- It provides a flexible and extensible way to add new security mechanisms to gRPC.
23- The TSI interfaces are designed to be simple and easy to implement, which makes it easy to add support for new security mechanisms.
24
@@ −1 +1 @@
1−# gRPC C++ Agents Collaboration Guide
1+# Transport Security Interface (TSI)
22
3−This document outlines conventions and best practices for AI-assisted development in the gRPC C++ codebase.
3+This directory contains the implementation of gRPC's Transport Security Interface (TSI), which is an abstraction for different transport security mechanisms like TLS and ALTS.
44
5−## Preferred Tools & Libraries
6−* Prefer gRPC types before absl.
7−* Prefer std types when available, use absl types when not
8−* Prefer `std::optional` over `absl::optional`
9−* gRPC uses C++17, so we can't use C++20 onwards types.
10−* The Python implementation cannot depend on the protobuf library, so any shared libraries must expose a C-style API that does not rely on C++ protobuf types.
5+## Overarching Purpose
116
12−## Code Style & Conventions
13−* `#include <grpc/support/port_platform.h>` is not required unless its macros are needed for compilation.
14−* Only include headers that are actively used.
15−* Abseil headers are sorted before gRPC headers.
16−* For public api headers (in `include/grpc`) we use `<grpc/...>`.
17− * Example: `#include <grpc/grpc.h>`
18−* Prefer explicit types over `std::pair` or `std::tuple` for return types.
19−* Use `LOG(ERROR)` from `absl/log/log.h` for logging errors, never use `std::cerr` or `gpr_log`.
20−* The `fuzztest.h` header is located at `fuzztest/fuzztest.h`.
7+TSI provides a unified interface for performing transport-level security handshakes and protecting data. This allows gRPC to support different security mechanisms without having to change the core transport code.
218
22−## About gRPC
23−* gRPC uses its own macros for Bazel libraries, tests, etc. Each directory should have a `grpc_package` declaration. For libraries use `grpc_cc_library`, for tests `grpc_cc_test`.
24−* Dependencies on non-gRPC libraries (like gtest or absl) are listed in the `external_deps` attribute.
25−* The `:grpc` BUILD target is not allowed to depend on the C++ protobuf library, either directly or transitively.
26−* Build files for implementation code are typically located in `src/core/BUILD` and `BUILD`. Do not add new `BUILD` files under the `src/` tree without explicit instruction.
27−* Tests are located in `test/core` and `test/cpp` (corresponding to the `src` directories). These test directories contain their own `BUILD` files.
28−* Fuzz tests use `fuzztest_main` instead of `gtest_main`.
29−* When depending on a `grpc_proto_library`, the name of the `cc_library` target is the same as the `name` of the `grpc_proto_library` rule itself, not `[name]_cc_proto` as one might expect from standard Bazel `cc_proto_library` rules. The build system error messages can be misleading in this case.
30−* The 'gtest' external_dep also includes 'gmock'.
31−* All `upb` related build rules (`grpc_upb_proto_library`, `grpc_upb_proto_reflection_library`) for protos defined anywhere in the repository must be defined in the root `BUILD` file. They should not be placed in the `BUILD` file of the subdirectory where the proto is located.
32−* Core end-to-end tests are defined in `test/core/end2end/BUILD` using the `grpc_core_end2end_test_suite` macro. This macro generates multiple `grpc_cc_test` targets by combining a configuration file (like `end2end_http2_config.cc`) with individual test implementation files located in `test/core/end2end/tests/`. The final test target name is created by appending `_test` to the `name` attribute of the macro. For example, `grpc_core_end2end_test_suite(name = "end2end_http2", ...)` generates the test target `//test/core/end2end:end2end_http2_test`.
33−* Unused named parameters is a compilation failure.
9+## Files and Subdirectories
10+
11+- **`transport_security_interface.h`**: Defines the core `tsi_handshaker` and `tsi_frame_protector` interfaces.
12+- **`transport_security.h` / `transport_security.cc`**: Defines the `tsi_transport_security` interface, which is a higher-level abstraction that combines the `tsi_handshaker` and `tsi_frame_protector` interfaces.
13+- **`transport_security_grpc.h` / `transport_security_grpc.cc`**: Provides a gRPC-specific implementation of the `tsi_transport_security` interface.
14+- **`ssl/`**: An implementation of TSI that uses OpenSSL.
15+- **`alts/`**: An implementation of TSI that uses ALTS.
16+- **`fake_transport_security.h` / `fake_transport_security.cc`**: A fake implementation of TSI for testing.
17+- **`local_transport_security.h` / `local_transport_security.cc`**: An implementation of TSI for local (e.g., UDS) connections.
18+
19+## Notes
20+
21+- TSI is a key component of gRPC's security infrastructure.
22+- It provides a flexible and extensible way to add new security mechanisms to gRPC.
23+- The TSI interfaces are designed to be simple and easy to implement, which makes it easy to add support for new security mechanisms.
3424
