Page MenuHomePhabricator

[identity] replace cache calls with DB client method calls
ClosedPublic

Authored by varun on Mar 5 2024, 11:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 12, 11:31 PM
Unknown Object (File)
Sun, May 12, 11:31 PM
Unknown Object (File)
Sun, May 12, 11:31 PM
Unknown Object (File)
Sun, May 12, 11:09 PM
Unknown Object (File)
Apr 7 2024, 8:16 PM
Unknown Object (File)
Apr 7 2024, 8:16 PM
Unknown Object (File)
Apr 7 2024, 8:14 PM
Unknown Object (File)
Apr 7 2024, 8:13 PM
Subscribers

Details

Summary
  • replace all inserts into cache with inserts into DDB table
  • replace all gets from cache with gets from DDB table
  • remove all references to moka from crate

DDB TTL will handle removing old items from the table.

Depends on D11255

Test Plan

tested that password login, registration, and update continue to work as expected on staging. verified that items were eventually automatically removed from the table

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Mar 5 2024, 11:28 PM
  1. We no longer invalidate the cache. What happens if a client calls _finish method a second time?
  2. Just want to make sure: we don't have any sensitive data in WorkflowInProgress that we would prefer to keep only in-memory or sth like this?
  1. We no longer invalidate the cache. What happens if a client calls _finish method a second time?

it would succeed, which would have no real impact, i think. but we should still call DeleteItem instead of GetItem to avoid any issues, thanks for calling this out

  1. Just want to make sure: we don't have any sensitive data in WorkflowInProgress that we would prefer to keep only in-memory or sth like this?

no, there's nothing sensitive like passwords in this table

i've updated D11255 to use DeleteItem in get_workflow(). Now the function retrieves and removes the workflow, so we don't run the risk of retrieving it multiple times

Looks good to me. We're removing the cache to support stateless sessions correct?

This revision is now accepted and ready to land.Mar 6 2024, 1:32 PM
In D11256#325184, @will wrote:

Looks good to me. We're removing the cache to support stateless sessions correct?

we're making the identity service stateless, yes