Affected by GO-2023-1723
and 5 other vulnerabilities
GO-2023-1723 : SpiceDB binding metrics port to untrusted networks and can leak command-line flags in github.com/authzed/spicedb
GO-2023-2166 : SpiceDB leaks information in log files when URI cannot be parsed in github.com/authzed/spicedb
GO-2024-2597 : Integer overflow in chunking helper causes dispatching to miss elements or panic in github.com/authzed/spicedb
GO-2024-2716 : SpiceDB: LookupSubjects may return partial results if a specific kind of relation is used in github.com/authzed/spicedb
GO-2024-2939 : SpiceDB exclusions can result in no permission returned when permission expected in github.com/authzed/spicedb
GO-2024-3131 : SpiceDB having multiple caveats on resources of the same type may improperly result in no permission in github.com/authzed/spicedb
Discover Packages
github.com/authzed/spicedb
pkg
consistent
package
Version:
v0.0.3
Opens a new window with list of versions in this module.
Published: Sep 24, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
View Source
var (
ErrMemberAlreadyExists = errors .New ("member node already exists")
ErrMemberNotFound = errors .New ("member node not found")
ErrNotEnoughMembers = errors .New ("not enough member nodes to satisfy request")
)
HasherFunc is the interface for any function that can act as a hasher.
Hashring provides a ring consistent hash implementation using a configurable number of virtual
nodes. It is internally synchronized and thread-safe.
NewHashring creates a new Hashring with the specified hasher function and replicationFactor.
replicationFactor must be > 0 and should be a number like 20 for higher quality key distribution.
At a replicationFactor of 100, the standard distribution of key->member mapping will be about 10%
of the mean. At a replicationFactor of 1000 it will be about 3.2%. The replicationFactor should
be chosen carefully because a higher replicationFactor will require more memory and worse member
selection performance.
Add adds an object that implements the Member interface as a node in the
consistent hashring.
If a member with the same key is already in the hashring,
ErrMemberAlreadyExists is returned.
FindN finds the first N members in the hashring after the specified key.
If there are not enough members in the hashring to satisfy the request,
ErrNotEnoughMembers is returned.
Members returns the current list of members of the Hashring.
Remove removes an object with the same key as the specified member object.
If no member with the same key is in the hashring, ErrMemberNotFound is returned.
type Member interface {
Key() string
}
Member is the interface for any object that can be stored and retrieved as a
Hashring member (e.g. node/backend).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.