mirror of
https://github.com/status-im/consul.git
synced 2025-01-12 06:44:41 +00:00
a668c36930
Introduces two new public gRPC endpoints (`Login` and `Logout`) and includes refactoring of the equivalent net/rpc endpoints to enable the majority of logic to be reused (i.e. by extracting the `Binder` and `TokenWriter` types). This contains the OSS portions of the following enterprise commits: - 75fcdbfcfa6af21d7128cb2544829ead0b1df603 - bce14b714151af74a7f0110843d640204082630a - cc508b70fbf58eda144d9af3d71bd0f483985893
38 lines
635 B
Go
38 lines
635 B
Go
package acl
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/go-uuid"
|
|
"github.com/stretchr/testify/require"
|
|
"google.golang.org/grpc"
|
|
|
|
"github.com/hashicorp/consul/acl"
|
|
structs "github.com/hashicorp/consul/agent/structs"
|
|
)
|
|
|
|
func generateID(t *testing.T) string {
|
|
t.Helper()
|
|
|
|
id, err := uuid.GenerateUUID()
|
|
require.NoError(t, err)
|
|
|
|
return id
|
|
}
|
|
|
|
func noopForwardRPC(structs.RPCInfo, func(*grpc.ClientConn) error) (bool, error) {
|
|
return false, nil
|
|
}
|
|
|
|
func noopValidateEnterpriseRequest(*acl.EnterpriseMeta, bool) error {
|
|
return nil
|
|
}
|
|
|
|
func noopLocalTokensEnabled() bool {
|
|
return true
|
|
}
|
|
|
|
func noopACLsEnabled() bool {
|
|
return true
|
|
}
|