diff options
| author | Niall Sheridan <nsheridan@gmail.com> | 2017-02-19 01:49:51 +0000 | 
|---|---|---|
| committer | Niall Sheridan <nsheridan@gmail.com> | 2017-02-19 01:49:51 +0000 | 
| commit | eb57eaf30965ba24ff669d6f9c8d11cd24951777 (patch) | |
| tree | d04d1e425f0fce5c0f696b8cab7e660630cbd362 /vendor/github.com/hashicorp | |
| parent | e8ff7ffe8e8c25195c64950b61c6c5754bbcd3ba (diff) | |
update dependencies
Diffstat (limited to 'vendor/github.com/hashicorp')
| -rw-r--r-- | vendor/github.com/hashicorp/vault/api/sys_audit.go | 24 | ||||
| -rw-r--r-- | vendor/github.com/hashicorp/vault/api/sys_auth.go | 21 | ||||
| -rw-r--r-- | vendor/github.com/hashicorp/vault/api/sys_mounts.go | 2 | 
3 files changed, 38 insertions, 9 deletions
diff --git a/vendor/github.com/hashicorp/vault/api/sys_audit.go b/vendor/github.com/hashicorp/vault/api/sys_audit.go index 1ffdef8..89f2141 100644 --- a/vendor/github.com/hashicorp/vault/api/sys_audit.go +++ b/vendor/github.com/hashicorp/vault/api/sys_audit.go @@ -3,6 +3,7 @@ package api  import (  	"fmt" +	"github.com/fatih/structs"  	"github.com/mitchellh/mapstructure"  ) @@ -71,13 +72,18 @@ func (c *Sys) ListAudit() (map[string]*Audit, error) {  	return mounts, nil  } +// DEPRECATED: Use EnableAuditWithOptions instead  func (c *Sys) EnableAudit(  	path string, auditType string, desc string, opts map[string]string) error { -	body := map[string]interface{}{ -		"type":        auditType, -		"description": desc, -		"options":     opts, -	} +	return c.EnableAuditWithOptions(path, &EnableAuditOptions{ +		Type:        auditType, +		Description: desc, +		Options:     opts, +	}) +} + +func (c *Sys) EnableAuditWithOptions(path string, options *EnableAuditOptions) error { +	body := structs.Map(options)  	r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/sys/audit/%s", path))  	if err := r.SetJSONBody(body); err != nil { @@ -106,9 +112,17 @@ func (c *Sys) DisableAudit(path string) error {  // individually documented because the map almost directly to the raw HTTP API  // documentation. Please refer to that documentation for more details. +type EnableAuditOptions struct { +	Type        string            `json:"type" structs:"type"` +	Description string            `json:"description" structs:"description"` +	Options     map[string]string `json:"options" structs:"options"` +	Local       bool              `json:"local" structs:"local"` +} +  type Audit struct {  	Path        string  	Type        string  	Description string  	Options     map[string]string +	Local       bool  } diff --git a/vendor/github.com/hashicorp/vault/api/sys_auth.go b/vendor/github.com/hashicorp/vault/api/sys_auth.go index 1940e84..f9f3c8c 100644 --- a/vendor/github.com/hashicorp/vault/api/sys_auth.go +++ b/vendor/github.com/hashicorp/vault/api/sys_auth.go @@ -3,6 +3,7 @@ package api  import (  	"fmt" +	"github.com/fatih/structs"  	"github.com/mitchellh/mapstructure"  ) @@ -42,11 +43,16 @@ func (c *Sys) ListAuth() (map[string]*AuthMount, error) {  	return mounts, nil  } +// DEPRECATED: Use EnableAuthWithOptions instead  func (c *Sys) EnableAuth(path, authType, desc string) error { -	body := map[string]string{ -		"type":        authType, -		"description": desc, -	} +	return c.EnableAuthWithOptions(path, &EnableAuthOptions{ +		Type:        authType, +		Description: desc, +	}) +} + +func (c *Sys) EnableAuthWithOptions(path string, options *EnableAuthOptions) error { +	body := structs.Map(options)  	r := c.c.NewRequest("POST", fmt.Sprintf("/v1/sys/auth/%s", path))  	if err := r.SetJSONBody(body); err != nil { @@ -75,10 +81,17 @@ func (c *Sys) DisableAuth(path string) error {  // individually documentd because the map almost directly to the raw HTTP API  // documentation. Please refer to that documentation for more details. +type EnableAuthOptions struct { +	Type        string `json:"type" structs:"type"` +	Description string `json:"description" structs:"description"` +	Local       bool   `json:"local" structs:"local"` +} +  type AuthMount struct {  	Type        string           `json:"type" structs:"type" mapstructure:"type"`  	Description string           `json:"description" structs:"description" mapstructure:"description"`  	Config      AuthConfigOutput `json:"config" structs:"config" mapstructure:"config"` +	Local       bool             `json:"local" structs:"local" mapstructure:"local"`  }  type AuthConfigOutput struct { diff --git a/vendor/github.com/hashicorp/vault/api/sys_mounts.go b/vendor/github.com/hashicorp/vault/api/sys_mounts.go index ca5e427..768e09f 100644 --- a/vendor/github.com/hashicorp/vault/api/sys_mounts.go +++ b/vendor/github.com/hashicorp/vault/api/sys_mounts.go @@ -123,6 +123,7 @@ type MountInput struct {  	Type        string           `json:"type" structs:"type"`  	Description string           `json:"description" structs:"description"`  	Config      MountConfigInput `json:"config" structs:"config"` +	Local       bool             `json:"local" structs:"local"`  }  type MountConfigInput struct { @@ -134,6 +135,7 @@ type MountOutput struct {  	Type        string            `json:"type" structs:"type"`  	Description string            `json:"description" structs:"description"`  	Config      MountConfigOutput `json:"config" structs:"config"` +	Local       bool              `json:"local" structs:"local"`  }  type MountConfigOutput struct {  | 
