detached d623483

chore: fix import ordering and add MinVersion to test TLS clients

commit
d623483b480b77214c9654a9bca2f61a6bcf8ea8
author
brice · · 2026-03-29 18:19 UTC
parent
32363a8
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
6 files · +15 -8
M internal/adapters/in/cli/ca.go +3 -2
@@ -9,10 +9,11 @@ import (
99 "path/filepath"
1010 "time"
1111
12- pkiadapter "github.com/bnema/gordon/internal/adapters/out/pki"
13- "github.com/bnema/gordon/internal/app"
1412 "github.com/bnema/zerowrap"
1513 "github.com/spf13/cobra"
14+
15+ pkiadapter "github.com/bnema/gordon/internal/adapters/out/pki"
16+ "github.com/bnema/gordon/internal/app"
1617 )
1718
1819 func newCACmd() *cobra.Command {
@@ -9,10 +9,11 @@ import (
9 "path/filepath"9 "path/filepath"
10 "time"10 "time"
11 11
12- pkiadapter "github.com/bnema/gordon/internal/adapters/out/pki"
13- "github.com/bnema/gordon/internal/app"
14 "github.com/bnema/zerowrap"12 "github.com/bnema/zerowrap"
15 "github.com/spf13/cobra"13 "github.com/spf13/cobra"
14+
15+ pkiadapter "github.com/bnema/gordon/internal/adapters/out/pki"
16+ "github.com/bnema/gordon/internal/app"
16 )17 )
17 18
18 func newCACmd() *cobra.Command {19 func newCACmd() *cobra.Command {
M internal/adapters/in/http/onboarding/handler_test.go +2 -1
@@ -5,8 +5,9 @@ import (
55 "net/http/httptest"
66 "testing"
77
8- "github.com/bnema/gordon/internal/adapters/in/http/onboarding"
98 "github.com/stretchr/testify/assert"
9+
10+ "github.com/bnema/gordon/internal/adapters/in/http/onboarding"
1011 )
1112
1213 func TestHandler_CACert(t *testing.T) {
@@ -5,8 +5,9 @@ import (
5 "net/http/httptest"5 "net/http/httptest"
6 "testing"6 "testing"
7 7
8- "github.com/bnema/gordon/internal/adapters/in/http/onboarding"
9 "github.com/stretchr/testify/assert"8 "github.com/stretchr/testify/assert"
9+
10+ "github.com/bnema/gordon/internal/adapters/in/http/onboarding"
10 )11 )
11 12
12 func TestHandler_CACert(t *testing.T) {13 func TestHandler_CACert(t *testing.T) {
M internal/adapters/out/pki/mobileconfig_test.go +2 -1
@@ -4,9 +4,10 @@ import (
44 "strings"
55 "testing"
66
7- "github.com/bnema/gordon/internal/adapters/out/pki"
87 "github.com/stretchr/testify/assert"
98 "github.com/stretchr/testify/require"
9+
10+ "github.com/bnema/gordon/internal/adapters/out/pki"
1011 )
1112
1213 func TestGenerateMobileconfig(t *testing.T) {
@@ -4,9 +4,10 @@ import (
4 "strings"4 "strings"
5 "testing"5 "testing"
6 6
7- "github.com/bnema/gordon/internal/adapters/out/pki"
8 "github.com/stretchr/testify/assert"7 "github.com/stretchr/testify/assert"
9 "github.com/stretchr/testify/require"8 "github.com/stretchr/testify/require"
9+
10+ "github.com/bnema/gordon/internal/adapters/out/pki"
10 )11 )
11 12
12 func TestGenerateMobileconfig(t *testing.T) {13 func TestGenerateMobileconfig(t *testing.T) {
M internal/app/pki_integration_test.go +2 -0
@@ -62,6 +62,7 @@ func TestTLSHandshake_OnDemandCert(t *testing.T) {
6262 client := &http.Client{
6363 Transport: &http.Transport{
6464 TLSClientConfig: &tls.Config{
65+ MinVersion: tls.VersionTLS12,
6566 RootCAs: rootPool,
6667 ServerName: "test.local",
6768 },
@@ -108,6 +109,7 @@ func TestTLSHandshake_UnknownDomain_Rejected(t *testing.T) {
108109 client := &http.Client{
109110 Transport: &http.Transport{
110111 TLSClientConfig: &tls.Config{
112+ MinVersion: tls.VersionTLS12,
111113 RootCAs: rootPool,
112114 ServerName: "unknown.local", // not in route table
113115 },
@@ -62,6 +62,7 @@ func TestTLSHandshake_OnDemandCert(t *testing.T) {
62 client := &http.Client{62 client := &http.Client{
63 Transport: &http.Transport{63 Transport: &http.Transport{
64 TLSClientConfig: &tls.Config{64 TLSClientConfig: &tls.Config{
65+ MinVersion: tls.VersionTLS12,
65 RootCAs: rootPool,66 RootCAs: rootPool,
66 ServerName: "test.local",67 ServerName: "test.local",
67 },68 },
@@ -108,6 +109,7 @@ func TestTLSHandshake_UnknownDomain_Rejected(t *testing.T) {
108 client := &http.Client{109 client := &http.Client{
109 Transport: &http.Transport{110 Transport: &http.Transport{
110 TLSClientConfig: &tls.Config{111 TLSClientConfig: &tls.Config{
112+ MinVersion: tls.VersionTLS12,
111 RootCAs: rootPool,113 RootCAs: rootPool,
112 ServerName: "unknown.local", // not in route table114 ServerName: "unknown.local", // not in route table
113 },115 },
M internal/usecase/pki/service.go +2 -1
@@ -7,9 +7,10 @@ import (
77 "sync"
88 "time"
99
10+ "github.com/bnema/zerowrap"
11+
1012 "github.com/bnema/gordon/internal/boundaries/out"
1113 "github.com/bnema/gordon/internal/domain"
12- "github.com/bnema/zerowrap"
1314 )
1415
1516 const (
@@ -7,9 +7,10 @@ import (
7 "sync"7 "sync"
8 "time"8 "time"
9 9
10+ "github.com/bnema/zerowrap"
11+
10 "github.com/bnema/gordon/internal/boundaries/out"12 "github.com/bnema/gordon/internal/boundaries/out"
11 "github.com/bnema/gordon/internal/domain"13 "github.com/bnema/gordon/internal/domain"
12- "github.com/bnema/zerowrap"
13 )14 )
14 15
15 const (16 const (
M internal/usecase/pki/service_test.go +4 -3
@@ -5,12 +5,13 @@ import (
55 "crypto/tls"
66 "testing"
77
8- pkiadapter "github.com/bnema/gordon/internal/adapters/out/pki"
9- "github.com/bnema/gordon/internal/domain"
10- pkiusecase "github.com/bnema/gordon/internal/usecase/pki"
118 "github.com/bnema/zerowrap"
129 "github.com/stretchr/testify/assert"
1310 "github.com/stretchr/testify/require"
11+
12+ pkiadapter "github.com/bnema/gordon/internal/adapters/out/pki"
13+ "github.com/bnema/gordon/internal/domain"
14+ pkiusecase "github.com/bnema/gordon/internal/usecase/pki"
1415 )
1516
1617 // stubConfigService satisfies pkiusecase.RouteChecker
@@ -5,12 +5,13 @@ import (
5 "crypto/tls"5 "crypto/tls"
6 "testing"6 "testing"
7 7
8- pkiadapter "github.com/bnema/gordon/internal/adapters/out/pki"
9- "github.com/bnema/gordon/internal/domain"
10- pkiusecase "github.com/bnema/gordon/internal/usecase/pki"
11 "github.com/bnema/zerowrap"8 "github.com/bnema/zerowrap"
12 "github.com/stretchr/testify/assert"9 "github.com/stretchr/testify/assert"
13 "github.com/stretchr/testify/require"10 "github.com/stretchr/testify/require"
11+
12+ pkiadapter "github.com/bnema/gordon/internal/adapters/out/pki"
13+ "github.com/bnema/gordon/internal/domain"
14+ pkiusecase "github.com/bnema/gordon/internal/usecase/pki"
14 )15 )
15 16
16 // stubConfigService satisfies pkiusecase.RouteChecker17 // stubConfigService satisfies pkiusecase.RouteChecker

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close