File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ func (d *DryccCmd) TLSInfo(appID string) error {
2626 tls .Owner ,
2727 fmt .Sprintf ("%v" , tls .CertsAutoEnabled != nil && * (tls .CertsAutoEnabled )),
2828 fmt .Sprintf ("%v" , tls .HTTPSEnforced != nil && * (tls .HTTPSEnforced )),
29- "" ,
30- "" ,
29+ safeGetString ( "" ) ,
30+ safeGetString ( "" ) ,
3131 }
3232 if tls .Issuer != nil {
33- data [3 ] = tls .Issuer .Email
34- data [4 ] = tls .Issuer .Server
33+ data [4 ] = safeGetString ( tls .Issuer .Email )
34+ data [5 ] = safeGetString ( tls .Issuer .Server )
3535 }
3636 table .Append (data )
3737 table .Render ()
Original file line number Diff line number Diff line change @@ -30,14 +30,20 @@ func TestTLSInfo(t *testing.T) {
3030 "created": "2016-08-22T17:40:16Z",
3131 "updated": "2016-08-22T17:40:16Z",
3232 "https_enforced": true,
33- "certs_auto_enabled": false
33+ "certs_auto_enabled": true,
34+ "issuer": {
35+ "server": "https://acme.zerossl.com/v2/DV90",
36+ "email": "drycc@drycc.cc",
37+ "key_id": "AA",
38+ "key_secret": "BB"
39+ }
3440}` )
3541 })
3642
3743 err = cmdr .TLSInfo ("numenor" )
3844 assert .NoError (t , err )
39- assert .Equal (t , b .String (), `UUID OWNER CERTS-AUTO HTTPS-ENFORCED EMAIL SERVER
40- c4aed81c-d1ca-4ff1-ab89-d2151264e1a3 nazgul false true
45+ assert .Equal (t , b .String (), `UUID OWNER CERTS-AUTO HTTPS-ENFORCED EMAIL SERVER
46+ c4aed81c-d1ca-4ff1-ab89-d2151264e1a3 nazgul true true drycc@drycc.cc https://acme.zerossl.com/v2/DV90
4147` , "output" )
4248}
4349
You can’t perform that action at this time.
0 commit comments