mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-01 18:33:19 +02:00
authorize: add databroker server and record version to result, force sync via polling (#2024)
* authorize: add databroker server and record version to result, force sync via polling * wrap inmem store to take read lock when grabbing databroker versions * address code review comments * reset max to 0
This commit is contained in:
parent
8f97b0d6ee
commit
d7ab817de7
17 changed files with 467 additions and 362 deletions
|
@ -19,7 +19,7 @@ import (
|
|||
type testSyncerHandler struct {
|
||||
getDataBrokerServiceClient func() DataBrokerServiceClient
|
||||
clearRecords func(ctx context.Context)
|
||||
updateRecords func(ctx context.Context, records []*Record)
|
||||
updateRecords func(ctx context.Context, serverVersion uint64, records []*Record)
|
||||
}
|
||||
|
||||
func (t testSyncerHandler) GetDataBrokerServiceClient() DataBrokerServiceClient {
|
||||
|
@ -30,8 +30,8 @@ func (t testSyncerHandler) ClearRecords(ctx context.Context) {
|
|||
t.clearRecords(ctx)
|
||||
}
|
||||
|
||||
func (t testSyncerHandler) UpdateRecords(ctx context.Context, records []*Record) {
|
||||
t.updateRecords(ctx, records)
|
||||
func (t testSyncerHandler) UpdateRecords(ctx context.Context, serverVersion uint64, records []*Record) {
|
||||
t.updateRecords(ctx, serverVersion, records)
|
||||
}
|
||||
|
||||
type testServer struct {
|
||||
|
@ -166,7 +166,7 @@ func TestSyncer(t *testing.T) {
|
|||
clearRecords: func(ctx context.Context) {
|
||||
clearCh <- struct{}{}
|
||||
},
|
||||
updateRecords: func(ctx context.Context, records []*Record) {
|
||||
updateRecords: func(ctx context.Context, serverVersion uint64, records []*Record) {
|
||||
updateCh <- records
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue