add info log for successfull authorizations (#1804)
This commit is contained in:
parent
fe3dfc1587
commit
fd9d244de7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user