tls_factory.go ×22

Frontier kind: Code frontier

unlabeled · c_219dbe6ea787

23 tests · 1804 LOC · 76 files · introduces 0 tests · 28 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
22 ranges28 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
258 ranges1804 lines · 76 files · Browse complete extent
All tests (intent)
23 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 28 introduced LOC across 22 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/rpc/encryption/tls_factory.go 28 introduced LOC · 22 ranges

Open complete file

76 }
77
78 > func validateRootTLS(cfg *config.RootTLS) error { tls_factory.go
79 > if err := validateGroupTLS(&cfg.Internode); err != nil {
80 return err
81 }
82 > if err := validateGroupTLS(&cfg.Frontend); err != nil { tls_factory.go
83 return err
84 }
85 > return validateWorkerTLS(&cfg.SystemWorker) tls_factory.go
86 }
87
88 > func validateGroupTLS(cfg *config.GroupTLS) error { tls_factory.go
89 > if err := validateServerTLS(&cfg.Server); err != nil {
90 return err
91 }
92 > if err := validateClientTLS(&cfg.Client); err != nil { tls_factory.go
93 return err
94 }
95 > for host, hostConfig := range cfg.PerHostOverrides { tls_factory.go
96
97 if strings.TrimSpace(host) == "" {
102 }
103 }
104 > return nil tls_factory.go
105 }
106
107 > func validateWorkerTLS(cfg *config.WorkerTLS) error { tls_factory.go
108 > if cfg.CertFile != "" && cfg.CertData != "" {
109 return fmt.Errorf("cannot specify CertFile and CertData at the same time")
110 }
111 > if cfg.KeyFile != "" && cfg.KeyData != "" { tls_factory.go
112 return fmt.Errorf("cannot specify KeyFile and KeyData at the same time")
113 }
114 > return validateClientTLS(&cfg.Client) tls_factory.go
115 }
116
117 > func validateServerTLS(cfg *config.ServerTLS) error { tls_factory.go
118 > if cfg.CertFile != "" && cfg.CertData != "" {
119 return fmt.Errorf("cannot specify CertFile and CertData at the same time")
120 }
121 > if cfg.KeyFile != "" && cfg.KeyData != "" { tls_factory.go
122 return fmt.Errorf("cannot specify KeyFile and KeyData at the same time")
123 }
124 > if err := validateCAs(cfg.ClientCAData); err != nil { tls_factory.go
125 return fmt.Errorf("invalid ServerTLS.ClientCAData: %w", err)
126 }
127 > if err := validateCAs(cfg.ClientCAFiles); err != nil { tls_factory.go
128 return fmt.Errorf("invalid ServerTLS.ClientCAFiles: %w", err)
129 }
130 > if len(cfg.ClientCAFiles) > 0 && len(cfg.ClientCAData) > 0 { tls_factory.go
131 return fmt.Errorf("cannot specify ClientCAFiles and ClientCAData at the same time")
132 }
133 > return nil tls_factory.go
134 }
135
136 > func validateClientTLS(cfg *config.ClientTLS) error { tls_factory.go
137 > if err := validateCAs(cfg.RootCAData); err != nil {
138 return fmt.Errorf("invalid ClientTLS.RootCAData: %w", err)
139 }
140 > if err := validateCAs(cfg.RootCAFiles); err != nil { tls_factory.go
141 return fmt.Errorf("invalid ClientTLS.RootCAFiles: %w", err)
142 }
143 > if len(cfg.RootCAData) > 0 && len(cfg.RootCAFiles) > 0 { tls_factory.go
144 return fmt.Errorf("cannot specify RootCAFiles and RootCAData at the same time")
145 }
146 > return nil tls_factory.go
147 }
148
149 > func validateCAs(cas []string) error { tls_factory.go
150 > for _, ca := range cas {
151 if strings.TrimSpace(ca) == "" {
152 return fmt.Errorf("CA cannot be empty string")
153 }
154 }
155 > return nil tls_factory.go
156 }