[identity] Extract insert_into_cache to trait
Summary:
I'll need the insert_into_cache() function in authenticated proto too, so I thought it'd be nice to make it more universal as an extension to the Cache.
Depends on D9928.
Test Plan: Register and login endpoints still work.
Reviewers: varun, michal
Reviewed By: varun
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D9929