Commit graph

15 commits

Author SHA1 Message Date
Kenneth Jenkins
a771b82a72
storage/inmemory: fix Patch() error handling (#4838)
The Patch() method was intended to skip any records that do not
currently exist. However, currently inmemory.Backend.Patch() will return
ErrNotFound if the last record in the records slice is not found (it
will ignore any other previous records that are not found).

Update the error handling logic here to be consistent with the postgres
backend, and add a unit test to exercise this case.
2023-12-07 12:21:10 -08:00
Kenneth Jenkins
47890e9ee1
storage/inmemory: implement patch operation (#4654)
Add a new Patch() method that updates specific fields of an existing
record's data, based on a field mask.

Extract some logic from the existing Get() and Put() methods so it can
be shared with the new Patch() method.
2023-11-02 11:03:00 -07:00
Caleb Doxsey
bbed421cd8
config: remove source, remove deadcode, fix linting issues (#4118)
* remove source, remove deadcode, fix linting issues

* use github action for lint

* fix missing envoy
2023-04-21 17:25:11 -06:00
Caleb Doxsey
7895bf431f
databroker: add list types method (#3937)
* databroker: add list types method

* fix test

* Update pkg/storage/redis/redis.go

Co-authored-by: Denis Mishin <dmishin@pomerium.com>

---------

Co-authored-by: Denis Mishin <dmishin@pomerium.com>
2023-02-03 13:16:28 -07:00
Caleb Doxsey
45a29ea879
databroker: add support for syncing by type (#3412)
* databroker: add support for syncing by type

* add type url, fix query
2022-06-13 09:52:13 -06:00
Caleb Doxsey
1669b601ea
storage: add filtering to SyncLatest (#3368)
* wip

* storage: add filtering to SyncLatest

* don't increment the record version, so intermediate changes are requested

* fix stream filter
2022-05-17 16:00:23 -06:00
Caleb Doxsey
2e1366c417
databroker: fix in-memory backend deadlock (#3300) 2022-04-27 15:33:29 -04:00
Caleb Doxsey
f73c5c615f
databroker: add support for putting multiple records (#3291)
* databroker: add support for putting multiple records

* add OptimumPutRequestsFromRecords function

* replace GetAll with SyncLatest

* fix stream when there are no records
2022-04-26 16:41:38 -06:00
Caleb Doxsey
a243056cfa
Revert "databroker: add support for field masks on Put (#3210)" (#3217)
This reverts commit 2dc778035d.
2022-03-31 11:17:57 -04:00
Caleb Doxsey
2dc778035d
databroker: add support for field masks on Put (#3210)
* databroker: add support for field masks on Put

* return errors

* clean up go.mod
2022-03-29 16:36:40 -06:00
Caleb Doxsey
94aa0b1a48
databroker: implement leases (#2172)
* databroker: implement leases

* return error

* handle gRPC errors
2021-05-10 13:30:25 -06:00
Caleb Doxsey
91c7dc742f
databroker: store server version in backend (#2142) 2021-04-28 09:12:52 -06:00
Caleb Doxsey
636b3d6846
databroker: add options for maximum capacity (#2095)
* databroker: add options

* implement redis

* add trace for enforce options
2021-04-26 17:14:54 -06:00
wasaga
e0c09a0998
log context (#2107) 2021-04-22 10:58:13 -04:00
Caleb Doxsey
5d60cff21e
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
2021-02-18 15:24:33 -07:00