add info log for successfull authorizations (#1804)

This commit is contained in:
Bryan White 2019-04-25 12:47:40 +02:00 committed by GitHub
parent fe3dfc1587
commit fd9d244de7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -238,6 +238,23 @@ func (c CertificateSigner) Sign(ctx context.Context, req *pb.SigningRequest) (*p
return nil, err
}
difficulty, err := peerIdent.ID.Difficulty()
if err != nil {
c.log.Error("error checking difficulty", zap.Error(err))
}
token, err := ParseToken(req.AuthToken)
if err != nil {
c.log.Error("error parsing auth token", zap.Error(err))
}
tokenFormatter := Authorization{
Token: *token,
}
c.log.Info("certificate successfully signed",
zap.String("node ID", peerIdent.ID.String()),
zap.Uint16("difficulty", difficulty),
zap.String("truncated token", tokenFormatter.String()),
)
return &pb.SigningResponse{
Chain: signedChainBytes,
}, nil