mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-10 06:42:45 +02:00
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.
This commit is contained in:
parent
5f4e13e130
commit
47890e9ee1
5 changed files with 270 additions and 16 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
|
||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
"github.com/pomerium/pomerium/pkg/storage"
|
||||
"github.com/pomerium/pomerium/pkg/storage/storagetest"
|
||||
)
|
||||
|
||||
func TestBackend(t *testing.T) {
|
||||
|
@ -72,6 +73,9 @@ func TestBackend(t *testing.T) {
|
|||
assert.Error(t, err)
|
||||
assert.Nil(t, record)
|
||||
})
|
||||
t.Run("patch", func(t *testing.T) {
|
||||
storagetest.TestBackendPatch(t, ctx, backend)
|
||||
})
|
||||
}
|
||||
|
||||
func TestExpiry(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue