Skip to content

Commit 71e7a17

Browse files
committed
docs(providers): note profile DTO sync contract
1 parent db347a0 commit 71e7a17

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

crates/openshell-providers/src/profiles.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ pub struct CredentialProfile {
8686
pub query_param: String,
8787
}
8888

89+
// These YAML/JSON DTOs mirror the network policy protos intentionally. Keep
90+
// every lossless conversion below in sync with proto/sandbox.proto. If a field
91+
// is added to NetworkEndpoint, L7Rule, L7Allow, L7DenyRule, L7QueryMatcher,
92+
// GraphqlOperation, or NetworkBinary, add it here and in both conversion
93+
// directions unless the import/lint path explicitly rejects it.
8994
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
9095
pub struct EndpointProfile {
9196
pub host: String,
@@ -207,6 +212,10 @@ pub struct ProviderTypeProfile {
207212
pub inference_capable: bool,
208213
}
209214

215+
// Provider profile import/export is expected to be lossless for the network
216+
// policy fields exposed by the protobuf API. Do not collapse these DTOs into a
217+
// narrower shape; direct gRPC imports and CLI YAML imports must preserve the
218+
// same policy intent through storage and JIT composition.
210219
impl ProviderTypeProfile {
211220
#[must_use]
212221
pub fn from_proto(profile: &ProviderProfile) -> Self {

0 commit comments

Comments
 (0)