mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-08 22:03:29 +02:00
storage: invalidate sync querier when records are updated (#5612)
## Summary Invalidate the sync querier when records are updated so that we fallback to databroker querying until the sync is complete. ## Related issues For [ENG-2377](https://linear.app/pomerium/issue/ENG-2377/core-initial-access-with-idp-accessidentity-tokens-sometimes-fails) ## Checklist - [x] reference any related issues - [x] updated unit tests - [x] add appropriate label (`enhancement`, `bug`, `breaking`, `dependencies`, `ci`) - [x] ready for review
This commit is contained in:
parent
f6b344fd9e
commit
ba0fcffe81
4 changed files with 68 additions and 13 deletions
|
@ -140,13 +140,13 @@ func (a *Authorize) maybeGetSessionFromRequest(
|
|||
return storage.GetDataBrokerRecord(ctx, recordType, recordID, 0)
|
||||
},
|
||||
func(ctx context.Context, records []*databroker.Record) error {
|
||||
_, err := a.state.Load().dataBrokerClient.Put(ctx, &databroker.PutRequest{
|
||||
res, err := a.state.Load().dataBrokerClient.Put(ctx, &databroker.PutRequest{
|
||||
Records: records,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
storage.InvalidateCacheForDataBrokerRecords(ctx, records...)
|
||||
storage.InvalidateCacheForDataBrokerRecords(ctx, res.Records...)
|
||||
return nil
|
||||
},
|
||||
).CreateSession(ctx, a.currentConfig.Load(), policy, hreq)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue