Update protobufs, sdk changes

This commit is contained in:
Jeff Mitchell 2019-04-12 23:13:14 -04:00
parent 19bd861581
commit 1b5155080b
11 changed files with 162 additions and 174 deletions

View File

@ -4,11 +4,13 @@
package dbplugin
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
@ -21,7 +23,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Deprecated: Do not use.
type InitializeRequest struct {
@ -844,6 +846,35 @@ type DatabaseServer interface {
Initialize(context.Context, *InitializeRequest) (*Empty, error)
}
// UnimplementedDatabaseServer can be embedded to have forward compatible implementations.
type UnimplementedDatabaseServer struct {
}
func (*UnimplementedDatabaseServer) Type(ctx context.Context, req *Empty) (*TypeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Type not implemented")
}
func (*UnimplementedDatabaseServer) CreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented")
}
func (*UnimplementedDatabaseServer) RenewUser(ctx context.Context, req *RenewUserRequest) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method RenewUser not implemented")
}
func (*UnimplementedDatabaseServer) RevokeUser(ctx context.Context, req *RevokeUserRequest) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method RevokeUser not implemented")
}
func (*UnimplementedDatabaseServer) RotateRootCredentials(ctx context.Context, req *RotateRootCredentialsRequest) (*RotateRootCredentialsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RotateRootCredentials not implemented")
}
func (*UnimplementedDatabaseServer) Init(ctx context.Context, req *InitRequest) (*InitResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Init not implemented")
}
func (*UnimplementedDatabaseServer) Close(ctx context.Context, req *Empty) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Close not implemented")
}
func (*UnimplementedDatabaseServer) Initialize(ctx context.Context, req *InitializeRequest) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Initialize not implemented")
}
func RegisterDatabaseServer(s *grpc.Server, srv DatabaseServer) {
s.RegisterService(&_Database_serviceDesc, srv)
}

View File

