Update vendoring (#8111)
This commit is contained in:
parent
fb4edc129e
commit
2d859d83ea
|
@ -58,7 +58,7 @@ func (c *SQLConnectionProducer) Init(ctx context.Context, conf map[string]interf
|
|||
// Don't escape special characters for MySQL password
|
||||
password := c.Password
|
||||
if c.Type != "mysql" {
|
||||
//password = url.PathEscape(c.Password)
|
||||
password = url.PathEscape(c.Password)
|
||||
}
|
||||
|
||||
// QueryHelper doesn't do any SQL escaping, but if it starts to do so
|
||||
|
|
|
@ -15,7 +15,8 @@ import (
|
|||
|
||||
"github.com/hashicorp/errwrap"
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
multierror "github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/vault/sdk/helper/consts"
|
||||
"github.com/hashicorp/vault/sdk/helper/entropy"
|
||||
"github.com/hashicorp/vault/sdk/helper/errutil"
|
||||
"github.com/hashicorp/vault/sdk/helper/license"
|
||||
|
@ -225,6 +226,19 @@ func (b *Backend) HandleRequest(ctx context.Context, req *logical.Request) (*log
|
|||
|
||||
if path.Operations != nil {
|
||||
if op, ok := path.Operations[req.Operation]; ok {
|
||||
|
||||
// Check whether this operation should be forwarded
|
||||
replState := b.System().ReplicationState()
|
||||
props := op.Properties()
|
||||
|
||||
if props.ForwardPerformanceStandby && replState.HasState(consts.ReplicationPerformanceStandby) {
|
||||
return nil, logical.ErrReadOnly
|
||||
}
|
||||
|
||||
if props.ForwardPerformanceSecondary && !b.System().LocalMount() && replState.HasState(consts.ReplicationPerformanceSecondary) {
|
||||
return nil, logical.ErrReadOnly
|
||||
}
|
||||
|
||||
callback = op.Handler()
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -153,6 +153,14 @@ type OperationProperties struct {
|
|||
// Deprecated indicates that this operation should be avoided.
|
||||
Deprecated bool
|
||||
|
||||
// ForwardPerformanceStandby indicates that this path should not be processed
|
||||
// on a performance standby node, and should be forwarded to the active node instead.
|
||||
ForwardPerformanceStandby bool
|
||||
|
||||
// ForwardPerformanceSecondary indicates that this path should not be processed
|
||||
// on a performance secondary node, and should be forwarded to the active node instead.
|
||||
ForwardPerformanceSecondary bool
|
||||
|
||||
// DisplayAttrs provides hints for UI and documentation generators. They
|
||||
// will be included in OpenAPI output if set.
|
||||
DisplayAttrs *DisplayAttributes
|
||||
|
@ -206,13 +214,15 @@ type Response struct {
|
|||
|
||||
// PathOperation is a concrete implementation of OperationHandler.
|
||||
type PathOperation struct {
|
||||
Callback OperationFunc
|
||||
Summary string
|
||||
Description string
|
||||
Examples []RequestExample
|
||||
Responses map[int][]Response
|
||||
Unpublished bool
|
||||
Deprecated bool
|
||||
Callback OperationFunc
|
||||
Summary string
|
||||
Description string
|
||||
Examples []RequestExample
|
||||
Responses map[int][]Response
|
||||
Unpublished bool
|
||||
Deprecated bool
|
||||
ForwardPerformanceSecondary bool
|
||||
ForwardPerformanceStandby bool
|
||||
}
|
||||
|
||||
func (p *PathOperation) Handler() OperationFunc {
|
||||
|
@ -221,12 +231,14 @@ func (p *PathOperation) Handler() OperationFunc {
|
|||
|
||||
func (p *PathOperation) Properties() OperationProperties {
|
||||
return OperationProperties{
|
||||
Summary: strings.TrimSpace(p.Summary),
|
||||
Description: strings.TrimSpace(p.Description),
|
||||
Responses: p.Responses,
|
||||
Examples: p.Examples,
|
||||
Unpublished: p.Unpublished,
|
||||
Deprecated: p.Deprecated,
|
||||
Summary: strings.TrimSpace(p.Summary),
|
||||
Description: strings.TrimSpace(p.Description),
|
||||
Responses: p.Responses,
|
||||
Examples: p.Examples,
|
||||
Unpublished: p.Unpublished,
|
||||
Deprecated: p.Deprecated,
|
||||
ForwardPerformanceSecondary: p.ForwardPerformanceSecondary,
|
||||
ForwardPerformanceStandby: p.ForwardPerformanceStandby,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3524,7 +3524,7 @@ type SystemViewClient interface {
|
|||
EntityInfo(ctx context.Context, in *EntityInfoArgs, opts ...grpc.CallOption) (*EntityInfoReply, error)
|
||||
// PluginEnv returns Vault environment information used by plugins
|
||||
PluginEnv(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PluginEnvReply, error)
|
||||
// GroupsForEntity returns the group membersship information for the given
|
||||
// GroupsForEntity returns the group membership information for the given
|
||||
// entity id
|
||||
GroupsForEntity(ctx context.Context, in *EntityInfoArgs, opts ...grpc.CallOption) (*GroupsForEntityReply, error)
|
||||
}
|
||||
|
@ -3671,7 +3671,7 @@ type SystemViewServer interface {
|
|||
EntityInfo(context.Context, *EntityInfoArgs) (*EntityInfoReply, error)
|
||||
// PluginEnv returns Vault environment information used by plugins
|
||||
PluginEnv(context.Context, *Empty) (*PluginEnvReply, error)
|
||||
// GroupsForEntity returns the group membersship information for the given
|
||||
// GroupsForEntity returns the group membership information for the given
|
||||
// entity id
|
||||
GroupsForEntity(context.Context, *EntityInfoArgs) (*GroupsForEntityReply, error)
|
||||
}
|
||||
|
|
|
@ -600,7 +600,7 @@ service SystemView {
|
|||
// PluginEnv returns Vault environment information used by plugins
|
||||
rpc PluginEnv(Empty) returns (PluginEnvReply);
|
||||
|
||||
// GroupsForEntity returns the group membersship information for the given
|
||||
// GroupsForEntity returns the group membership information for the given
|
||||
// entity id
|
||||
rpc GroupsForEntity(EntityInfoArgs) returns (GroupsForEntityReply);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue