@@ -77,27 +77,27 @@ var _ = Describe("Identity-Aware Routing", func() {
7777 testState .StartGorouterOrFail ()
7878 })
7979
80- It ("requires a client certificate" , func () {
81- // Register route on mTLS domain
82- testState .register (backendApp , mtlsDomain )
83-
84- // Attempt request without client certificate
85- req , client := testState .newMtlsGetRequest (fmt .Sprintf ("https://%s" , mtlsDomain ))
86- _ , err := client .Do (req )
87- Expect (err ).To (HaveOccurred ())
88- Expect (err .Error ()).To (ContainSubstring ("tls" ))
89- })
80+ It ("requires a client certificate" , func () {
81+ // Register route on mTLS domain
82+ testState .register (backendApp , mtlsDomain )
83+
84+ // Attempt request without client certificate
85+ req , client := testState .newMtlsGetRequest (fmt .Sprintf ("https://%s" , mtlsDomain ))
86+ _ , err := client .Do (req )
87+ Expect (err ).To (HaveOccurred ())
88+ Expect (err .Error ()).To (ContainSubstring ("tls" ))
89+ })
9090
9191 It ("accepts valid client certificate from the configured CA" , func () {
9292 // Create instance identity certificate (need to use the same CA!)
9393 appInstanceCert = & test_util.CertChain {}
9494 // Recreate with SAME CA as configured in GoRouter
95- * appInstanceCert = test_util .CreateInstanceIdentityCertWithCA (test_util.InstanceIdentityCertNames {
96- CommonName : "app-instance" ,
97- AppGUID : "app-guid-123" ,
98- SpaceGUID : "space-guid-456" ,
99- OrgGUID : "org-guid-789" ,
100- }, mtlsDomainCA )
95+ * appInstanceCert = test_util .CreateInstanceIdentityCertWithCA (test_util.InstanceIdentityCertNames {
96+ CommonName : "app-instance" ,
97+ AppGUID : "app-guid-123" ,
98+ SpaceGUID : "space-guid-456" ,
99+ OrgGUID : "org-guid-789" ,
100+ }, mtlsDomainCA )
101101
102102 // Register route on mTLS domain with allowed sources
103103 testState .registerWithAccessRules (
@@ -115,13 +115,13 @@ var _ = Describe("Identity-Aware Routing", func() {
115115 appInstanceCert .TLSCert (),
116116 },
117117 }
118- testState .client .Transport .(* http.Transport ).TLSClientConfig = clientTLSConfig
118+ testState .client .Transport .(* http.Transport ).TLSClientConfig = clientTLSConfig
119119
120- // Make request
121- req , client := testState .newMtlsGetRequest (fmt .Sprintf ("https://%s" , mtlsDomain ))
122- resp , err := client .Do (req )
123- Expect (err ).NotTo (HaveOccurred ())
124- Expect (resp .StatusCode ).To (Equal (http .StatusOK ))
120+ // Make request
121+ req , client := testState .newMtlsGetRequest (fmt .Sprintf ("https://%s" , mtlsDomain ))
122+ resp , err := client .Do (req )
123+ Expect (err ).NotTo (HaveOccurred ())
124+ Expect (resp .StatusCode ).To (Equal (http .StatusOK ))
125125
126126 body , _ := io .ReadAll (resp .Body )
127127 resp .Body .Close ()
@@ -132,11 +132,11 @@ var _ = Describe("Identity-Aware Routing", func() {
132132 })
133133
134134 It ("rejects client certificate from unknown CA" , func () {
135- // Create certificate from different CA (not the configured mtlsDomainCA)
136- unknownCert := test_util .CreateInstanceIdentityCert (test_util.InstanceIdentityCertNames {
137- CommonName : "app-instance" ,
138- AppGUID : "app-guid-123" ,
139- })
135+ // Create certificate from different CA (not the configured mtlsDomainCA)
136+ unknownCert := test_util .CreateInstanceIdentityCert (test_util.InstanceIdentityCertNames {
137+ CommonName : "app-instance" ,
138+ AppGUID : "app-guid-123" ,
139+ })
140140
141141 // Register route
142142 testState .register (backendApp , mtlsDomain )
@@ -249,13 +249,13 @@ var _ = Describe("Identity-Aware Routing", func() {
249249 },
250250 )
251251
252- // Create caller certificate
253- callerCert := test_util .CreateInstanceIdentityCertWithCA (test_util.InstanceIdentityCertNames {
254- CommonName : "caller-app-instance" ,
255- AppGUID : callerAppGUID ,
256- SpaceGUID : "caller-space-guid" ,
257- OrgGUID : "caller-org-guid" ,
258- }, mtlsDomainCA )
252+ // Create caller certificate
253+ callerCert := test_util .CreateInstanceIdentityCertWithCA (test_util.InstanceIdentityCertNames {
254+ CommonName : "caller-app-instance" ,
255+ AppGUID : callerAppGUID ,
256+ SpaceGUID : "caller-space-guid" ,
257+ OrgGUID : "caller-org-guid" ,
258+ }, mtlsDomainCA )
259259
260260 // Configure client
261261 testState .client .Transport .(* http.Transport ).TLSClientConfig .Certificates = []tls.Certificate {
0 commit comments