diff --git a/Makefile b/Makefile index 047d7b8..cf4efde 100644 --- a/Makefile +++ b/Makefile @@ -11,13 +11,13 @@ test-clean: go clean -testcache test: test-clean - go test -run=$(TEST) $(TEST_FLAGS) -json ./... | tparse --all --follow + go test -run=$(TEST) $(TEST_FLAGS) -json ./... | go run github.com/mfridman/tparse --all --follow test-rerun: test-clean go run github.com/goware/rerun/cmd/rerun -watch ./ -run 'make test' test-coverage: - go test -run=$(TEST) $(TEST_FLAGS) -cover -coverprofile=coverage.out -json ./... | tparse --all --follow + go test -run=$(TEST) $(TEST_FLAGS) -cover -coverprofile=coverage.out -json ./... | go run github.com/mfridman/tparse --all --follow test-coverage-inspect: test-coverage go tool cover -html=coverage.out diff --git a/common.go b/common.go index b3843a6..4c48aac 100644 --- a/common.go +++ b/common.go @@ -104,37 +104,6 @@ func (c Config[any]) Verify(webrpcServices map[string][]string) error { return errors.Join(errList...) } -// ACL is a list of session types, encoded as a bitfield. -// SessionType(n) is represented by n=-the bit. -type ACL uint64 - -// NewACL returns a new ACL with the given session types. -func NewACL(sessions ...proto.SessionType) ACL { - var acl ACL - for _, v := range sessions { - acl = acl.And(v) - } - return acl -} - -// And returns a new ACL with the given session types added. -func (a ACL) And(session ...proto.SessionType) ACL { - for _, v := range session { - a |= 1 << v - } - return a -} - -// Includes returns true if the ACL includes the given session type. -func (t ACL) Includes(session proto.SessionType) bool { - return t&ACL(1<