diff --git a/agent/auto-config/auto_config.go b/agent/auto-config/auto_config.go index 1e2b7110f..047fbc324 100644 --- a/agent/auto-config/auto_config.go +++ b/agent/auto-config/auto_config.go @@ -12,10 +12,10 @@ import ( "strings" "time" - "github.com/hashicorp/consul/agent/agentpb" "github.com/hashicorp/consul/agent/config" "github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/logging" + "github.com/hashicorp/consul/proto/pbautoconf" "github.com/hashicorp/consul/tlsutil" "github.com/hashicorp/go-discover" discoverk8s "github.com/hashicorp/go-discover/provider/k8s" @@ -234,7 +234,7 @@ func (ac *AutoConfig) restorePersistedAutoConfig() (bool, error) { } // InitialConfiguration will perform a one-time RPC request to the configured servers -// to retrieve various cluster wide configurations. See the agent/agentpb/auto_config.proto +// to retrieve various cluster wide configurations. See the proto/pbautoconf/auto_config.proto // file for a complete reference of what configurations can be applied in this manner. // The returned configuration will be the new configuration with any auto-config settings // already applied. If AutoConfig is not enabled this method will just parse any @@ -391,7 +391,7 @@ func (ac *AutoConfig) resolveHost(hostPort string) []net.TCPAddr { // recordAutoConfigReply takes an AutoConfig RPC reply records it with the agent // This will persist the configuration to disk (unless in dev mode running without // a data dir) and will reload the configuration. -func (ac *AutoConfig) recordAutoConfigReply(reply *agentpb.AutoConfigResponse) error { +func (ac *AutoConfig) recordAutoConfigReply(reply *pbautoconf.AutoConfigResponse) error { // overwrite the auto encrypt DNS SANs with the ones specified in the auto_config stanza if len(ac.config.AutoConfig.DNSSANs) > 0 && reply.Config.AutoEncrypt != nil { reply.Config.AutoEncrypt.DNSSAN = ac.config.AutoConfig.DNSSANs @@ -441,14 +441,14 @@ func (ac *AutoConfig) getInitialConfigurationOnce(ctx context.Context) (bool, er return false, err } - request := agentpb.AutoConfigRequest{ + request := pbautoconf.AutoConfigRequest{ Datacenter: ac.config.Datacenter, Node: ac.config.NodeName, Segment: ac.config.SegmentName, JWT: token, } - var reply agentpb.AutoConfigResponse + var reply pbautoconf.AutoConfigResponse servers, err := ac.autoConfigHosts() if err != nil { diff --git a/agent/auto-config/auto_config_test.go b/agent/auto-config/auto_config_test.go index 715140909..254ce9512 100644 --- a/agent/auto-config/auto_config_test.go +++ b/agent/auto-config/auto_config_test.go @@ -11,10 +11,10 @@ import ( "testing" "time" - "github.com/hashicorp/consul/agent/agentpb" - pbconfig "github.com/hashicorp/consul/agent/agentpb/config" "github.com/hashicorp/consul/agent/config" "github.com/hashicorp/consul/lib" + "github.com/hashicorp/consul/proto/pbautoconf" + "github.com/hashicorp/consul/proto/pbconfig" "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/consul/tlsutil" "github.com/stretchr/testify/mock" @@ -201,7 +201,7 @@ func TestInitialConfiguration_cancelled(t *testing.T) { directRPC := mockDirectRPC{} - expectedRequest := agentpb.AutoConfigRequest{ + expectedRequest := pbautoconf.AutoConfigRequest{ Datacenter: "dc1", Node: "autoconf", JWT: "blarg", @@ -271,14 +271,14 @@ func TestInitialConfiguration_success(t *testing.T) { directRPC := mockDirectRPC{} populateResponse := func(val interface{}) { - resp, ok := val.(*agentpb.AutoConfigResponse) + resp, ok := val.(*pbautoconf.AutoConfigResponse) require.True(t, ok) resp.Config = &pbconfig.Config{ PrimaryDatacenter: "primary", } } - expectedRequest := agentpb.AutoConfigRequest{ + expectedRequest := pbautoconf.AutoConfigRequest{ Datacenter: "dc1", Node: "autoconf", JWT: "blarg", @@ -291,7 +291,7 @@ func TestInitialConfiguration_success(t *testing.T) { &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 8300}, "AutoConfig.InitialConfiguration", &expectedRequest, - &agentpb.AutoConfigResponse{}).Return(populateResponse) + &pbautoconf.AutoConfigResponse{}).Return(populateResponse) ac, err := New(WithBuilderOpts(builderOpts), WithTLSConfigurator(&tlsutil.Configurator{}), WithDirectRPC(&directRPC)) require.NoError(t, err) @@ -323,14 +323,14 @@ func TestInitialConfiguration_retries(t *testing.T) { directRPC := mockDirectRPC{} populateResponse := func(val interface{}) { - resp, ok := val.(*agentpb.AutoConfigResponse) + resp, ok := val.(*pbautoconf.AutoConfigResponse) require.True(t, ok) resp.Config = &pbconfig.Config{ PrimaryDatacenter: "primary", } } - expectedRequest := agentpb.AutoConfigRequest{ + expectedRequest := pbautoconf.AutoConfigRequest{ Datacenter: "dc1", Node: "autoconf", JWT: "blarg", @@ -346,7 +346,7 @@ func TestInitialConfiguration_retries(t *testing.T) { &net.TCPAddr{IP: net.IPv4(198, 18, 0, 1), Port: 8300}, "AutoConfig.InitialConfiguration", &expectedRequest, - &agentpb.AutoConfigResponse{}).Return(fmt.Errorf("injected failure")).Times(0) + &pbautoconf.AutoConfigResponse{}).Return(fmt.Errorf("injected failure")).Times(0) directRPC.On( "RPC", "dc1", @@ -354,7 +354,7 @@ func TestInitialConfiguration_retries(t *testing.T) { &net.TCPAddr{IP: net.IPv4(198, 18, 0, 2), Port: 8398}, "AutoConfig.InitialConfiguration", &expectedRequest, - &agentpb.AutoConfigResponse{}).Return(fmt.Errorf("injected failure")).Times(0) + &pbautoconf.AutoConfigResponse{}).Return(fmt.Errorf("injected failure")).Times(0) directRPC.On( "RPC", "dc1", @@ -362,7 +362,7 @@ func TestInitialConfiguration_retries(t *testing.T) { &net.TCPAddr{IP: net.IPv4(198, 18, 0, 3), Port: 8399}, "AutoConfig.InitialConfiguration", &expectedRequest, - &agentpb.AutoConfigResponse{}).Return(fmt.Errorf("injected failure")).Times(0) + &pbautoconf.AutoConfigResponse{}).Return(fmt.Errorf("injected failure")).Times(0) directRPC.On( "RPC", "dc1", @@ -370,7 +370,7 @@ func TestInitialConfiguration_retries(t *testing.T) { &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1234}, "AutoConfig.InitialConfiguration", &expectedRequest, - &agentpb.AutoConfigResponse{}).Return(fmt.Errorf("injected failure")).Once() + &pbautoconf.AutoConfigResponse{}).Return(fmt.Errorf("injected failure")).Once() directRPC.On( "RPC", "dc1", @@ -378,7 +378,7 @@ func TestInitialConfiguration_retries(t *testing.T) { &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 1234}, "AutoConfig.InitialConfiguration", &expectedRequest, - &agentpb.AutoConfigResponse{}).Return(populateResponse) + &pbautoconf.AutoConfigResponse{}).Return(populateResponse) waiter := lib.NewRetryWaiter(2, 0, 1*time.Millisecond, nil) ac, err := New(WithBuilderOpts(builderOpts), WithTLSConfigurator(&tlsutil.Configurator{}), WithDirectRPC(&directRPC), WithRetryWaiter(waiter)) diff --git a/agent/auto-config/config_translate.go b/agent/auto-config/config_translate.go index 2506c7025..fa56fcb57 100644 --- a/agent/auto-config/config_translate.go +++ b/agent/auto-config/config_translate.go @@ -1,16 +1,16 @@ package autoconf import ( - pbconfig "github.com/hashicorp/consul/agent/agentpb/config" + "github.com/hashicorp/consul/proto/pbconfig" ) -// translateAgentConfig is meant to take in a agent/agentpb/config.Config type +// translateAgentConfig is meant to take in a proto/pbconfig.Config type // and craft the corresponding agent/config.Config type. The need for this function // should eventually be removed with the protobuf and normal version converging. // In the meantime, its not desirable to have the flatter Config struct in protobufs // as in the long term we want a configuration with more nested groupings. // -// Why is this function not in the agent/agentpb/config package? The answer, that +// Why is this function not in the proto/pbconfig package? The answer, that // package cannot import the agent/config package without running into import cycles. // // If this function is meant to output an agent/config.Config then why does it output diff --git a/agent/auto-config/config_translate_test.go b/agent/auto-config/config_translate_test.go index 92a0ad162..6ce49474d 100644 --- a/agent/auto-config/config_translate_test.go +++ b/agent/auto-config/config_translate_test.go @@ -4,8 +4,8 @@ import ( "encoding/json" "testing" - pbconfig "github.com/hashicorp/consul/agent/agentpb/config" "github.com/hashicorp/consul/agent/config" + pbconfig "github.com/hashicorp/consul/proto/pbconfig" "github.com/stretchr/testify/require" ) diff --git a/agent/consul/auto_config_endpoint.go b/agent/consul/auto_config_endpoint.go index f55adbcf4..3260157b5 100644 --- a/agent/consul/auto_config_endpoint.go +++ b/agent/consul/auto_config_endpoint.go @@ -6,11 +6,11 @@ import ( "fmt" "github.com/hashicorp/consul/acl" - "github.com/hashicorp/consul/agent/agentpb" - "github.com/hashicorp/consul/agent/agentpb/config" "github.com/hashicorp/consul/agent/consul/authmethod/ssoauth" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/lib/template" + "github.com/hashicorp/consul/proto/pbautoconf" + config "github.com/hashicorp/consul/proto/pbconfig" "github.com/hashicorp/consul/tlsutil" bexpr "github.com/hashicorp/go-bexpr" ) @@ -23,12 +23,12 @@ type AutoConfigOptions struct { type AutoConfigAuthorizer interface { // Authorizes the request and returns a struct containing the various // options for how to generate the configuration. - Authorize(*agentpb.AutoConfigRequest) (AutoConfigOptions, error) + Authorize(*pbautoconf.AutoConfigRequest) (AutoConfigOptions, error) } type disabledAuthorizer struct{} -func (_ *disabledAuthorizer) Authorize(_ *agentpb.AutoConfigRequest) (AutoConfigOptions, error) { +func (_ *disabledAuthorizer) Authorize(_ *pbautoconf.AutoConfigRequest) (AutoConfigOptions, error) { return AutoConfigOptions{}, fmt.Errorf("Auto Config is disabled") } @@ -38,7 +38,7 @@ type jwtAuthorizer struct { claimAssertions []string } -func (a *jwtAuthorizer) Authorize(req *agentpb.AutoConfigRequest) (AutoConfigOptions, error) { +func (a *jwtAuthorizer) Authorize(req *pbautoconf.AutoConfigRequest) (AutoConfigOptions, error) { // perform basic JWT Authorization identity, err := a.validator.ValidateLogin(context.Background(), req.JWT) if err != nil { @@ -257,7 +257,7 @@ var ( // AgentAutoConfig will authorize the incoming request and then generate the configuration // to push down to the client -func (ac *AutoConfig) InitialConfiguration(req *agentpb.AutoConfigRequest, resp *agentpb.AutoConfigResponse) error { +func (ac *AutoConfig) InitialConfiguration(req *pbautoconf.AutoConfigRequest, resp *pbautoconf.AutoConfigResponse) error { // default the datacenter to our datacenter - agents do not have to specify this as they may not // yet know the datacenter name they are going to be in. if req.Datacenter == "" { diff --git a/agent/consul/auto_config_endpoint_test.go b/agent/consul/auto_config_endpoint_test.go index 2bdd4b5bd..927474eb6 100644 --- a/agent/consul/auto_config_endpoint_test.go +++ b/agent/consul/auto_config_endpoint_test.go @@ -11,10 +11,10 @@ import ( "testing" "time" - "github.com/hashicorp/consul/agent/agentpb" - "github.com/hashicorp/consul/agent/agentpb/config" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/internal/go-sso/oidcauth/oidcauthtest" + "github.com/hashicorp/consul/proto/pbautoconf" + "github.com/hashicorp/consul/proto/pbconfig" "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/consul/tlsutil" "github.com/hashicorp/memberlist" @@ -80,9 +80,9 @@ func signJWTWithStandardClaims(t *testing.T, privKey string, claims interface{}) // require running test servers func TestAutoConfigInitialConfiguration(t *testing.T) { type testCase struct { - request agentpb.AutoConfigRequest - expected agentpb.AutoConfigResponse - patchResponse func(t *testing.T, srv *Server, resp *agentpb.AutoConfigResponse) + request pbautoconf.AutoConfigRequest + expected pbautoconf.AutoConfigResponse + patchResponse func(t *testing.T, srv *Server, resp *pbautoconf.AutoConfigResponse) err string } @@ -107,13 +107,13 @@ func TestAutoConfigInitialConfiguration(t *testing.T) { cases := map[string]testCase{ "wrong-datacenter": { - request: agentpb.AutoConfigRequest{ + request: pbautoconf.AutoConfigRequest{ Datacenter: "no-such-dc", }, err: `invalid datacenter "no-such-dc" - agent auto configuration cannot target a remote datacenter`, }, "unverifiable": { - request: agentpb.AutoConfigRequest{ + request: pbautoconf.AutoConfigRequest{ Node: "test-node", // this is signed using an incorrect private key JWT: signJWTWithStandardClaims(t, altpriv, map[string]interface{}{"consul_node_name": "test-node"}), @@ -121,26 +121,26 @@ func TestAutoConfigInitialConfiguration(t *testing.T) { err: "Permission denied: Failed JWT authorization: no known key successfully validated the token signature", }, "claim-assertion-failed": { - request: agentpb.AutoConfigRequest{ + request: pbautoconf.AutoConfigRequest{ Node: "test-node", JWT: signJWTWithStandardClaims(t, priv, map[string]interface{}{"wrong_claim": "test-node"}), }, err: "Permission denied: Failed JWT claim assertion", }, "good": { - request: agentpb.AutoConfigRequest{ + request: pbautoconf.AutoConfigRequest{ Node: "test-node", JWT: signJWTWithStandardClaims(t, priv, map[string]interface{}{"consul_node_name": "test-node"}), }, - expected: agentpb.AutoConfigResponse{ - Config: &config.Config{ + expected: pbautoconf.AutoConfigResponse{ + Config: &pbconfig.Config{ Datacenter: "dc1", PrimaryDatacenter: "dc1", NodeName: "test-node", - AutoEncrypt: &config.AutoEncrypt{ + AutoEncrypt: &pbconfig.AutoEncrypt{ TLS: true, }, - ACL: &config.ACL{ + ACL: &pbconfig.ACL{ Enabled: true, PolicyTTL: "30s", TokenTTL: "30s", @@ -148,18 +148,18 @@ func TestAutoConfigInitialConfiguration(t *testing.T) { DisabledTTL: "0s", DownPolicy: "extend-cache", DefaultPolicy: "deny", - Tokens: &config.ACLTokens{ + Tokens: &pbconfig.ACLTokens{ Agent: "patched-secret", }, }, - Gossip: &config.Gossip{ - Encryption: &config.GossipEncryption{ + Gossip: &pbconfig.Gossip{ + Encryption: &pbconfig.GossipEncryption{ Key: gossipKeyEncoded, VerifyIncoming: true, VerifyOutgoing: true, }, }, - TLS: &config.TLS{ + TLS: &pbconfig.TLS{ VerifyOutgoing: true, VerifyServerHostname: true, MinVersion: "tls12", @@ -167,7 +167,7 @@ func TestAutoConfigInitialConfiguration(t *testing.T) { }, }, }, - patchResponse: func(t *testing.T, srv *Server, resp *agentpb.AutoConfigResponse) { + patchResponse: func(t *testing.T, srv *Server, resp *pbautoconf.AutoConfigResponse) { // we are expecting an ACL token but cannot check anything for equality // so here we check that it was set and overwrite it require.NotNil(t, resp.Config) @@ -250,7 +250,7 @@ func TestAutoConfigInitialConfiguration(t *testing.T) { for testName, tcase := range cases { t.Run(testName, func(t *testing.T) { - var reply agentpb.AutoConfigResponse + var reply pbautoconf.AutoConfigResponse err := msgpackrpc.CallWithCodec(codec, "AutoConfig.InitialConfiguration", &tcase.request, &reply) if tcase.err != "" { testutil.RequireErrorContains(t, err, tcase.err) @@ -269,7 +269,7 @@ func TestAutoConfig_baseConfig(t *testing.T) { type testCase struct { serverConfig Config opts AutoConfigOptions - expected config.Config + expected pbconfig.Config err string } @@ -283,7 +283,7 @@ func TestAutoConfig_baseConfig(t *testing.T) { NodeName: "lBdc0lsH", SegmentName: "HZiwlWpi", }, - expected: config.Config{ + expected: pbconfig.Config{ Datacenter: "oSWzfhnU", PrimaryDatacenter: "53XO9mx4", NodeName: "lBdc0lsH", @@ -305,7 +305,7 @@ func TestAutoConfig_baseConfig(t *testing.T) { config: &tcase.serverConfig, } - var actual config.Config + var actual pbconfig.Config err := ac.baseConfig(tcase.opts, &actual) if tcase.err == "" { require.NoError(t, err) @@ -337,7 +337,7 @@ func TestAutoConfig_updateTLSSettingsInConfig(t *testing.T) { type testCase struct { tlsConfig tlsutil.Config - expected config.Config + expected pbconfig.Config } cases := map[string]testCase{ @@ -350,8 +350,8 @@ func TestAutoConfig_updateTLSSettingsInConfig(t *testing.T) { CAFile: cafile, CipherSuites: parseCiphers(t, "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"), }, - expected: config.Config{ - TLS: &config.TLS{ + expected: pbconfig.Config{ + TLS: &pbconfig.TLS{ VerifyOutgoing: true, VerifyServerHostname: true, MinVersion: "tls12", @@ -369,8 +369,8 @@ func TestAutoConfig_updateTLSSettingsInConfig(t *testing.T) { CAFile: cafile, CipherSuites: parseCiphers(t, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"), }, - expected: config.Config{ - TLS: &config.TLS{ + expected: pbconfig.Config{ + TLS: &pbconfig.TLS{ VerifyOutgoing: true, VerifyServerHostname: false, MinVersion: "tls10", @@ -391,7 +391,7 @@ func TestAutoConfig_updateTLSSettingsInConfig(t *testing.T) { tlsConfigurator: configurator, } - var actual config.Config + var actual pbconfig.Config err = ac.updateTLSSettingsInConfig(AutoConfigOptions{}, &actual) require.NoError(t, err) require.Equal(t, tcase.expected, actual) @@ -402,7 +402,7 @@ func TestAutoConfig_updateTLSSettingsInConfig(t *testing.T) { func TestAutoConfig_updateGossipEncryptionInConfig(t *testing.T) { type testCase struct { conf memberlist.Config - expected config.Config + expected pbconfig.Config } gossipKey := make([]byte, 32) @@ -422,9 +422,9 @@ func TestAutoConfig_updateGossipEncryptionInConfig(t *testing.T) { GossipVerifyIncoming: true, GossipVerifyOutgoing: true, }, - expected: config.Config{ - Gossip: &config.Gossip{ - Encryption: &config.GossipEncryption{ + expected: pbconfig.Config{ + Gossip: &pbconfig.Gossip{ + Encryption: &pbconfig.GossipEncryption{ Key: gossipKeyEncoded, VerifyIncoming: true, VerifyOutgoing: true, @@ -438,9 +438,9 @@ func TestAutoConfig_updateGossipEncryptionInConfig(t *testing.T) { GossipVerifyIncoming: false, GossipVerifyOutgoing: false, }, - expected: config.Config{ - Gossip: &config.Gossip{ - Encryption: &config.GossipEncryption{ + expected: pbconfig.Config{ + Gossip: &pbconfig.Gossip{ + Encryption: &pbconfig.GossipEncryption{ Key: gossipKeyEncoded, VerifyIncoming: false, VerifyOutgoing: false, @@ -463,7 +463,7 @@ func TestAutoConfig_updateGossipEncryptionInConfig(t *testing.T) { config: cfg, } - var actual config.Config + var actual pbconfig.Config err := ac.updateGossipEncryptionInConfig(AutoConfigOptions{}, &actual) require.NoError(t, err) require.Equal(t, tcase.expected, actual) @@ -474,7 +474,7 @@ func TestAutoConfig_updateGossipEncryptionInConfig(t *testing.T) { func TestAutoConfig_updateTLSCertificatesInConfig(t *testing.T) { type testCase struct { serverConfig Config - expected config.Config + expected pbconfig.Config } cases := map[string]testCase{ @@ -483,8 +483,8 @@ func TestAutoConfig_updateTLSCertificatesInConfig(t *testing.T) { ConnectEnabled: true, AutoEncryptAllowTLS: true, }, - expected: config.Config{ - AutoEncrypt: &config.AutoEncrypt{TLS: true}, + expected: pbconfig.Config{ + AutoEncrypt: &pbconfig.AutoEncrypt{TLS: true}, }, }, "auto_encrypt-disabled": { @@ -492,8 +492,8 @@ func TestAutoConfig_updateTLSCertificatesInConfig(t *testing.T) { ConnectEnabled: true, AutoEncryptAllowTLS: false, }, - expected: config.Config{ - AutoEncrypt: &config.AutoEncrypt{TLS: false}, + expected: pbconfig.Config{ + AutoEncrypt: &pbconfig.AutoEncrypt{TLS: false}, }, }, } @@ -504,7 +504,7 @@ func TestAutoConfig_updateTLSCertificatesInConfig(t *testing.T) { config: &tcase.serverConfig, } - var actual config.Config + var actual pbconfig.Config err := ac.updateTLSCertificatesInConfig(AutoConfigOptions{}, &actual) require.NoError(t, err) require.Equal(t, tcase.expected, actual) @@ -515,7 +515,7 @@ func TestAutoConfig_updateTLSCertificatesInConfig(t *testing.T) { func TestAutoConfig_updateACLsInConfig(t *testing.T) { type testCase struct { config Config - expected config.Config + expected pbconfig.Config expectACLToken bool err error } @@ -542,8 +542,8 @@ func TestAutoConfig_updateACLsInConfig(t *testing.T) { ACLEnableKeyListPolicy: true, }, expectACLToken: true, - expected: config.Config{ - ACL: &config.ACL{ + expected: pbconfig.Config{ + ACL: &pbconfig.ACL{ Enabled: true, PolicyTTL: "7s", RoleTTL: "10s", @@ -552,7 +552,7 @@ func TestAutoConfig_updateACLsInConfig(t *testing.T) { DownPolicy: "deny", DefaultPolicy: "allow", EnableKeyListPolicy: true, - Tokens: &config.ACLTokens{ + Tokens: &pbconfig.ACLTokens{ Agent: tokenSecret, }, }, @@ -572,8 +572,8 @@ func TestAutoConfig_updateACLsInConfig(t *testing.T) { ACLEnableKeyListPolicy: true, }, expectACLToken: false, - expected: config.Config{ - ACL: &config.ACL{ + expected: pbconfig.Config{ + ACL: &pbconfig.ACL{ Enabled: false, PolicyTTL: "7s", RoleTTL: "10s", @@ -630,7 +630,7 @@ func TestAutoConfig_updateACLsInConfig(t *testing.T) { ac := AutoConfig{config: &tcase.config, backend: backend} - var actual config.Config + var actual pbconfig.Config err := ac.updateACLsInConfig(AutoConfigOptions{NodeName: "something"}, &actual) if tcase.err != nil { testutil.RequireErrorContains(t, err, tcase.err.Error()) @@ -651,7 +651,7 @@ func TestAutoConfig_updateJoinAddressesInConfig(t *testing.T) { ac := AutoConfig{backend: backend} - var actual config.Config + var actual pbconfig.Config err := ac.updateJoinAddressesInConfig(AutoConfigOptions{}, &actual) require.NoError(t, err) diff --git a/agent/consul/state/acl.go b/agent/consul/state/acl.go index 497d71018..a6ecb2009 100644 --- a/agent/consul/state/acl.go +++ b/agent/consul/state/acl.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/hashicorp/consul/agent/agentpb" "github.com/hashicorp/consul/agent/structs" + pbacl "github.com/hashicorp/consul/proto/pbacl" memdb "github.com/hashicorp/go-memdb" ) @@ -339,7 +339,7 @@ func (s *Store) CanBootstrapACLToken() (bool, uint64, error) { // to update the name. Unlike the older functions to operate specifically on role or policy links // this function does not itself handle the case where the id cannot be found. Instead the // getName function should handle that and return an error if necessary -func resolveACLLinks(tx *txn, links []agentpb.ACLLink, getName func(*txn, string) (string, error)) (int, error) { +func resolveACLLinks(tx *txn, links []pbacl.ACLLink, getName func(*txn, string) (string, error)) (int, error) { var numValid int for linkIndex, link := range links { if link.ID != "" { @@ -365,12 +365,12 @@ func resolveACLLinks(tx *txn, links []agentpb.ACLLink, getName func(*txn, string // associated with the ID of the link. Ideally this will be a no-op if the names are already correct // however if a linked resource was renamed it might be stale. This function will treat the incoming // links with copy-on-write semantics and its output will indicate whether any modifications were made. -func fixupACLLinks(tx *txn, original []agentpb.ACLLink, getName func(*txn, string) (string, error)) ([]agentpb.ACLLink, bool, error) { +func fixupACLLinks(tx *txn, original []pbacl.ACLLink, getName func(*txn, string) (string, error)) ([]pbacl.ACLLink, bool, error) { owned := false links := original - cloneLinks := func(l []agentpb.ACLLink, copyNumLinks int) []agentpb.ACLLink { - clone := make([]agentpb.ACLLink, copyNumLinks) + cloneLinks := func(l []pbacl.ACLLink, copyNumLinks int) []pbacl.ACLLink { + clone := make([]pbacl.ACLLink, copyNumLinks) copy(clone, l[:copyNumLinks]) return clone } @@ -396,7 +396,7 @@ func fixupACLLinks(tx *txn, original []agentpb.ACLLink, getName func(*txn, strin } // append the corrected link - links = append(links, agentpb.ACLLink{ID: link.ID, Name: name}) + links = append(links, pbacl.ACLLink{ID: link.ID, Name: name}) } else if owned { links = append(links, link) } diff --git a/agent/consul/state/acl_test.go b/agent/consul/state/acl_test.go index 24ab96e0e..25a716b26 100644 --- a/agent/consul/state/acl_test.go +++ b/agent/consul/state/acl_test.go @@ -8,9 +8,9 @@ import ( "time" "github.com/hashicorp/consul/acl" - "github.com/hashicorp/consul/agent/agentpb" "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/lib" + pbacl "github.com/hashicorp/consul/proto/pbacl" memdb "github.com/hashicorp/go-memdb" "github.com/hashicorp/go-uuid" "github.com/stretchr/testify/require" @@ -4099,7 +4099,7 @@ func TestStateStore_resolveACLLinks(t *testing.T) { tx := s.db.Txn(false) defer tx.Abort() - links := []agentpb.ACLLink{ + links := []pbacl.ACLLink{ { Name: "foo", }, @@ -4122,7 +4122,7 @@ func TestStateStore_resolveACLLinks(t *testing.T) { tx := s.db.Txn(false) defer tx.Abort() - links := []agentpb.ACLLink{ + links := []pbacl.ACLLink{ { ID: "b985e082-25d3-45a9-9dd8-fd1a41b83b0d", }, @@ -4155,7 +4155,7 @@ func TestStateStore_resolveACLLinks(t *testing.T) { tx := s.db.Txn(false) defer tx.Abort() - links := []agentpb.ACLLink{ + links := []pbacl.ACLLink{ { ID: "b985e082-25d3-45a9-9dd8-fd1a41b83b0d", }, @@ -4175,7 +4175,7 @@ func TestStateStore_resolveACLLinks(t *testing.T) { func TestStateStore_fixupACLLinks(t *testing.T) { t.Parallel() - links := []agentpb.ACLLink{ + links := []pbacl.ACLLink{ { ID: "40b57f86-97ea-40e4-a99a-c399cc81f4dd", Name: "foo", diff --git a/agent/structs/protobuf_compat.go b/agent/structs/protobuf_compat.go index 4ff94fd76..532228826 100644 --- a/agent/structs/protobuf_compat.go +++ b/agent/structs/protobuf_compat.go @@ -5,7 +5,7 @@ import ( ) // QueryOptionsCompat is the interface that both the structs.QueryOptions -// and the agentpb.QueryOptions structs need to implement so that they +// and the proto/pbcommon.QueryOptions structs need to implement so that they // can be operated on interchangeably type QueryOptionsCompat interface { GetToken() string @@ -33,7 +33,7 @@ type QueryOptionsCompat interface { } // QueryMetaCompat is the interface that both the structs.QueryMeta -// and the agentpb.QueryMeta structs need to implement so that they +// and the proto/pbcommon.QueryMeta structs need to implement so that they // can be operated on interchangeably type QueryMetaCompat interface { GetLastContact() time.Duration @@ -47,7 +47,7 @@ type QueryMetaCompat interface { } // GetToken helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetToken() string { if m != nil { return m.Token @@ -56,7 +56,7 @@ func (m *QueryOptions) GetToken() string { } // GetMinQueryIndex helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetMinQueryIndex() uint64 { if m != nil { return m.MinQueryIndex @@ -65,7 +65,7 @@ func (m *QueryOptions) GetMinQueryIndex() uint64 { } // GetMaxQueryTime helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetMaxQueryTime() time.Duration { if m != nil { return m.MaxQueryTime @@ -74,7 +74,7 @@ func (m *QueryOptions) GetMaxQueryTime() time.Duration { } // GetAllowStale helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetAllowStale() bool { if m != nil { return m.AllowStale @@ -83,7 +83,7 @@ func (m *QueryOptions) GetAllowStale() bool { } // GetRequireConsistent helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetRequireConsistent() bool { if m != nil { return m.RequireConsistent @@ -92,7 +92,7 @@ func (m *QueryOptions) GetRequireConsistent() bool { } // GetUseCache helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetUseCache() bool { if m != nil { return m.UseCache @@ -101,7 +101,7 @@ func (m *QueryOptions) GetUseCache() bool { } // GetMaxStaleDuration helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetMaxStaleDuration() time.Duration { if m != nil { return m.MaxStaleDuration @@ -110,7 +110,7 @@ func (m *QueryOptions) GetMaxStaleDuration() time.Duration { } // GetMaxAge helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetMaxAge() time.Duration { if m != nil { return m.MaxAge @@ -119,7 +119,7 @@ func (m *QueryOptions) GetMaxAge() time.Duration { } // GetMustRevalidate helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetMustRevalidate() bool { if m != nil { return m.MustRevalidate @@ -128,7 +128,7 @@ func (m *QueryOptions) GetMustRevalidate() bool { } // GetStaleIfError helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetStaleIfError() time.Duration { if m != nil { return m.StaleIfError @@ -137,7 +137,7 @@ func (m *QueryOptions) GetStaleIfError() time.Duration { } // GetFilter helps implement the QueryOptionsCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryOptions) GetFilter() string { if m != nil { return m.Filter @@ -146,67 +146,67 @@ func (m *QueryOptions) GetFilter() string { } // SetToken is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetToken(token string) { q.Token = token } // SetMinQueryIndex is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetMinQueryIndex(minQueryIndex uint64) { q.MinQueryIndex = minQueryIndex } // SetMaxQueryTime is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetMaxQueryTime(maxQueryTime time.Duration) { q.MaxQueryTime = maxQueryTime } // SetAllowStale is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetAllowStale(allowStale bool) { q.AllowStale = allowStale } // SetRequireConsistent is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetRequireConsistent(requireConsistent bool) { q.RequireConsistent = requireConsistent } // SetUseCache is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetUseCache(useCache bool) { q.UseCache = useCache } // SetMaxStaleDuration is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetMaxStaleDuration(maxStaleDuration time.Duration) { q.MaxStaleDuration = maxStaleDuration } // SetMaxAge is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetMaxAge(maxAge time.Duration) { q.MaxAge = maxAge } // SetMustRevalidate is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetMustRevalidate(mustRevalidate bool) { q.MustRevalidate = mustRevalidate } // SetStaleIfError is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetStaleIfError(staleIfError time.Duration) { q.StaleIfError = staleIfError } // SetFilter is needed to implement the structs.QueryOptionsCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryOptions) SetFilter(filter string) { q.Filter = filter } @@ -220,7 +220,7 @@ func (m *QueryMeta) GetIndex() uint64 { } // GetLastContact helps implement the QueryMetaCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryMeta) GetLastContact() time.Duration { if m != nil { return m.LastContact @@ -229,7 +229,7 @@ func (m *QueryMeta) GetLastContact() time.Duration { } // GetKnownLeader helps implement the QueryMetaCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryMeta) GetKnownLeader() bool { if m != nil { return m.KnownLeader @@ -238,7 +238,7 @@ func (m *QueryMeta) GetKnownLeader() bool { } // GetConsistencyLevel helps implement the QueryMetaCompat interface -// Copied from agent/agentpb/common.pb.go +// Copied from proto/pbcommon/common.pb.go func (m *QueryMeta) GetConsistencyLevel() string { if m != nil { return m.ConsistencyLevel @@ -247,25 +247,25 @@ func (m *QueryMeta) GetConsistencyLevel() string { } // SetLastContact is needed to implement the structs.QueryMetaCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryMeta) SetLastContact(lastContact time.Duration) { q.LastContact = lastContact } // SetKnownLeader is needed to implement the structs.QueryMetaCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryMeta) SetKnownLeader(knownLeader bool) { q.KnownLeader = knownLeader } // SetIndex is needed to implement the structs.QueryMetaCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryMeta) SetIndex(index uint64) { q.Index = index } // SetConsistencyLevel is needed to implement the structs.QueryMetaCompat interface -// Copied from agent/agentpb/common.go +// Copied from proto/pbcommon/common.go func (q *QueryMeta) SetConsistencyLevel(consistencyLevel string) { q.ConsistencyLevel = consistencyLevel } diff --git a/agent/agentpb/acl.pb.binary.go b/proto/pbacl/acl.pb.binary.go similarity index 89% rename from agent/agentpb/acl.pb.binary.go rename to proto/pbacl/acl.pb.binary.go index 3c322a49a..173901eb7 100644 --- a/agent/agentpb/acl.pb.binary.go +++ b/proto/pbacl/acl.pb.binary.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-binary. DO NOT EDIT. -// source: acl.proto +// source: proto/pbacl/acl.proto -package agentpb +package pbacl import ( "github.com/golang/protobuf/proto" diff --git a/agent/agentpb/acl.pb.go b/proto/pbacl/acl.pb.go similarity index 83% rename from agent/agentpb/acl.pb.go rename to proto/pbacl/acl.pb.go index b30a5a795..e50822028 100644 --- a/agent/agentpb/acl.pb.go +++ b/proto/pbacl/acl.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: acl.proto +// source: proto/pbacl/acl.proto -package agentpb +package pbacl import ( fmt "fmt" @@ -31,7 +31,7 @@ func (m *ACLLink) Reset() { *m = ACLLink{} } func (m *ACLLink) String() string { return proto.CompactTextString(m) } func (*ACLLink) ProtoMessage() {} func (*ACLLink) Descriptor() ([]byte, []int) { - return fileDescriptor_a452f070aeef01eb, []int{0} + return fileDescriptor_ad2d2c73a6a0d8b5, []int{0} } func (m *ACLLink) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -61,23 +61,26 @@ func (m *ACLLink) XXX_DiscardUnknown() { var xxx_messageInfo_ACLLink proto.InternalMessageInfo func init() { - proto.RegisterType((*ACLLink)(nil), "agentpb.ACLLink") + proto.RegisterType((*ACLLink)(nil), "acl.ACLLink") } -func init() { proto.RegisterFile("acl.proto", fileDescriptor_a452f070aeef01eb) } +func init() { proto.RegisterFile("proto/pbacl/acl.proto", fileDescriptor_ad2d2c73a6a0d8b5) } -var fileDescriptor_a452f070aeef01eb = []byte{ - // 159 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x4c, 0xce, 0xd1, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4f, 0x4c, 0x4f, 0xcd, 0x2b, 0x29, 0x48, 0x92, 0x12, - 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xe9, 0x83, 0x58, 0x10, 0x69, 0x25, 0x07, 0x2e, 0x76, 0x47, - 0x67, 0x1f, 0x9f, 0xcc, 0xbc, 0x6c, 0x21, 0x3e, 0x2e, 0x26, 0x4f, 0x17, 0x09, 0x46, 0x05, 0x46, - 0x0d, 0xce, 0x20, 0x26, 0x4f, 0x17, 0x21, 0x55, 0x2e, 0x16, 0xbf, 0xc4, 0xdc, 0x54, 0x09, 0x26, - 0x90, 0x88, 0x93, 0xe0, 0xa7, 0x7b, 0xf2, 0xbc, 0x19, 0x89, 0xc5, 0x19, 0x56, 0x4a, 0x99, 0xe9, - 0x79, 0xf9, 0x45, 0xa9, 0x4a, 0x41, 0x60, 0x69, 0x27, 0x85, 0x13, 0x0f, 0xe5, 0x18, 0x4e, 0x3c, - 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x66, - 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x24, 0x36, 0xb0, 0x55, - 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0e, 0xc8, 0xbd, 0xdf, 0x96, 0x00, 0x00, 0x00, +var fileDescriptor_ad2d2c73a6a0d8b5 = []byte{ + // 193 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0x28, 0xca, 0x2f, + 0xc9, 0xd7, 0x2f, 0x48, 0x4a, 0x4c, 0xce, 0xd1, 0x4f, 0x4c, 0xce, 0xd1, 0x03, 0xf3, 0x85, 0x98, + 0x13, 0x93, 0x73, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0x21, 0xf2, 0x20, 0x16, 0x44, 0x4a, 0xc9, + 0x81, 0x8b, 0xdd, 0xd1, 0xd9, 0xc7, 0x27, 0x33, 0x2f, 0x5b, 0x88, 0x8f, 0x8b, 0xc9, 0xd3, 0x45, + 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x88, 0xc9, 0xd3, 0x45, 0x48, 0x95, 0x8b, 0xc5, 0x2f, 0x31, + 0x37, 0x55, 0x82, 0x09, 0x24, 0xe2, 0x24, 0xf8, 0xe9, 0x9e, 0x3c, 0x6f, 0x46, 0x62, 0x71, 0x86, + 0x95, 0x52, 0x66, 0x7a, 0x5e, 0x7e, 0x51, 0xaa, 0x52, 0x10, 0x58, 0xda, 0xc9, 0xf3, 0xc4, 0x43, + 0x39, 0x86, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, + 0x63, 0x39, 0x86, 0x19, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, + 0x4a, 0x3d, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x64, 0x42, 0x66, + 0x72, 0x7e, 0x51, 0x81, 0x7e, 0x72, 0x7e, 0x5e, 0x71, 0x69, 0x8e, 0x3e, 0x92, 0x8b, 0x93, 0xd8, + 0xc0, 0x1c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x29, 0x0f, 0xd4, 0xf1, 0xc7, 0x00, 0x00, + 0x00, } func (m *ACLLink) Marshal() (dAtA []byte, err error) { diff --git a/agent/agentpb/acl.proto b/proto/pbacl/acl.proto similarity index 89% rename from agent/agentpb/acl.proto rename to proto/pbacl/acl.proto index aab4deb29..60cfefb3d 100644 --- a/agent/agentpb/acl.proto +++ b/proto/pbacl/acl.proto @@ -1,6 +1,9 @@ syntax = "proto3"; -package agentpb; +package acl; + +option go_package = "github.com/hashicorp/consul/proto/pbacl"; + // Go Modules now includes the version in the filepath for packages within GOPATH/pkg/mode // Therefore unless we want to hardcode a version here like diff --git a/agent/agentpb/auto_config.go b/proto/pbautoconf/auto_config.go similarity index 95% rename from agent/agentpb/auto_config.go rename to proto/pbautoconf/auto_config.go index 10697ab09..00b788b61 100644 --- a/agent/agentpb/auto_config.go +++ b/proto/pbautoconf/auto_config.go @@ -1,4 +1,4 @@ -package agentpb +package pbautoconf func (req *AutoConfigRequest) RequestDatacenter() string { return req.Datacenter diff --git a/agent/agentpb/auto_config.pb.binary.go b/proto/pbautoconf/auto_config.pb.binary.go similarity index 91% rename from agent/agentpb/auto_config.pb.binary.go rename to proto/pbautoconf/auto_config.pb.binary.go index 8339aaa54..20b68242a 100644 --- a/agent/agentpb/auto_config.pb.binary.go +++ b/proto/pbautoconf/auto_config.pb.binary.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-binary. DO NOT EDIT. -// source: agent/agentpb/auto_config.proto +// source: proto/pbautoconf/auto_config.proto -package agentpb +package pbautoconf import ( "github.com/golang/protobuf/proto" diff --git a/agent/agentpb/auto_config.pb.go b/proto/pbautoconf/auto_config.pb.go similarity index 87% rename from agent/agentpb/auto_config.pb.go rename to proto/pbautoconf/auto_config.pb.go index 1cd7ad935..f354153c5 100644 --- a/agent/agentpb/auto_config.pb.go +++ b/proto/pbautoconf/auto_config.pb.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: agent/agentpb/auto_config.proto +// source: proto/pbautoconf/auto_config.proto -package agentpb +package pbautoconf import ( fmt "fmt" proto "github.com/golang/protobuf/proto" - config "github.com/hashicorp/consul/agent/agentpb/config" + pbconfig "github.com/hashicorp/consul/proto/pbconfig" io "io" math "math" ) @@ -49,7 +49,7 @@ func (m *AutoConfigRequest) Reset() { *m = AutoConfigRequest{} } func (m *AutoConfigRequest) String() string { return proto.CompactTextString(m) } func (*AutoConfigRequest) ProtoMessage() {} func (*AutoConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c842365210d144b0, []int{0} + return fileDescriptor_ccc5af992e5daf69, []int{0} } func (m *AutoConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,17 +115,17 @@ func (m *AutoConfigRequest) GetConsulToken() string { // AutoConfigResponse is the data structure sent in response to a AutoConfig.InitialConfiguration request type AutoConfigResponse struct { - Config *config.Config `protobuf:"bytes,1,opt,name=Config,proto3" json:"Config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Config *pbconfig.Config `protobuf:"bytes,1,opt,name=Config,proto3" json:"Config,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AutoConfigResponse) Reset() { *m = AutoConfigResponse{} } func (m *AutoConfigResponse) String() string { return proto.CompactTextString(m) } func (*AutoConfigResponse) ProtoMessage() {} func (*AutoConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c842365210d144b0, []int{1} + return fileDescriptor_ccc5af992e5daf69, []int{1} } func (m *AutoConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -154,7 +154,7 @@ func (m *AutoConfigResponse) XXX_DiscardUnknown() { var xxx_messageInfo_AutoConfigResponse proto.InternalMessageInfo -func (m *AutoConfigResponse) GetConfig() *config.Config { +func (m *AutoConfigResponse) GetConfig() *pbconfig.Config { if m != nil { return m.Config } @@ -162,31 +162,30 @@ func (m *AutoConfigResponse) GetConfig() *config.Config { } func init() { - proto.RegisterType((*AutoConfigRequest)(nil), "agentpb.AutoConfigRequest") - proto.RegisterType((*AutoConfigResponse)(nil), "agentpb.AutoConfigResponse") + proto.RegisterType((*AutoConfigRequest)(nil), "autoconf.AutoConfigRequest") + proto.RegisterType((*AutoConfigResponse)(nil), "autoconf.AutoConfigResponse") } -func init() { proto.RegisterFile("agent/agentpb/auto_config.proto", fileDescriptor_c842365210d144b0) } +func init() { proto.RegisterFile("proto/pbautoconf/auto_config.proto", fileDescriptor_ccc5af992e5daf69) } -var fileDescriptor_c842365210d144b0 = []byte{ - // 258 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0x4c, 0x4f, 0xcd, - 0x2b, 0xd1, 0x07, 0x93, 0x05, 0x49, 0xfa, 0x89, 0xa5, 0x25, 0xf9, 0xf1, 0xc9, 0xf9, 0x79, 0x69, - 0x99, 0xe9, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xec, 0x50, 0x29, 0x29, 0x45, 0x54, 0x95, - 0x10, 0x45, 0xfa, 0xc8, 0x6a, 0x95, 0xa6, 0x32, 0x72, 0x09, 0x3a, 0x96, 0x96, 0xe4, 0x3b, 0x83, - 0x05, 0x83, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0xe4, 0xb8, 0xb8, 0x5c, 0x12, 0x4b, 0x12, - 0x93, 0x53, 0xf3, 0x4a, 0x52, 0x8b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x90, 0x44, 0x84, - 0x84, 0xb8, 0x58, 0xfc, 0xf2, 0x53, 0x52, 0x25, 0x98, 0xc0, 0x32, 0x60, 0xb6, 0x90, 0x04, 0x17, - 0x7b, 0x70, 0x6a, 0x7a, 0x6e, 0x6a, 0x5e, 0x89, 0x04, 0x0b, 0x58, 0x18, 0xc6, 0x15, 0x12, 0xe0, - 0x62, 0xf6, 0x0a, 0x0f, 0x91, 0x60, 0x05, 0x8b, 0x82, 0x98, 0x42, 0x0a, 0x5c, 0xdc, 0xce, 0xf9, - 0x79, 0xc5, 0xa5, 0x39, 0x21, 0xf9, 0xd9, 0xa9, 0x79, 0x12, 0x6c, 0x60, 0x19, 0x64, 0x21, 0x25, - 0x1b, 0x2e, 0x21, 0x64, 0x67, 0x15, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0xa9, 0x71, 0xb1, 0x41, - 0x44, 0xc0, 0x6e, 0xe2, 0x36, 0xe2, 0xd3, 0x83, 0x7a, 0x06, 0xaa, 0x0e, 0x2a, 0xeb, 0x64, 0x7d, - 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xce, 0x78, 0x2c, 0xc7, - 0x10, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x91, 0x58, - 0x9c, 0x91, 0x99, 0x9c, 0x5f, 0x54, 0x00, 0x0a, 0x8a, 0xe2, 0xd2, 0x1c, 0x7d, 0x94, 0x60, 0x4a, - 0x62, 0x03, 0x87, 0x8c, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x8c, 0xf1, 0x75, 0x68, 0x01, - 0x00, 0x00, +var fileDescriptor_ccc5af992e5daf69 = []byte{ + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2a, 0x28, 0xca, 0x2f, + 0xc9, 0xd7, 0x2f, 0x48, 0x4a, 0x2c, 0x2d, 0xc9, 0x4f, 0xce, 0xcf, 0x4b, 0xd3, 0x07, 0x31, 0xe2, + 0x41, 0xac, 0xcc, 0x74, 0x3d, 0xb0, 0xa4, 0x10, 0x07, 0x4c, 0x4e, 0x4a, 0x1a, 0xa6, 0x1a, 0x22, + 0xaf, 0x8f, 0xac, 0x4c, 0x69, 0x2a, 0x23, 0x97, 0xa0, 0x63, 0x69, 0x49, 0xbe, 0x33, 0x58, 0x30, + 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, 0x8e, 0x8b, 0xcb, 0x25, 0xb1, 0x24, 0x31, 0x39, + 0x35, 0xaf, 0x24, 0xb5, 0x48, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0x49, 0x44, 0x48, 0x88, + 0x8b, 0xc5, 0x2f, 0x3f, 0x25, 0x55, 0x82, 0x09, 0x2c, 0x03, 0x66, 0x0b, 0x49, 0x70, 0xb1, 0x07, + 0xa7, 0xa6, 0xe7, 0xa6, 0xe6, 0x95, 0x48, 0xb0, 0x80, 0x85, 0x61, 0x5c, 0x21, 0x01, 0x2e, 0x66, + 0xaf, 0xf0, 0x10, 0x09, 0x56, 0xb0, 0x28, 0x88, 0x29, 0xa4, 0xc0, 0xc5, 0xed, 0x9c, 0x9f, 0x57, + 0x5c, 0x9a, 0x13, 0x92, 0x9f, 0x9d, 0x9a, 0x27, 0xc1, 0x06, 0x96, 0x41, 0x16, 0x52, 0xb2, 0xe1, + 0x12, 0x42, 0x76, 0x56, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0x90, 0x1a, 0x17, 0x1b, 0x44, 0x04, + 0xec, 0x26, 0x6e, 0x23, 0x3e, 0x3d, 0xa8, 0x67, 0xa0, 0xea, 0xa0, 0xb2, 0x4e, 0x76, 0x27, 0x1e, + 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8c, 0xc7, 0x72, 0x0c, 0x51, + 0x3a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x19, 0x89, 0xc5, 0x19, + 0x99, 0xc9, 0xf9, 0x45, 0x05, 0xa0, 0xa0, 0x28, 0x2e, 0xcd, 0xd1, 0x47, 0x0f, 0xce, 0x24, 0x36, + 0xb0, 0x88, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x46, 0x7e, 0xde, 0xed, 0x69, 0x01, 0x00, 0x00, } func (m *AutoConfigRequest) Marshal() (dAtA []byte, err error) { @@ -614,7 +613,7 @@ func (m *AutoConfigResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Config == nil { - m.Config = &config.Config{} + m.Config = &pbconfig.Config{} } if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/agent/agentpb/auto_config.proto b/proto/pbautoconf/auto_config.proto similarity index 89% rename from agent/agentpb/auto_config.proto rename to proto/pbautoconf/auto_config.proto index deb24218b..979edf23d 100644 --- a/agent/agentpb/auto_config.proto +++ b/proto/pbautoconf/auto_config.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package agentpb; +package autoconf; -option go_package = "github.com/hashicorp/consul/agent/agentpb"; +option go_package = "github.com/hashicorp/consul/proto/pbautoconf"; -import "agent/agentpb/config/config.proto"; +import "proto/pbconfig/config.proto"; // AutoConfigRequest is the data structure to be sent along with the // AutoConfig.InitialConfiguration RPC diff --git a/agent/agentpb/common.go b/proto/pbcommon/common.go similarity index 99% rename from agent/agentpb/common.go rename to proto/pbcommon/common.go index ff7dd955c..e6e981ccf 100644 --- a/agent/agentpb/common.go +++ b/proto/pbcommon/common.go @@ -1,4 +1,4 @@ -package agentpb +package pbcommon import ( "time" diff --git a/agent/agentpb/common.pb.binary.go b/proto/pbcommon/common.pb.binary.go similarity index 96% rename from agent/agentpb/common.pb.binary.go rename to proto/pbcommon/common.pb.binary.go index 0e242a698..bce5619ca 100644 --- a/agent/agentpb/common.pb.binary.go +++ b/proto/pbcommon/common.pb.binary.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-binary. DO NOT EDIT. -// source: common.proto +// source: proto/pbcommon/common.proto -package agentpb +package pbcommon import ( "github.com/golang/protobuf/proto" diff --git a/agent/agentpb/common.pb.go b/proto/pbcommon/common.pb.go similarity index 90% rename from agent/agentpb/common.pb.go rename to proto/pbcommon/common.pb.go index 1108af870..b292733df 100644 --- a/agent/agentpb/common.pb.go +++ b/proto/pbcommon/common.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: common.proto +// source: proto/pbcommon/common.proto -package agentpb +package pbcommon import ( fmt "fmt" @@ -37,7 +37,7 @@ func (m *RaftIndex) Reset() { *m = RaftIndex{} } func (m *RaftIndex) String() string { return proto.CompactTextString(m) } func (*RaftIndex) ProtoMessage() {} func (*RaftIndex) Descriptor() ([]byte, []int) { - return fileDescriptor_555bd8c177793206, []int{0} + return fileDescriptor_a6f5ac44994d718c, []int{0} } func (m *RaftIndex) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,7 +76,7 @@ func (m *TargetDatacenter) Reset() { *m = TargetDatacenter{} } func (m *TargetDatacenter) String() string { return proto.CompactTextString(m) } func (*TargetDatacenter) ProtoMessage() {} func (*TargetDatacenter) Descriptor() ([]byte, []int) { - return fileDescriptor_555bd8c177793206, []int{1} + return fileDescriptor_a6f5ac44994d718c, []int{1} } func (m *TargetDatacenter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,7 +115,7 @@ func (m *WriteRequest) Reset() { *m = WriteRequest{} } func (m *WriteRequest) String() string { return proto.CompactTextString(m) } func (*WriteRequest) ProtoMessage() {} func (*WriteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_555bd8c177793206, []int{2} + return fileDescriptor_a6f5ac44994d718c, []int{2} } func (m *WriteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -208,7 +208,7 @@ func (m *QueryOptions) Reset() { *m = QueryOptions{} } func (m *QueryOptions) String() string { return proto.CompactTextString(m) } func (*QueryOptions) ProtoMessage() {} func (*QueryOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_555bd8c177793206, []int{3} + return fileDescriptor_a6f5ac44994d718c, []int{3} } func (m *QueryOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -335,7 +335,7 @@ func (m *QueryMeta) Reset() { *m = QueryMeta{} } func (m *QueryMeta) String() string { return proto.CompactTextString(m) } func (*QueryMeta) ProtoMessage() {} func (*QueryMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_555bd8c177793206, []int{4} + return fileDescriptor_a6f5ac44994d718c, []int{4} } func (m *QueryMeta) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -393,51 +393,53 @@ func (m *QueryMeta) GetConsistencyLevel() string { } func init() { - proto.RegisterType((*RaftIndex)(nil), "agentpb.RaftIndex") - proto.RegisterType((*TargetDatacenter)(nil), "agentpb.TargetDatacenter") - proto.RegisterType((*WriteRequest)(nil), "agentpb.WriteRequest") - proto.RegisterType((*QueryOptions)(nil), "agentpb.QueryOptions") - proto.RegisterType((*QueryMeta)(nil), "agentpb.QueryMeta") + proto.RegisterType((*RaftIndex)(nil), "common.RaftIndex") + proto.RegisterType((*TargetDatacenter)(nil), "common.TargetDatacenter") + proto.RegisterType((*WriteRequest)(nil), "common.WriteRequest") + proto.RegisterType((*QueryOptions)(nil), "common.QueryOptions") + proto.RegisterType((*QueryMeta)(nil), "common.QueryMeta") } -func init() { proto.RegisterFile("common.proto", fileDescriptor_555bd8c177793206) } +func init() { proto.RegisterFile("proto/pbcommon/common.proto", fileDescriptor_a6f5ac44994d718c) } -var fileDescriptor_555bd8c177793206 = []byte{ - // 538 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xc1, 0x6e, 0xd3, 0x40, - 0x14, 0xb4, 0x21, 0x4d, 0xe3, 0x97, 0x14, 0x85, 0x55, 0x85, 0x4c, 0x0e, 0x4e, 0x64, 0x21, 0x14, - 0x55, 0x90, 0x48, 0xe5, 0x56, 0x4e, 0x4d, 0x5a, 0x50, 0x45, 0xac, 0x8a, 0x25, 0x88, 0xf3, 0x26, - 0x79, 0x31, 0x16, 0xce, 0x6e, 0x58, 0x6f, 0xda, 0xe4, 0x0f, 0x38, 0x72, 0xac, 0x38, 0xf1, 0x21, - 0x7c, 0x40, 0x8e, 0x3d, 0x72, 0x2a, 0x90, 0xfc, 0x01, 0x5f, 0x80, 0xbc, 0x76, 0x8a, 0x4b, 0x7a, - 0x08, 0x37, 0xcf, 0x78, 0x66, 0x77, 0xf6, 0xbd, 0x81, 0x52, 0x5f, 0x8c, 0x46, 0x82, 0x37, 0xc6, - 0x52, 0x28, 0x41, 0xb6, 0x99, 0x8f, 0x5c, 0x8d, 0x7b, 0x15, 0xc7, 0x17, 0xc2, 0x0f, 0xb1, 0xa9, - 0xe9, 0xde, 0x64, 0xd8, 0x1c, 0x4c, 0x24, 0x53, 0xc1, 0x4a, 0x58, 0xd9, 0xf5, 0x85, 0x2f, 0xf4, - 0x67, 0x33, 0xfe, 0x4a, 0x58, 0x77, 0x04, 0x16, 0x65, 0x43, 0x75, 0xc2, 0x07, 0x38, 0x25, 0x4d, - 0x28, 0xb6, 0x25, 0x32, 0x85, 0x1a, 0xda, 0x66, 0xcd, 0xac, 0xe7, 0x5a, 0x3b, 0xbf, 0xaf, 0xaa, - 0x56, 0x0f, 0xa7, 0x63, 0x79, 0xe0, 0x3e, 0x75, 0x69, 0x56, 0x11, 0x1b, 0x3c, 0x31, 0x08, 0x86, - 0xb3, 0xc4, 0x70, 0xe7, 0x56, 0x43, 0x46, 0xe1, 0xee, 0x43, 0xb9, 0xcb, 0xa4, 0x8f, 0xea, 0x88, - 0x29, 0xd6, 0x47, 0xae, 0x50, 0x12, 0x07, 0xe0, 0x2f, 0xd2, 0x97, 0x5a, 0x34, 0xc3, 0xb8, 0x7b, - 0x50, 0x7a, 0x27, 0x03, 0x85, 0x14, 0x3f, 0x4e, 0x30, 0x52, 0x64, 0x17, 0xb6, 0xba, 0xe2, 0x03, - 0xf2, 0x54, 0x9a, 0x80, 0x83, 0xdc, 0xa7, 0xaf, 0x55, 0xd3, 0xfd, 0x92, 0x83, 0xd2, 0xeb, 0x09, - 0xca, 0xd9, 0xe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xb4, 0x1c, 0xdf, 0x4c, 0xb0, 0xf4, 0x52, 0x3c, - 0x54, 0x2c, 0x6e, 0x46, 0xa6, 0xe6, 0x34, 0x01, 0xe4, 0x18, 0x8a, 0x1d, 0x16, 0xa9, 0xb6, 0xe0, - 0x8a, 0xf5, 0x95, 0xee, 0xc5, 0x86, 0x49, 0xb2, 0x3e, 0x52, 0x83, 0xe2, 0x2b, 0x2e, 0xce, 0x79, - 0x07, 0xd9, 0x00, 0xa5, 0x6e, 0x4e, 0x81, 0x66, 0x29, 0xb2, 0x07, 0xe5, 0xeb, 0x9d, 0xf6, 0x67, - 0x1d, 0x3c, 0xc3, 0x50, 0x37, 0xc3, 0xa2, 0x6b, 0x7c, 0x12, 0xbf, 0x55, 0x9b, 0xff, 0x72, 0x8c, - 0xf9, 0xc2, 0x31, 0x2f, 0x17, 0x8e, 0xf9, 0x73, 0xe1, 0x98, 0x9f, 0x97, 0x8e, 0x71, 0xb1, 0x74, - 0x8c, 0xcb, 0xa5, 0x63, 0x7c, 0x5f, 0x3a, 0x46, 0x2f, 0xaf, 0xf3, 0x3d, 0xfb, 0x13, 0x00, 0x00, - 0xff, 0xff, 0x1c, 0x85, 0xfc, 0x3b, 0x22, 0x04, 0x00, 0x00, +var fileDescriptor_a6f5ac44994d718c = []byte{ + // 569 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x8f, 0xd2, 0x40, + 0x18, 0x6d, 0x95, 0x45, 0xfa, 0xc1, 0x1a, 0x9c, 0x6c, 0x4c, 0xc5, 0xa4, 0x90, 0xc6, 0x18, 0x42, + 0x94, 0x26, 0xeb, 0x6d, 0x3d, 0x2d, 0xec, 0x6a, 0x36, 0xd2, 0x6c, 0xac, 0x18, 0x13, 0x6f, 0x43, + 0xf9, 0x28, 0x8d, 0xa5, 0x83, 0xd3, 0xe9, 0x2e, 0xfc, 0x03, 0x8f, 0x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, 0xf2, 0xba, 0x97, 0x68, 0x59, 0x8e, 0x6f, + 0x2a, 0x68, 0xf2, 0x52, 0x6c, 0x14, 0x34, 0x69, 0x46, 0xa6, 0xe6, 0x4e, 0x0a, 0xc8, 0x31, 0x14, + 0x3b, 0x34, 0x12, 0x6d, 0x16, 0x0a, 0xea, 0x0a, 0xd9, 0x8b, 0x2d, 0x93, 0x64, 0x7d, 0xa4, 0x06, + 0xc5, 0x57, 0x21, 0x3b, 0x0f, 0x3b, 0x48, 0xfb, 0xc8, 0x65, 0x73, 0x0a, 0x4e, 0x96, 0x22, 0x0d, + 0x28, 0x5f, 0xdf, 0xa9, 0x3b, 0xed, 0xe0, 0x19, 0x06, 0xb2, 0x19, 0x9a, 0xb3, 0xc1, 0xa7, 0xf1, + 0x5b, 0x9d, 0xd9, 0x2f, 0x43, 0x99, 0xcd, 0x0d, 0xf5, 0x72, 0x6e, 0xa8, 0x3f, 0xe7, 0x86, 0xfa, + 0x79, 0x61, 0x28, 0x17, 0x0b, 0x43, 0xb9, 0x5c, 0x18, 0xca, 0xf7, 0x85, 0xa1, 0xbc, 0x6f, 0x78, + 0xbe, 0x18, 0xc6, 0xbd, 0xa6, 0xcb, 0x46, 0xd6, 0x90, 0x46, 0x43, 0xdf, 0x65, 0x7c, 0x6c, 0xb9, + 0x2c, 0x8c, 0xe2, 0xc0, 0x5a, 0xff, 0x87, 0xf4, 0xf2, 0x12, 0x3f, 0xfb, 0x13, 0x00, 0x00, 0xff, + 0xff, 0x33, 0x18, 0xfc, 0x09, 0x5c, 0x04, 0x00, 0x00, } func (m *RaftIndex) Marshal() (dAtA []byte, err error) { diff --git a/agent/agentpb/common.proto b/proto/pbcommon/common.proto similarity index 98% rename from agent/agentpb/common.proto rename to proto/pbcommon/common.proto index 80c43c6fb..4b8dafce6 100644 --- a/agent/agentpb/common.proto +++ b/proto/pbcommon/common.proto @@ -1,6 +1,8 @@ syntax = "proto3"; -package agentpb; +package common; + +option go_package = "github.com/hashicorp/consul/proto/pbcommon"; import "google/protobuf/duration.proto"; // Go Modules now includes the version in the filepath for packages within GOPATH/pkg/mode diff --git a/proto/pbcommon/common_oss.pb.binary.go b/proto/pbcommon/common_oss.pb.binary.go new file mode 100644 index 000000000..649eefb04 --- /dev/null +++ b/proto/pbcommon/common_oss.pb.binary.go @@ -0,0 +1,20 @@ +// +build !consulent + +// Code generated by protoc-gen-go-binary. DO NOT EDIT. +// source: proto/pbcommon/common_oss.proto + +package pbcommon + +import ( + "github.com/golang/protobuf/proto" +) + +// MarshalBinary implements encoding.BinaryMarshaler +func (msg *EnterpriseMeta) MarshalBinary() ([]byte, error) { + return proto.Marshal(msg) +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler +func (msg *EnterpriseMeta) UnmarshalBinary(b []byte) error { + return proto.Unmarshal(b, msg) +} diff --git a/proto/pbcommon/common_oss.pb.go b/proto/pbcommon/common_oss.pb.go new file mode 100644 index 000000000..5df90b2f1 --- /dev/null +++ b/proto/pbcommon/common_oss.pb.go @@ -0,0 +1,301 @@ +// +build !consulent + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: proto/pbcommon/common_oss.proto + +package pbcommon + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + io "io" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// 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 + +type EnterpriseMeta struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnterpriseMeta) Reset() { *m = EnterpriseMeta{} } +func (m *EnterpriseMeta) String() string { return proto.CompactTextString(m) } +func (*EnterpriseMeta) ProtoMessage() {} +func (*EnterpriseMeta) Descriptor() ([]byte, []int) { + return fileDescriptor_8f9d7cd54dd4e173, []int{0} +} +func (m *EnterpriseMeta) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnterpriseMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnterpriseMeta.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnterpriseMeta) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnterpriseMeta.Merge(m, src) +} +func (m *EnterpriseMeta) XXX_Size() int { + return m.Size() +} +func (m *EnterpriseMeta) XXX_DiscardUnknown() { + xxx_messageInfo_EnterpriseMeta.DiscardUnknown(m) +} + +var xxx_messageInfo_EnterpriseMeta proto.InternalMessageInfo + +func init() { + proto.RegisterType((*EnterpriseMeta)(nil), "common.EnterpriseMeta") +} + +func init() { proto.RegisterFile("proto/pbcommon/common_oss.proto", fileDescriptor_8f9d7cd54dd4e173) } + +var fileDescriptor_8f9d7cd54dd4e173 = []byte{ + // 127 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0x28, 0xca, 0x2f, + 0xc9, 0xd7, 0x2f, 0x48, 0x4a, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0xd3, 0x87, 0x50, 0xf1, 0xf9, 0xc5, + 0xc5, 0x7a, 0x60, 0x19, 0x21, 0x36, 0x88, 0x88, 0x92, 0x00, 0x17, 0x9f, 0x6b, 0x5e, 0x49, 0x6a, + 0x51, 0x41, 0x51, 0x66, 0x71, 0xaa, 0x6f, 0x6a, 0x49, 0xa2, 0x93, 0xcd, 0x89, 0x47, 0x72, 0x8c, + 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x56, 0x7a, + 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x46, 0x62, 0x71, 0x46, 0x66, 0x72, + 0x7e, 0x51, 0x81, 0x7e, 0x72, 0x7e, 0x5e, 0x71, 0x69, 0x8e, 0x3e, 0xaa, 0x45, 0x49, 0x6c, 0x60, + 0xbe, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x9b, 0x6f, 0x83, 0x81, 0x00, 0x00, 0x00, +} + +func (m *EnterpriseMeta) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnterpriseMeta) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func encodeVarintCommonOss(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *EnterpriseMeta) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovCommonOss(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozCommonOss(x uint64) (n int) { + return sovCommonOss(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EnterpriseMeta) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommonOss + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EnterpriseMeta: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EnterpriseMeta: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipCommonOss(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCommonOss + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCommonOss + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCommonOss(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCommonOss + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCommonOss + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCommonOss + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthCommonOss + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthCommonOss + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCommonOss + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipCommonOss(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthCommonOss + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthCommonOss = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCommonOss = fmt.Errorf("proto: integer overflow") +) diff --git a/proto/pbcommon/common_oss.proto b/proto/pbcommon/common_oss.proto new file mode 100644 index 000000000..a3a87199a --- /dev/null +++ b/proto/pbcommon/common_oss.proto @@ -0,0 +1,11 @@ +// +build !consulent + +syntax = "proto3"; + +package common; + +option go_package = "github.com/hashicorp/consul/proto/pbcommon"; + +message EnterpriseMeta { + // no fields in oss +} \ No newline at end of file diff --git a/agent/agentpb/config/config.pb.binary.go b/proto/pbconfig/config.pb.binary.go similarity index 97% rename from agent/agentpb/config/config.pb.binary.go rename to proto/pbconfig/config.pb.binary.go index 5726f7b6f..e8f6aa1c4 100644 --- a/agent/agentpb/config/config.pb.binary.go +++ b/proto/pbconfig/config.pb.binary.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-binary. DO NOT EDIT. -// source: agent/agentpb/config/config.proto +// source: proto/pbconfig/config.proto -package config +package pbconfig import ( "github.com/golang/protobuf/proto" diff --git a/agent/agentpb/config/config.pb.go b/proto/pbconfig/config.pb.go similarity index 92% rename from agent/agentpb/config/config.pb.go rename to proto/pbconfig/config.pb.go index 6e0a2c31e..3ef81075f 100644 --- a/agent/agentpb/config/config.pb.go +++ b/proto/pbconfig/config.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: agent/agentpb/config/config.proto +// source: proto/pbconfig/config.proto -package config +package pbconfig import ( fmt "fmt" @@ -39,7 +39,7 @@ func (m *Config) Reset() { *m = Config{} } func (m *Config) String() string { return proto.CompactTextString(m) } func (*Config) ProtoMessage() {} func (*Config) Descriptor() ([]byte, []int) { - return fileDescriptor_32691daf3e11879d, []int{0} + return fileDescriptor_aefa824db7b74d77, []int{0} } func (m *Config) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -136,7 +136,7 @@ func (m *Gossip) Reset() { *m = Gossip{} } func (m *Gossip) String() string { return proto.CompactTextString(m) } func (*Gossip) ProtoMessage() {} func (*Gossip) Descriptor() ([]byte, []int) { - return fileDescriptor_32691daf3e11879d, []int{1} + return fileDescriptor_aefa824db7b74d77, []int{1} } func (m *Gossip) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -192,7 +192,7 @@ func (m *GossipEncryption) Reset() { *m = GossipEncryption{} } func (m *GossipEncryption) String() string { return proto.CompactTextString(m) } func (*GossipEncryption) ProtoMessage() {} func (*GossipEncryption) Descriptor() ([]byte, []int) { - return fileDescriptor_32691daf3e11879d, []int{2} + return fileDescriptor_aefa824db7b74d77, []int{2} } func (m *GossipEncryption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -257,7 +257,7 @@ func (m *TLS) Reset() { *m = TLS{} } func (m *TLS) String() string { return proto.CompactTextString(m) } func (*TLS) ProtoMessage() {} func (*TLS) Descriptor() ([]byte, []int) { - return fileDescriptor_32691daf3e11879d, []int{3} + return fileDescriptor_aefa824db7b74d77, []int{3} } func (m *TLS) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -342,7 +342,7 @@ func (m *ACL) Reset() { *m = ACL{} } func (m *ACL) String() string { return proto.CompactTextString(m) } func (*ACL) ProtoMessage() {} func (*ACL) Descriptor() ([]byte, []int) { - return fileDescriptor_32691daf3e11879d, []int{4} + return fileDescriptor_aefa824db7b74d77, []int{4} } func (m *ACL) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,7 +464,7 @@ func (m *ACLTokens) Reset() { *m = ACLTokens{} } func (m *ACLTokens) String() string { return proto.CompactTextString(m) } func (*ACLTokens) ProtoMessage() {} func (*ACLTokens) Descriptor() ([]byte, []int) { - return fileDescriptor_32691daf3e11879d, []int{5} + return fileDescriptor_aefa824db7b74d77, []int{5} } func (m *ACLTokens) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -547,7 +547,7 @@ func (m *ACLServiceProviderToken) Reset() { *m = ACLServiceProviderToken func (m *ACLServiceProviderToken) String() string { return proto.CompactTextString(m) } func (*ACLServiceProviderToken) ProtoMessage() {} func (*ACLServiceProviderToken) Descriptor() ([]byte, []int) { - return fileDescriptor_32691daf3e11879d, []int{6} + return fileDescriptor_aefa824db7b74d77, []int{6} } func (m *ACLServiceProviderToken) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -604,7 +604,7 @@ func (m *AutoEncrypt) Reset() { *m = AutoEncrypt{} } func (m *AutoEncrypt) String() string { return proto.CompactTextString(m) } func (*AutoEncrypt) ProtoMessage() {} func (*AutoEncrypt) Descriptor() ([]byte, []int) { - return fileDescriptor_32691daf3e11879d, []int{7} + return fileDescriptor_aefa824db7b74d77, []int{7} } func (m *AutoEncrypt) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -672,60 +672,60 @@ func init() { proto.RegisterType((*AutoEncrypt)(nil), "config.AutoEncrypt") } -func init() { proto.RegisterFile("agent/agentpb/config/config.proto", fileDescriptor_32691daf3e11879d) } +func init() { proto.RegisterFile("proto/pbconfig/config.proto", fileDescriptor_aefa824db7b74d77) } -var fileDescriptor_32691daf3e11879d = []byte{ - // 791 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x55, 0xdd, 0x6e,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- 0x08, 0x13, 0xb7, 0xac, 0xd3, 0xde, 0x42, 0x79, 0x9f, 0x2d, 0x54, 0xca, 0x33, 0xc4, 0x15, 0xe4, - 0xf4, 0xc3, 0x74, 0xbd, 0x99, 0x8c, 0x05, 0x19, 0xfb, 0x24, 0x89, 0x69, 0x14, 0xaa, 0x19, 0xd4, - 0xa5, 0x2a, 0x42, 0xa0, 0x68, 0xc1, 0x26, 0x34, 0xee, 0xba, 0x60, 0x45, 0x08, 0xca, 0x69, 0xde, - 0xd8, 0xd4, 0x2c, 0x33, 0xf1, 0x39, 0x3a, 0x50, 0x42, 0x53, 0x2d, 0x6d, 0xe0, 0x17, 0xa8, 0xd2, - 0x0f, 0x59, 0x38, 0x23, 0x13, 0xe8, 0x2d, 0x1a, 0x91, 0xa1, 0xe0, 0xf7, 0x74, 0x42, 0x84, 0xeb, - 0xd4, 0xec, 0x7a, 0xb9, 0xf9, 0x73, 0xe1, 0x81, 0x9f, 0x28, 0xd4, 0x6d, 0xfc, 0x1d, 0xee, 0xde, - 0x73, 0xf4, 0xfd, 0x0e, 0x17, 0x68, 0x9e, 0x56, 0x14, 0x91, 0x34, 0xe5, 0xa2, 0xdb, 0xc9, 0xb6, - 0xf3, 0x1a, 0x81, 0xc6, 0x0b, 0x48, 0x24, 0x88, 0xec, 0x76, 0xcc, 0x23, 0xe4, 0xb6, 0x47, 0x37, - 0xd6, 0x25, 0xec, 0x10, 0x58, 0x6f, 0xba, 0xe3, 0xd5, 0xac, 0x57, 0x90, 0xd3, 0x19, 0x04, 0x41, - 0xbe, 0x87, 0x8c, 0x05, 0xd7, 0xef, 0x0e, 0x01, 0xb6, 0x15, 0xac, 0x0d, 0x38, 0xaa, 0x15, 0xc7, - 0xfc, 0x01, 0x82, 0xec, 0xab, 0x20, 0xb9, 0x7d, 0x7d, 0xfd, 0xee, 0xb1, 0x6a, 0xbd, 0x7f, 0xac, - 0x5a, 0x1f, 0x1e, 0xab, 0xd6, 0xeb, 0x4f, 0xd5, 0x6f, 0x5e, 0x5e, 0xcd, 0xa8, 0x9c, 0x2f, 0xc7, - 0x97, 0x11, 0x5f, 0x34, 0xe6, 0x61, 0x3a, 0xa7, 0x11, 0x17, 0x09, 0x7c, 0x8c, 0xd2, 0x65, 0xdc, - 0xd8, 0xf6, 0xa1, 0x1a, 0x3b, 0xea, 0x13, 0xf5, 0xc7, 0x97, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc3, - 0x44, 0xb5, 0xea, 0xc7, 0x06, 0x00, 0x00, +var fileDescriptor_aefa824db7b74d77 = []byte{ + // 787 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x55, 0xdd, 0x6e, 0xe2, 0x46, + 0x14, 0xae, 0xe3, 0xc4, 0x09, 0x43, 0x1b, 0x25, 0x93, 0x88, 0x5a, 0xfd, 0xa1, 0xc8, 0xaa, 0x22, + 0x5a, 0x55, 0xa1, 0xa2, 0x6a, 0x55, 0x55, 0xbd, 0x21, 0x10, 0xb5, 0x34, 0x40, 0x91, 0x4d, 0x53, + 0xa9, 0x77, 0xc6, 0x0c, 0x30, 0xaa, 0x99, 0xb1, 0xc6, 0x43, 0x22, 0xde, 0xa4, 0xd7, 0x7d, 0x83, + 0x7d, 0x8b, 0xbd, 0xdc, 0x47, 0xd8, 0xcd, 0xbe, 0xc0, 0x3e, 0xc2, 0xea, 0xcc, 0x8c, 0x8d, 0x9d, + 0x85, 0x2b, 0x38, 0xdf, 0xf7, 0xcd, 0x99, 0x6f, 0xe6, 0x9c, 0x33, 0x46, 0x9f, 0x27, 0x82, 0x4b, + 0xde, 0x4a, 0xa6, 0x11, 0x67, 0x73, 0xba, 0x68, 0xe9, 0x9f, 0x6b, 0x85, 0x62, 0x47, 0x47, 0xde, + 0x8b, 0x03, 0xe4, 0x74, 0xd5, 0x5f, 0x5c, 0x47, 0xa8, 0x17, 0xca, 0x30, 0x22, 0x4c, 0x12, 0xe1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x40, 0x22, 0x41, 0x64, 0xbf, 0x67, 0x2e, 0x21, 0x8f, 0x3d, 0x5a, 0x7a, 0x2e, 0xe1, 0x0d, + 0x81, 0xe7, 0x4d, 0x77, 0xbc, 0x9a, 0xf5, 0x1a, 0x72, 0x7a, 0xa3, 0x20, 0xc8, 0xdf, 0x21, 0x13, + 0xc1, 0xf1, 0xfb, 0x63, 0x80, 0x6d, 0x05, 0xeb, 0x00, 0xb6, 0xea, 0xc4, 0x31, 0x7f, 0x84, 0x24, + 0x87, 0x2a, 0x49, 0x1e, 0xdf, 0xfc, 0xfa, 0xf2, 0xa9, 0x6e, 0xbd, 0x7a, 0xaa, 0x5b, 0xaf, 0x9f, + 0xea, 0xd6, 0x7f, 0x6f, 0xeb, 0x1f, 0xfd, 0xf3, 0xed, 0x82, 0xca, 0xe5, 0x7a, 0x7a, 0x1d, 0xf1, + 0x55, 0x6b, 0x19, 0xa6, 0x4b, 0x1a, 0x71, 0x91, 0xc0, 0xc7, 0x28, 0x5d, 0xc7, 0xad, 0xf2, 0x27, + 0x6a, 0xea, 0xa8, 0xf8, 0x87, 0xf7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xef, 0x32, 0xac, 0xbb, + 0x06, 0x00, 0x00, } func (m *Config) Marshal() (dAtA []byte, err error) { diff --git a/agent/agentpb/config/config.proto b/proto/pbconfig/config.proto similarity index 95% rename from agent/agentpb/config/config.proto rename to proto/pbconfig/config.proto index 679a3b557..6dcaabb02 100644 --- a/agent/agentpb/config/config.proto +++ b/proto/pbconfig/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package config; -option go_package = "github.com/hashicorp/consul/agent/agentpb/config"; +option go_package = "github.com/hashicorp/consul/proto/pbconfig"; message Config { string Datacenter = 1;