Adds Vault version prerelease and metadata to logical.PluginEnvironment (#14851)

This commit is contained in:
Austin Gebauer
2022-04-04 22:31:01 -07:00
committed by GitHub
parent 7aef98e045
commit 3cf641cbf5
17 changed files with 64 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: helper/forwarding/types.proto // source: helper/forwarding/types.proto
package forwarding package forwarding

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: helper/identity/mfa/types.proto // source: helper/identity/mfa/types.proto
package mfa package mfa

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: helper/identity/types.proto // source: helper/identity/types.proto
package identity package identity

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: helper/storagepacker/types.proto // source: helper/storagepacker/types.proto
package storagepacker package storagepacker

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: physical/raft/types.proto // source: physical/raft/types.proto
package raft package raft

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: sdk/database/dbplugin/database.proto // source: sdk/database/dbplugin/database.proto
package dbplugin package dbplugin

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: sdk/database/dbplugin/v5/proto/database.proto // source: sdk/database/dbplugin/v5/proto/database.proto
package proto package proto

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: sdk/helper/pluginutil/multiplexing.proto // source: sdk/helper/pluginutil/multiplexing.proto
package pluginutil package pluginutil

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: sdk/logical/identity.proto // source: sdk/logical/identity.proto
package logical package logical

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: sdk/logical/plugin.proto // source: sdk/logical/plugin.proto
package logical package logical
@@ -27,6 +27,10 @@ type PluginEnvironment struct {
// VaultVersion is the version of the Vault server // VaultVersion is the version of the Vault server
VaultVersion string `protobuf:"bytes,1,opt,name=vault_version,json=vaultVersion,proto3" json:"vault_version,omitempty"` VaultVersion string `protobuf:"bytes,1,opt,name=vault_version,json=vaultVersion,proto3" json:"vault_version,omitempty"`
// VaultVersionPrerelease is the prerelease information of the Vault server
VaultVersionPrerelease string `protobuf:"bytes,2,opt,name=vault_version_prerelease,json=vaultVersionPrerelease,proto3" json:"vault_version_prerelease,omitempty"`
// VaultVersionMetadata is the version metadata of the Vault server
VaultVersionMetadata string `protobuf:"bytes,3,opt,name=vault_version_metadata,json=vaultVersionMetadata,proto3" json:"vault_version_metadata,omitempty"`
} }
func (x *PluginEnvironment) Reset() { func (x *PluginEnvironment) Reset() {
@@ -68,18 +72,39 @@ func (x *PluginEnvironment) GetVaultVersion() string {
return "" return ""
} }
func (x *PluginEnvironment) GetVaultVersionPrerelease() string {
if x != nil {
return x.VaultVersionPrerelease
}
return ""
}
func (x *PluginEnvironment) GetVaultVersionMetadata() string {
if x != nil {
return x.VaultVersionMetadata
}
return ""
}
var File_sdk_logical_plugin_proto protoreflect.FileDescriptor var File_sdk_logical_plugin_proto protoreflect.FileDescriptor
var file_sdk_logical_plugin_proto_rawDesc = []byte{ var file_sdk_logical_plugin_proto_rawDesc = []byte{
0x0a, 0x18, 0x73, 0x64, 0x6b, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x70, 0x6c, 0x0a, 0x18, 0x73, 0x64, 0x6b, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x70, 0x6c,
0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x6f, 0x67, 0x69, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x6f, 0x67, 0x69,
0x63, 0x61, 0x6c, 0x22, 0x38, 0x0a, 0x11, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x45, 0x6e, 0x76, 0x63, 0x61, 0x6c, 0x22, 0xa8, 0x01, 0x0a, 0x11, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x45, 0x6e,
0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x75, 0x6c, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x75,
0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x0c, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x28, 0x5a, 0x52, 0x0c, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38,
0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x0a, 0x18, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f,
0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x65, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x52, 0x16, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72,
0x65, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x76, 0x61, 0x75, 0x6c,
0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x56,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x28,
0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73,
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x73, 0x64, 0x6b,
0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@@ -7,4 +7,10 @@ package logical;
message PluginEnvironment { message PluginEnvironment {
// VaultVersion is the version of the Vault server // VaultVersion is the version of the Vault server
string vault_version = 1; string vault_version = 1;
// VaultVersionPrerelease is the prerelease information of the Vault server
string vault_version_prerelease = 2;
// VaultVersionMetadata is the version metadata of the Vault server
string vault_version_metadata = 3;
} }

View File

@@ -213,7 +213,9 @@ func TestSystem_GRPC_groupsForEntity(t *testing.T) {
func TestSystem_GRPC_pluginEnv(t *testing.T) { func TestSystem_GRPC_pluginEnv(t *testing.T) {
sys := logical.TestSystemView() sys := logical.TestSystemView()
sys.PluginEnvironment = &logical.PluginEnvironment{ sys.PluginEnvironment = &logical.PluginEnvironment{
VaultVersion: "0.10.42", VaultVersion: "0.10.42",
VaultVersionPrerelease: "dev",
VaultVersionMetadata: "prem",
} }
client, _ := plugin.TestGRPCConn(t, func(s *grpc.Server) { client, _ := plugin.TestGRPCConn(t, func(s *grpc.Server) {
pb.RegisterSystemViewServer(s, &gRPCSystemViewServer{ pb.RegisterSystemViewServer(s, &gRPCSystemViewServer{

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: sdk/plugin/pb/backend.proto // source: sdk/plugin/pb/backend.proto
package pb package pb

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.17.3 // protoc v3.19.4
// source: vault/activity/activity_log.proto // source: vault/activity/activity_log.proto
package activity package activity
@@ -20,10 +20,9 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// EntityRecord is generated the first time an client is active // EntityRecord is generated the first time a client is active each month. This
// each month. This can store clients associated with entities // can store clients associated with entities or nonEntity clients, and really
// or nonEntity clients, and really is a ClientRecord, not // is a ClientRecord, not specifically an EntityRecord.
// specifically an EntityRecord
type EntityRecord struct { type EntityRecord struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@@ -37,7 +36,8 @@ type EntityRecord struct {
// non_entity records whether the given EntityRecord is // non_entity records whether the given EntityRecord is
// for a TWE or an entity-bound token. // for a TWE or an entity-bound token.
NonEntity bool `protobuf:"varint,4,opt,name=non_entity,json=nonEntity,proto3" json:"non_entity,omitempty"` NonEntity bool `protobuf:"varint,4,opt,name=non_entity,json=nonEntity,proto3" json:"non_entity,omitempty"`
// MountAccessor is the path used by client to perform login // MountAccessor is the auth mount accessor of the token used to perform the
// activity.
MountAccessor string `protobuf:"bytes,5,opt,name=mount_accessor,json=mountAccessor,proto3" json:"mount_accessor,omitempty"` MountAccessor string `protobuf:"bytes,5,opt,name=mount_accessor,json=mountAccessor,proto3" json:"mount_accessor,omitempty"`
} }

View File

@@ -350,8 +350,11 @@ func (d dynamicSystemView) GroupsForEntity(entityID string) ([]*logical.Group, e
} }
func (d dynamicSystemView) PluginEnv(_ context.Context) (*logical.PluginEnvironment, error) { func (d dynamicSystemView) PluginEnv(_ context.Context) (*logical.PluginEnvironment, error) {
v := version.GetVersion()
return &logical.PluginEnvironment{ return &logical.PluginEnvironment{
VaultVersion: version.GetVersion().Version, VaultVersion: v.Version,
VaultVersionPrerelease: v.VersionPrerelease,
VaultVersionMetadata: v.VersionMetadata,
}, nil }, nil
} }

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.19.3 // protoc v3.19.4
// source: vault/request_forwarding_service.proto // source: vault/request_forwarding_service.proto
package vault package vault

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.27.1 // protoc-gen-go v1.27.1
// protoc v3.17.3 // protoc v3.19.4
// source: vault/tokens/token.proto // source: vault/tokens/token.proto
package tokens package tokens