mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 16:59:22 +02:00
databroker: refactor databroker to sync all changes (#1879)
* refactor backend, implement encrypted store * refactor in-memory store * wip * wip * wip * add syncer test * fix redis expiry * fix linting issues * fix test by skipping non-config records * fix backoff import * fix init issues * fix query * wait for initial sync before starting directory sync * add type to SyncLatest * add more log messages, fix deadlock in in-memory store, always return server version from SyncLatest * update sync types and tests * add redis tests * skip macos in github actions * add comments to proto * split getBackend into separate methods * handle errors in initVersion * return different error for not found vs other errors in get * use exponential backoff for redis transaction retry * rename raw to result * use context instead of close channel * store type urls as constants in databroker * use timestampb instead of ptypes * fix group merging not waiting * change locked names * update GetAll to return latest record version * add method to grpcutil to get the type url for a protobuf type
This commit is contained in:
parent
b1871b0f2e
commit
5d60cff21e
66 changed files with 2762 additions and 2871 deletions
|
@ -13,8 +13,6 @@ var (
|
|||
// DefaultDeletePermanentlyAfter is the default amount of time to wait before deleting
|
||||
// a record permanently.
|
||||
DefaultDeletePermanentlyAfter = time.Hour
|
||||
// DefaultBTreeDegree is the default number of items to store in each node of the BTree.
|
||||
DefaultBTreeDegree = 8
|
||||
// DefaultStorageType is the default storage type that Server use
|
||||
DefaultStorageType = "memory"
|
||||
// DefaultGetAllPageSize is the default page size for GetAll calls.
|
||||
|
@ -23,7 +21,6 @@ var (
|
|||
|
||||
type serverConfig struct {
|
||||
deletePermanentlyAfter time.Duration
|
||||
btreeDegree int
|
||||
secret []byte
|
||||
storageType string
|
||||
storageConnectionString string
|
||||
|
@ -36,7 +33,6 @@ type serverConfig struct {
|
|||
func newServerConfig(options ...ServerOption) *serverConfig {
|
||||
cfg := new(serverConfig)
|
||||
WithDeletePermanentlyAfter(DefaultDeletePermanentlyAfter)(cfg)
|
||||
WithBTreeDegree(DefaultBTreeDegree)(cfg)
|
||||
WithStorageType(DefaultStorageType)(cfg)
|
||||
WithGetAllPageSize(DefaultGetAllPageSize)(cfg)
|
||||
for _, option := range options {
|
||||
|
@ -48,13 +44,6 @@ func newServerConfig(options ...ServerOption) *serverConfig {
|
|||
// A ServerOption customizes the server.
|
||||
type ServerOption func(*serverConfig)
|
||||
|
||||
// WithBTreeDegree sets the number of items to store in each node of the BTree.
|
||||
func WithBTreeDegree(degree int) ServerOption {
|
||||
return func(cfg *serverConfig) {
|
||||
cfg.btreeDegree = degree
|
||||
}
|
||||
}
|
||||
|
||||
// WithDeletePermanentlyAfter sets the deletePermanentlyAfter duration.
|
||||
// If a record is deleted via Delete, it will be permanently deleted after
|
||||
// the given duration.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue