Skip to content

Commit

Permalink
code review: clean up logs and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Nov 1, 2022
1 parent 571118f commit 2b571f0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nomad/encrypter.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ func (e *Encrypter) Decrypt(ciphertext []byte, keyID string) ([]byte, error) {
// header name.
const keyIDHeader = "kid"

// SignClaims signs the identity claim for the task and returns an
// encoded JWT with both the claim and its signature
// SignClaims signs the identity claim for the task and returns an encoded JWT
// (including both the claim and its signature), the key ID of the key used to
// sign it, and any error.
func (e *Encrypter) SignClaims(claim *structs.IdentityClaims) (string, string, error) {

// If a key is rotated immediately following a leader election, plans that
Expand Down Expand Up @@ -510,7 +511,7 @@ ERR_WAIT:
// peers have this key.
func (krr *KeyringReplicator) replicateKey(ctx context.Context, keyMeta *structs.RootKeyMeta) error {
keyID := keyMeta.KeyID
krr.logger.Info("replicating new key", "id", keyID)
krr.logger.Debug("replicating new key", "id", keyID)

getReq := &structs.KeyringGetRootKeyRequest{
KeyID: keyID,
Expand Down Expand Up @@ -548,7 +549,7 @@ func (krr *KeyringReplicator) replicateKey(ctx context.Context, keyMeta *structs
return fmt.Errorf("failed to add key to keyring: %v", err)
}

krr.logger.Info("added key", "key", keyID)
krr.logger.Debug("added key", "key", keyID)
return nil
}

Expand Down

0 comments on commit 2b571f0

Please sign in to comment.