@ -18,7 +18,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Request struct {
// Not used right now but reserving in case it turns out that streaming

View File

@ -18,7 +18,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Config represents the configuration information used *along with* the MFA
// secret tied to caller's identity, to verify the MFA credentials supplied.
@ -164,9 +164,9 @@ func (m *Config) GetPingIDConfig() *PingIDConfig {
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Config) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Config_OneofMarshaler, _Config_OneofUnmarshaler, _Config_OneofSizer, []interface{}{
// XXX_OneofWrappers is for the internal use of the proto package.
func (*Config) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*Config_TOTPConfig)(nil),
(*Config_OktaConfig)(nil),
(*Config_DuoConfig)(nil),
@ -174,108 +174,6 @@ func (*Config) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error,
}
}
func _Config_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Config)
// config
switch x := m.Config.(type) {
case *Config_TOTPConfig:
b.EncodeVarint(6<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.TOTPConfig); err != nil {
return err
}
case *Config_OktaConfig:
b.EncodeVarint(7<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.OktaConfig); err != nil {
return err
}
case *Config_DuoConfig:
b.EncodeVarint(8<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.DuoConfig); err != nil {
return err
}
case *Config_PingIDConfig:
b.EncodeVarint(9<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.PingIDConfig); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Config.Config has unexpected type %T", x)
}
return nil
}
func _Config_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Config)
switch tag {
case 6: // config.totp_config
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TOTPConfig)
err := b.DecodeMessage(msg)
m.Config = &Config_TOTPConfig{msg}
return true, err
case 7: // config.okta_config
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(OktaConfig)
err := b.DecodeMessage(msg)
m.Config = &Config_OktaConfig{msg}
return true, err
case 8: // config.duo_config
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(DuoConfig)
err := b.DecodeMessage(msg)
m.Config = &Config_DuoConfig{msg}
return true, err
case 9: // config.pingid_config
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PingIDConfig)
err := b.DecodeMessage(msg)
m.Config = &Config_PingIDConfig{msg}
return true, err
default:
return false, nil
}
}
func _Config_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Config)
// config
switch x := m.Config.(type) {
case *Config_TOTPConfig:
s := proto.Size(x.TOTPConfig)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Config_OktaConfig:
s := proto.Size(x.OktaConfig)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Config_DuoConfig:
s := proto.Size(x.DuoConfig)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Config_PingIDConfig:
s := proto.Size(x.PingIDConfig)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// TOTPConfig represents the configuration information required to generate
// a TOTP key. The generated key will be stored in the entity along with these
// options. Validation of credentials supplied over the API will be validated
@ -662,61 +560,13 @@ func (m *Secret) GetTOTPSecret() *TOTPSecret {
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Secret) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Secret_OneofMarshaler, _Secret_OneofUnmarshaler, _Secret_OneofSizer, []interface{}{
// XXX_OneofWrappers is for the internal use of the proto package.
func (*Secret) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*Secret_TOTPSecret)(nil),
}
}
func _Secret_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Secret)
// value
switch x := m.Value.(type) {
case *Secret_TOTPSecret:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.TOTPSecret); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Secret.Value has unexpected type %T", x)
}
return nil
}
func _Secret_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Secret)
switch tag {
case 2: // value.totp_secret
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TOTPSecret)
err := b.DecodeMessage(msg)
m.Value = &Secret_TOTPSecret{msg}
return true, err
default:
return false, nil
}
}
func _Secret_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Secret)
// value
switch x := m.Value.(type) {
case *Secret_TOTPSecret:
s := proto.Size(x.TOTPSecret)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// TOTPSecret represents the secret that gets stored in the entity about a
// particular MFA method. This information is used to validate the MFA
// credential supplied over the API during request time.

View File

@ -20,7 +20,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Group represents an identity group.
type Group struct {

View File

@ -19,7 +19,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Item struct {
ID string `sentinel:"" protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`

View File

@ -18,7 +18,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Entity struct {
// ID is the unique identifier for the entity

View File

@ -18,7 +18,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type PluginEnvironment struct {
// VaultVersion is the version of the Vault server

View File

@ -84,7 +84,7 @@ func NewTransactionalCache(b Backend, size int, logger log.Logger) *Transactiona
return c
}
func (c *Cache) shouldCache(key string) bool {
func (c *Cache) ShouldCache(key string) bool {
if atomic.LoadUint32(c.enabled) == 0 {
return false
}
@ -114,7 +114,7 @@ func (c *Cache) Purge(ctx context.Context) {
}
func (c *Cache) Put(ctx context.Context, entry *Entry) error {
if entry != nil && !c.shouldCache(entry.Key) {
if entry != nil && !c.ShouldCache(entry.Key) {
return c.backend.Put(ctx, entry)
}
@ -130,7 +130,7 @@ func (c *Cache) Put(ctx context.Context, entry *Entry) error {
}
func (c *Cache) Get(ctx context.Context, key string) (*Entry, error) {
if !c.shouldCache(key) {
if !c.ShouldCache(key) {
return c.backend.Get(ctx, key)
}
@ -159,7 +159,7 @@ func (c *Cache) Get(ctx context.Context, key string) (*Entry, error) {
}
func (c *Cache) Delete(ctx context.Context, key string) error {
if !c.shouldCache(key) {
if !c.ShouldCache(key) {
return c.backend.Delete(ctx, key)
}
@ -181,6 +181,14 @@ func (c *Cache) List(ctx context.Context, prefix string) ([]string, error) {
return c.backend.List(ctx, prefix)
}
func (c *TransactionalCache) Locks() []*locksutil.LockEntry {
return c.locks
}
func (c *TransactionalCache) LRU() *lru.TwoQueueCache {
return c.lru
}
func (c *TransactionalCache) Transaction(ctx context.Context, txns []*TxnEntry) error {
// Bypass the locking below
if atomic.LoadUint32(c.enabled) == 0 {
@ -203,7 +211,7 @@ func (c *TransactionalCache) Transaction(ctx context.Context, txns []*TxnEntry)
}
for _, txn := range txns {
if !c.shouldCache(txn.Entry.Key) {
if !c.ShouldCache(txn.Entry.Key) {
continue
}

View File

@ -18,7 +18,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type EncryptedBlobInfo struct {
Ciphertext []byte `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`

View File

@ -4,12 +4,14 @@
package pb
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
logical "github.com/hashicorp/vault/sdk/logical"
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
@ -22,7 +24,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type Empty struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@ -3026,6 +3028,32 @@ type BackendServer interface {
Type(context.Context, *Empty) (*TypeReply, error)
}
// UnimplementedBackendServer can be embedded to have forward compatible implementations.
type UnimplementedBackendServer struct {
}
func (*UnimplementedBackendServer) HandleRequest(ctx context.Context, req *HandleRequestArgs) (*HandleRequestReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleRequest not implemented")
}
func (*UnimplementedBackendServer) SpecialPaths(ctx context.Context, req *Empty) (*SpecialPathsReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method SpecialPaths not implemented")
}
func (*UnimplementedBackendServer) HandleExistenceCheck(ctx context.Context, req *HandleExistenceCheckArgs) (*HandleExistenceCheckReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandleExistenceCheck not implemented")
}
func (*UnimplementedBackendServer) Cleanup(ctx context.Context, req *Empty) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Cleanup not implemented")
}
func (*UnimplementedBackendServer) InvalidateKey(ctx context.Context, req *InvalidateKeyArgs) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method InvalidateKey not implemented")
}
func (*UnimplementedBackendServer) Setup(ctx context.Context, req *SetupArgs) (*SetupReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Setup not implemented")
}
func (*UnimplementedBackendServer) Type(ctx context.Context, req *Empty) (*TypeReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Type not implemented")
}
func RegisterBackendServer(s *grpc.Server, srv BackendServer) {
s.RegisterService(&_Backend_serviceDesc, srv)
}
@ -3255,6 +3283,23 @@ type StorageServer interface {
Delete(context.Context, *StorageDeleteArgs) (*StorageDeleteReply, error)
}
// UnimplementedStorageServer can be embedded to have forward compatible implementations.
type UnimplementedStorageServer struct {
}
func (*UnimplementedStorageServer) List(ctx context.Context, req *StorageListArgs) (*StorageListReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (*UnimplementedStorageServer) Get(ctx context.Context, req *StorageGetArgs) (*StorageGetReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (*UnimplementedStorageServer) Put(ctx context.Context, req *StoragePutArgs) (*StoragePutReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Put not implemented")
}
func (*UnimplementedStorageServer) Delete(ctx context.Context, req *StorageDeleteArgs) (*StorageDeleteReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func RegisterStorageServer(s *grpc.Server, srv StorageServer) {
s.RegisterService(&_Storage_serviceDesc, srv)
}
@ -3545,6 +3590,44 @@ type SystemViewServer interface {
PluginEnv(context.Context, *Empty) (*PluginEnvReply, error)
}
// UnimplementedSystemViewServer can be embedded to have forward compatible implementations.
type UnimplementedSystemViewServer struct {
}
func (*UnimplementedSystemViewServer) DefaultLeaseTTL(ctx context.Context, req *Empty) (*TTLReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DefaultLeaseTTL not implemented")
}
func (*UnimplementedSystemViewServer) MaxLeaseTTL(ctx context.Context, req *Empty) (*TTLReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method MaxLeaseTTL not implemented")
}
func (*UnimplementedSystemViewServer) SudoPrivilege(ctx context.Context, req *SudoPrivilegeArgs) (*SudoPrivilegeReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method SudoPrivilege not implemented")
}
func (*UnimplementedSystemViewServer) Tainted(ctx context.Context, req *Empty) (*TaintedReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Tainted not implemented")
}
func (*UnimplementedSystemViewServer) CachingDisabled(ctx context.Context, req *Empty) (*CachingDisabledReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method CachingDisabled not implemented")
}
func (*UnimplementedSystemViewServer) ReplicationState(ctx context.Context, req *Empty) (*ReplicationStateReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReplicationState not implemented")
}
func (*UnimplementedSystemViewServer) ResponseWrapData(ctx context.Context, req *ResponseWrapDataArgs) (*ResponseWrapDataReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResponseWrapData not implemented")
}
func (*UnimplementedSystemViewServer) MlockEnabled(ctx context.Context, req *Empty) (*MlockEnabledReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method MlockEnabled not implemented")
}
func (*UnimplementedSystemViewServer) LocalMount(ctx context.Context, req *Empty) (*LocalMountReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method LocalMount not implemented")
}
func (*UnimplementedSystemViewServer) EntityInfo(ctx context.Context, req *EntityInfoArgs) (*EntityInfoReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method EntityInfo not implemented")
}
func (*UnimplementedSystemViewServer) PluginEnv(ctx context.Context, req *Empty) (*PluginEnvReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method PluginEnv not implemented")
}
func RegisterSystemViewServer(s *grpc.Server, srv SystemViewServer) {
s.RegisterService(&_SystemView_serviceDesc, srv)
}

View File

@ -4,11 +4,13 @@
package vault
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
forwarding "github.com/hashicorp/vault/helper/forwarding"
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
@ -21,7 +23,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type EchoRequest struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
@ -439,6 +441,20 @@ type RequestForwardingServer interface {
PerformanceStandbyElectionRequest(*PerfStandbyElectionInput, RequestForwarding_PerformanceStandbyElectionRequestServer) error
}
// UnimplementedRequestForwardingServer can be embedded to have forward compatible implementations.
type UnimplementedRequestForwardingServer struct {
}
func (*UnimplementedRequestForwardingServer) ForwardRequest(ctx context.Context, req *forwarding.Request) (*forwarding.Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method ForwardRequest not implemented")
}
func (*UnimplementedRequestForwardingServer) Echo(ctx context.Context, req *EchoRequest) (*EchoReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
}
func (*UnimplementedRequestForwardingServer) PerformanceStandbyElectionRequest(req *PerfStandbyElectionInput, srv RequestForwarding_PerformanceStandbyElectionRequestServer) error {
return status.Errorf(codes.Unimplemented, "method PerformanceStandbyElectionRequest not implemented")
}
func RegisterRequestForwardingServer(s *grpc.Server, srv RequestForwardingServer) {
s.RegisterService(&_RequestForwarding_serviceDesc, srv)
}