Remove RegisterLicense from logical.Backend

It's almost certainly the wrong signature and nothing uses it currently
anyways.
This commit is contained in:
Jeff Mitchell
2018-01-18 13:44:27 -05:00
parent 06c062fafe
commit f7ae903371
6 changed files with 0 additions and 64 deletions

View File

@@ -290,14 +290,6 @@ func (b *Backend) Type() logical.BackendType {
return b.BackendType return b.BackendType
} }
// RegisterLicense performs backend license registration.
func (b *Backend) RegisterLicense(license interface{}) error {
if b.LicenseRegistration == nil {
return nil
}
return b.LicenseRegistration(license)
}
// SanitizeTTLStr takes in the TTL and MaxTTL values provided by the user, // SanitizeTTLStr takes in the TTL and MaxTTL values provided by the user,
// compares those with the SystemView values. If they are empty a value of 0 is // compares those with the SystemView values. If they are empty a value of 0 is
// set, which will cause initial secret or LeaseExtend operations to use the // set, which will cause initial secret or LeaseExtend operations to use the

View File

@@ -86,9 +86,6 @@ type Backend interface {
// Type returns the BackendType for the particular backend // Type returns the BackendType for the particular backend
Type() BackendType Type() BackendType
// RegisterLicense performs backend license registration
RegisterLicense(interface{}) error
} }
// BackendConfig is provided to the factory to initialize the backend // BackendConfig is provided to the factory to initialize the backend

View File

@@ -79,16 +79,6 @@ type TypeReply struct {
Type logical.BackendType Type logical.BackendType
} }
// RegisterLicenseArgs is the args for the RegisterLicense method.
type RegisterLicenseArgs struct {
License interface{}
}
// RegisterLicenseReply is the reply for the RegisterLicense method.
type RegisterLicenseReply struct {
Error error
}
func (b *backendPluginClient) HandleRequest(ctx context.Context, req *logical.Request) (*logical.Response, error) { func (b *backendPluginClient) HandleRequest(ctx context.Context, req *logical.Request) (*logical.Response, error) {
if b.metadataMode { if b.metadataMode {
return nil, ErrClientInMetadataMode return nil, ErrClientInMetadataMode
@@ -265,23 +255,3 @@ func (b *backendPluginClient) Type() logical.BackendType {
return logical.BackendType(reply.Type) return logical.BackendType(reply.Type)
} }
func (b *backendPluginClient) RegisterLicense(license interface{}) error {
if b.metadataMode {
return ErrClientInMetadataMode
}
var reply RegisterLicenseReply
args := RegisterLicenseArgs{
License: license,
}
err := b.client.Call("Plugin.RegisterLicense", args, &reply)
if err != nil {
return err
}
if reply.Error != nil {
return reply.Error
}
return nil
}

View File

@@ -171,18 +171,3 @@ func (b *backendPluginServer) Type(_ interface{}, reply *TypeReply) error {
return nil return nil
} }
func (b *backendPluginServer) RegisterLicense(args *RegisterLicenseArgs, reply *RegisterLicenseReply) error {
if inMetadataMode() {
return ErrServerInMetadataMode
}
err := b.backend.RegisterLicense(args.License)
if err != nil {
*reply = RegisterLicenseReply{
Error: wrapError(err),
}
}
return nil
}

View File

@@ -95,10 +95,6 @@ func (n *NoopBackend) Type() logical.BackendType {
return logical.TypeLogical return logical.TypeLogical
} }
func (n *NoopBackend) RegisterLicense(license interface{}) error {
return nil
}
func TestRouter_Mount(t *testing.T) { func TestRouter_Mount(t *testing.T) {
r := NewRouter() r := NewRouter()
_, barrier, _ := mockBarrier(t) _, barrier, _ := mockBarrier(t)

View File

@@ -706,10 +706,6 @@ func (n *rawHTTP) Type() logical.BackendType {
return logical.TypeUnknown return logical.TypeUnknown
} }
func (n *rawHTTP) RegisterLicense(license interface{}) error {
return nil
}
func GenerateRandBytes(length int) ([]byte, error) { func GenerateRandBytes(length int) ([]byte, error) {
if length < 0 { if length < 0 {
return nil, fmt.Errorf("length must be >= 0") return nil, fmt.Errorf("length must be >= 0")