Skip to content

Commit

Permalink
Log in CTL client not API handler
Browse files Browse the repository at this point in the history
Removes CTL related logging from the API handler and pushes it
over to the CTL client.

Signed-off-by: Nathan Smith <nathan@nfsmith.ca>
  • Loading branch information
nsmith5 committed Jan 28, 2022
1 parent 0cf0977 commit 21d9b11
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions cmd/app/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ func runServeCmd(cmd *cobra.Command, args []string) {
var ctClient ctl.Client
if logURL := viper.GetString("ct-log-url"); logURL != "" {
ctClient = ctl.New(logURL)
ctClient = ctl.WithLogging(ctClient, log.Logger)
}

var handler http.Handler
Expand Down
3 changes: 0 additions & 3 deletions pkg/api/ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ func (a *api) signingCert(w http.ResponseWriter, req *http.Request) {
}

// Submit to CTL
logger.Info("Submitting CTL inclusion for OIDC grant: ", subject.Value)
if a.ct != nil {
sct, err := a.ct.AddChain(csc)
if err != nil {
Expand All @@ -186,8 +185,6 @@ func (a *api) signingCert(w http.ResponseWriter, req *http.Request) {
handleFulcioAPIError(w, req, http.StatusInternalServerError, err, failedToMarshalSCT)
return
}
logger.Info("CTL Submission Signature Received: ", sct.Signature)
logger.Info("CTL Submission ID Received: ", sct.ID)
} else {
logger.Info("Skipping CT log upload.")
}
Expand Down

0 comments on commit 21d9b11

Please sign in to comment.