mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
s/hash_accessor/hmac_accessor/g
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -55,7 +55,7 @@ Following are the configuration options available for the backend.
|
||||
hashing, in the raw format. Defaults to `false`.
|
||||
</li>
|
||||
<li>
|
||||
<span class="param">hash_accessor</span>
|
||||
<span class="param">hmac_accessor</span>
|
||||
<span class="param-flags">optional</span>
|
||||
A boolean, if set, skips the hashing of token accessor. This option
|
||||
is useful only when `log_raw` is `false`.
|
||||
|
||||
@@ -60,7 +60,7 @@ Following are the configuration options available for the backend.
|
||||
hashing, in the raw format. Defaults to `false`.
|
||||
</li>
|
||||
<li>
|
||||
<span class="param">hash_accessor</span>
|
||||
<span class="param">hmac_accessor</span>
|
||||
<span class="param-flags">optional</span>
|
||||
A boolean, if set, skips the hashing of token accessor. This option
|
||||
is useful only when `log_raw` is `false`.
|
||||
|
||||
Reference in New Issue
Block a user