Skip to content

Commit 1a8595d

Browse files
committed
Better name for private key var
1 parent 3d0f9a0 commit 1a8595d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

client.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ to your specified host.
4444
4545
*/
4646
type Client struct {
47-
AppID string
48-
Key string
49-
Secret string
50-
Host string // host or host:port pair
51-
Secure bool // true for HTTPS
52-
Cluster string
53-
HTTPClient *http.Client
54-
EncryptionMasterKey string // deprecated
55-
EncryptionMasterKeyBase64 string // for E2E
56-
memoisedEncryptionMasterKey *[]byte // parsed key for use
47+
AppID string
48+
Key string
49+
Secret string
50+
Host string // host or host:port pair
51+
Secure bool // true for HTTPS
52+
Cluster string
53+
HTTPClient *http.Client
54+
EncryptionMasterKey string // deprecated
55+
EncryptionMasterKeyBase64 string // for E2E
56+
validatedEncryptionMasterKey *[]byte // parsed key for use
5757
}
5858

5959
/*
@@ -507,8 +507,8 @@ func (c *Client) Webhook(header http.Header, body []byte) (*Webhook, error) {
507507
}
508508

509509
func (c *Client) encryptionMasterKey() ([]byte, error) {
510-
if c.memoisedEncryptionMasterKey != nil {
511-
return *(c.memoisedEncryptionMasterKey), nil
510+
if c.validatedEncryptionMasterKey != nil {
511+
return *(c.validatedEncryptionMasterKey), nil
512512
}
513513

514514
if c.EncryptionMasterKey != "" && c.EncryptionMasterKeyBase64 != "" {
@@ -521,7 +521,7 @@ func (c *Client) encryptionMasterKey() ([]byte, error) {
521521
}
522522

523523
keyBytes := []byte(c.EncryptionMasterKey)
524-
c.memoisedEncryptionMasterKey = &keyBytes
524+
c.validatedEncryptionMasterKey = &keyBytes
525525
return keyBytes, nil
526526
}
527527

@@ -534,7 +534,7 @@ func (c *Client) encryptionMasterKey() ([]byte, error) {
534534
return nil, errors.New("EncryptionMasterKeyBase64 must encode 32 bytes")
535535
}
536536

537-
c.memoisedEncryptionMasterKey = &keyBytes
537+
c.validatedEncryptionMasterKey = &keyBytes
538538
return keyBytes, nil
539539
}
540540

0 commit comments

Comments
 (0)