From 9609f4bb78885f0b89a7063f574e8ff7212917c7 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 14 Mar 2016 14:52:29 -0400 Subject: [PATCH] s/hash_accessor/hmac_accessor/g --- builtin/audit/file/backend.go | 16 ++++++++-------- builtin/audit/syslog/backend.go | 16 ++++++++-------- website/source/docs/audit/file.html.md | 2 +- website/source/docs/audit/syslog.html.md | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/builtin/audit/file/backend.go b/builtin/audit/file/backend.go index c1b54c9233..813603ab1f 100644 --- a/builtin/audit/file/backend.go +++ b/builtin/audit/file/backend.go @@ -24,13 +24,13 @@ func Factory(conf *audit.BackendConfig) (audit.Backend, error) { } // Check if hashing of accessor is disabled - hashAccessor := true - if hashAccessorRaw, ok := conf.Config["hash_accessor"]; ok { - value, err := strconv.ParseBool(hashAccessorRaw) + hmacAccessor := true + if hmacAccessorRaw, ok := conf.Config["hmac_accessor"]; ok { + value, err := strconv.ParseBool(hmacAccessorRaw) if err != nil { return nil, err } - hashAccessor = value + hmacAccessor = value } // Check if raw logging is enabled @@ -46,7 +46,7 @@ func Factory(conf *audit.BackendConfig) (audit.Backend, error) { b := &Backend{ path: path, logRaw: logRaw, - hashAccessor: hashAccessor, + hmacAccessor: hmacAccessor, salt: conf.Salt, } @@ -68,7 +68,7 @@ func Factory(conf *audit.BackendConfig) (audit.Backend, error) { type Backend struct { path string logRaw bool - hashAccessor bool + hmacAccessor bool salt *salt.Salt once sync.Once @@ -165,7 +165,7 @@ func (b *Backend) LogResponse( // Cache and restore accessor in the auth var accessor string - if !b.hashAccessor && auth != nil && auth.Accessor != "" { + if !b.hmacAccessor && auth != nil && auth.Accessor != "" { accessor = auth.Accessor } if err := audit.Hash(b.salt, auth); err != nil { @@ -181,7 +181,7 @@ func (b *Backend) LogResponse( // Cache and restore accessor in the response accessor = "" - if !b.hashAccessor && resp != nil && resp.Auth != nil && resp.Auth.Accessor != "" { + if !b.hmacAccessor && resp != nil && resp.Auth != nil && resp.Auth.Accessor != "" { accessor = resp.Auth.Accessor } if err := audit.Hash(b.salt, resp); err != nil { diff --git a/builtin/audit/syslog/backend.go b/builtin/audit/syslog/backend.go index 303763859b..e6f461a6a8 100644 --- a/builtin/audit/syslog/backend.go +++ b/builtin/audit/syslog/backend.go @@ -30,13 +30,13 @@ func Factory(conf *audit.BackendConfig) (audit.Backend, error) { } // Check if hashing of accessor is disabled - hashAccessor := true - if hashAccessorRaw, ok := conf.Config["hash_accessor"]; ok { - value, err := strconv.ParseBool(hashAccessorRaw) + hmacAccessor := true + if hmacAccessorRaw, ok := conf.Config["hmac_accessor"]; ok { + value, err := strconv.ParseBool(hmacAccessorRaw) if err != nil { return nil, err } - hashAccessor = value + hmacAccessor = value } // Check if raw logging is enabled @@ -58,7 +58,7 @@ func Factory(conf *audit.BackendConfig) (audit.Backend, error) { b := &Backend{ logger: logger, logRaw: logRaw, - hashAccessor: hashAccessor, + hmacAccessor: hmacAccessor, salt: conf.Salt, } return b, nil @@ -68,7 +68,7 @@ func Factory(conf *audit.BackendConfig) (audit.Backend, error) { type Backend struct { logger gsyslog.Syslogger logRaw bool - hashAccessor bool + hmacAccessor bool salt *salt.Salt } @@ -160,7 +160,7 @@ func (b *Backend) LogResponse(auth *logical.Auth, req *logical.Request, // Cache and restore accessor in the auth var accessor string - if !b.hashAccessor && auth != nil && auth.Accessor != "" { + if !b.hmacAccessor && auth != nil && auth.Accessor != "" { accessor = auth.Accessor } if err := audit.Hash(b.salt, auth); err != nil { @@ -176,7 +176,7 @@ func (b *Backend) LogResponse(auth *logical.Auth, req *logical.Request, // Cache and restore accessor in the response accessor = "" - if !b.hashAccessor && resp != nil && resp.Auth != nil && resp.Auth.Accessor != "" { + if !b.hmacAccessor && resp != nil && resp.Auth != nil && resp.Auth.Accessor != "" { accessor = resp.Auth.Accessor } if err := audit.Hash(b.salt, resp); err != nil { diff --git a/website/source/docs/audit/file.html.md b/website/source/docs/audit/file.html.md index bc068b3bde..8c0a1db963 100644 --- a/website/source/docs/audit/file.html.md +++ b/website/source/docs/audit/file.html.md @@ -55,7 +55,7 @@ Following are the configuration options available for the backend. hashing, in the raw format. Defaults to `false`.
  • - hash_accessor + hmac_accessor optional A boolean, if set, skips the hashing of token accessor. This option is useful only when `log_raw` is `false`. diff --git a/website/source/docs/audit/syslog.html.md b/website/source/docs/audit/syslog.html.md index 923a4f756a..be168273d8 100644 --- a/website/source/docs/audit/syslog.html.md +++ b/website/source/docs/audit/syslog.html.md @@ -60,7 +60,7 @@ Following are the configuration options available for the backend. hashing, in the raw format. Defaults to `false`.
  • - hash_accessor + hmac_accessor optional A boolean, if set, skips the hashing of token accessor. This option is useful only when `log_raw` is `false`.