We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent0288e73 commitd734f3fCopy full SHA for d734f3f
coderd/azureidentity/azureidentity_test.go
@@ -53,15 +53,17 @@ func TestValidate(t *testing.T) {
53
54
funcTestExpiresSoon(t*testing.T) {
55
t.Parallel()
56
+constthreshold=2
57
+
58
for_,c:=rangeazureidentity.Certificates {
59
block,rest:=pem.Decode([]byte(c))
60
require.Zero(t,len(rest))
61
cert,err:=x509.ParseCertificate(block.Bytes)
62
require.NoError(t,err)
63
-expiresSoon:=cert.NotAfter.Before(time.Now().AddDate(0,3,0))
64
+expiresSoon:=cert.NotAfter.Before(time.Now().AddDate(0,threshold,0))
65
ifexpiresSoon {
-t.Errorf("certificate expires within6 months %s: %s",cert.NotAfter,cert.Subject.CommonName)
66
+t.Errorf("certificate expires within%d months %s: %s",threshold,cert.NotAfter,cert.Subject.CommonName)
67
}else {
68
url:="no issuing url"
69
iflen(cert.IssuingCertificateURL)>0 {