소스 검색

gofmted the code

dharanikumar-s 6 년 전
부모
커밋
a3b5211e0f
2개의 변경된 파일과 3개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 1
      api/api_test.go
  2. 2 4
      api/rekey.go

+ 1 - 1
api/api_test.go

@@ -551,7 +551,7 @@ type mockAuthority struct {
 	getTLSOptions                func() *tlsutil.TLSOptions
 	getTLSOptions                func() *tlsutil.TLSOptions
 	root                         func(shasum string) (*x509.Certificate, error)
 	root                         func(shasum string) (*x509.Certificate, error)
 	sign                         func(cr *x509.CertificateRequest, opts provisioner.Options, signOpts ...provisioner.SignOption) ([]*x509.Certificate, error)
 	sign                         func(cr *x509.CertificateRequest, opts provisioner.Options, signOpts ...provisioner.SignOption) ([]*x509.Certificate, error)
-	renew			     func(cert *x509.Certificate) ([]*x509.Certificate, error)
+	renew                        func(cert *x509.Certificate) ([]*x509.Certificate, error)
 	renewOrRekey                 func(oldCert *x509.Certificate, pk crypto.PublicKey) ([]*x509.Certificate, error)
 	renewOrRekey                 func(oldCert *x509.Certificate, pk crypto.PublicKey) ([]*x509.Certificate, error)
 	loadProvisionerByCertificate func(cert *x509.Certificate) (provisioner.Interface, error)
 	loadProvisionerByCertificate func(cert *x509.Certificate) (provisioner.Interface, error)
 	loadProvisionerByID          func(provID string) (provisioner.Interface, error)
 	loadProvisionerByID          func(provID string) (provisioner.Interface, error)

+ 2 - 4
api/rekey.go

@@ -8,7 +8,7 @@ import (
 
 
 // RekeyRequest is the request body for a certificate rekey request.
 // RekeyRequest is the request body for a certificate rekey request.
 type RekeyRequest struct {
 type RekeyRequest struct {
-	CsrPEM    CertificateRequest `json:"csr"`
+	CsrPEM CertificateRequest `json:"csr"`
 }
 }
 
 
 // Validate checks the fields of the RekeyRequest and returns nil if they are ok
 // Validate checks the fields of the RekeyRequest and returns nil if they are ok
@@ -24,7 +24,6 @@ func (s *RekeyRequest) Validate() error {
 	return nil
 	return nil
 }
 }
 
 
-
 // Rekey is similar to renew except that the certificate will be renewed with new key from csr.
 // Rekey is similar to renew except that the certificate will be renewed with new key from csr.
 func (h *caHandler) Rekey(w http.ResponseWriter, r *http.Request) {
 func (h *caHandler) Rekey(w http.ResponseWriter, r *http.Request) {
 
 
@@ -39,13 +38,12 @@ func (h *caHandler) Rekey(w http.ResponseWriter, r *http.Request) {
 		return
 		return
 	}
 	}
 
 
-
 	if err := body.Validate(); err != nil {
 	if err := body.Validate(); err != nil {
 		WriteError(w, err)
 		WriteError(w, err)
 		return
 		return
 	}
 	}
 
 
-	certChain, err := h.Authority.RenewOrRekey(r.TLS.PeerCertificates[0],body.CsrPEM.CertificateRequest.PublicKey)
+	certChain, err := h.Authority.RenewOrRekey(r.TLS.PeerCertificates[0], body.CsrPEM.CertificateRequest.PublicKey)
 	if err != nil {
 	if err != nil {
 		WriteError(w, errs.Wrap(http.StatusInternalServerError, err, "cahandler.Rekey"))
 		WriteError(w, errs.Wrap(http.StatusInternalServerError, err, "cahandler.Rekey"))
 		return
 		return