mirror of
https://github.com/hanzozt/zt.git
synced 2026-10-30 15:04:55 +00:00
The defaults behind every certificate subject named upstream's organization, a development unit and an invented city and state, so the CAs, servers, clients and routers the bootstrap mints all carried them. They now read O=Hanzo AI, OU=ZT, C=US and leave ST and L unset. A router put an unset attribute into its CSR as an empty value, which is not a DirectoryString (RFC 5280 4.1.2.4); it now leaves it out. And `pki create` read the province from a key its flag was never bound to, so --pki-province did nothing. Claude-Session: https://claude.ai/code/session_01HuMDfgFssPUptYUzgZ6Cp8
14 lines
329 B
Go
14 lines
329 B
Go
package enroll
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hanzozt/zt/v2/router/env"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestCsrSubjectLeavesOutUnset(t *testing.T) {
|
|
c := &env.Csr{Country: "US", Organization: "Hanzo AI", OrganizationalUnit: "ZT"}
|
|
require.Equal(t, "CN=r,OU=ZT,O=Hanzo AI,C=US", csrSubject("r", c).String())
|
|
}
|