@@ -550,11 +550,57 @@ func buildAteomEgressPolicyRules(rules []*ateletpb.EgressPolicyRule) []*ateompb.
550550 Protocol : port .GetProtocol (),
551551 })
552552 }
553+ outRule .Tls = buildAteomEgressTLSPolicy (rule .GetTls ())
554+ outRule .Credentials = buildAteomEgressCredentialPolicy (rule .GetCredentials ())
553555 out = append (out , outRule )
554556 }
555557 return out
556558}
557559
560+ func buildAteomEgressTLSPolicy (policy * ateletpb.EgressTLSPolicy ) * ateompb.EgressTLSPolicy {
561+ if policy == nil {
562+ return nil
563+ }
564+ out := & ateompb.EgressTLSPolicy {
565+ Mode : policy .GetMode (),
566+ Required : policy .GetRequired (),
567+ }
568+ if policy .GetIntercept () != nil {
569+ out .Intercept = & ateompb.EgressTLSInterceptPolicy {
570+ ValidateUpstream : policy .GetIntercept ().GetValidateUpstream (),
571+ }
572+ if policy .GetIntercept ().GetIssuerSecretRef () != nil {
573+ out .Intercept .IssuerSecretRef = & ateompb.SecretReference {
574+ Name : policy .GetIntercept ().GetIssuerSecretRef ().GetName (),
575+ Namespace : policy .GetIntercept ().GetIssuerSecretRef ().GetNamespace (),
576+ }
577+ }
578+ }
579+ return out
580+ }
581+
582+ func buildAteomEgressCredentialPolicy (policy * ateletpb.EgressCredentialPolicy ) * ateompb.EgressCredentialPolicy {
583+ if policy == nil {
584+ return nil
585+ }
586+ out := & ateompb.EgressCredentialPolicy {}
587+ for _ , injection := range policy .GetInject () {
588+ outInjection := & ateompb.EgressCredentialInjection {
589+ Header : injection .GetHeader (),
590+ }
591+ if injection .GetValueFrom ().GetSecretKeyRef () != nil {
592+ outInjection .ValueFrom = & ateompb.EgressCredentialValueFrom {
593+ SecretKeyRef : & ateompb.SecretKeySelector {
594+ Name : injection .GetValueFrom ().GetSecretKeyRef ().GetName (),
595+ Key : injection .GetValueFrom ().GetSecretKeyRef ().GetKey (),
596+ },
597+ }
598+ }
599+ out .Inject = append (out .Inject , outInjection )
600+ }
601+ return out
602+ }
603+
558604// uploadIfExists uploads a local file to GCS (zstd-compressed) only if
559605// the file is present. Missing files are silently skipped — used for
560606// optional checkpoint side-files (pages.img, pages_meta.img).
0 commit comments