googleapis / googleapis/google-oauth-java-client
StoredCredential / AbstractDataStoreFactory - optimistic lock
- Lingua principale
- Java
- Stelle
- 661
- Fork
- 284
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**Is your feature request related to a problem? Please describe.**
I'm facing to a **concurrent requests** that for the same user need to refresh the access token. All is good for the first request, but the second that uses the same refresh token has been rejected and in consequence, write null in the database. The access token and the new refresh are lost.
**Describe the solution you'd like**
Add a version field to the StoredCredential object. At this time this object cannot be overridden because it is declared as final class. This new field permit to implement a optimistic lock in my DataStoreFactory.
Result:
The second request it want to insert null with version 1, will be rejected because in database the first request put the new token with version 2. The right access token and refresh token aren't lost.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia leggendo StoredCredential e AbstractDataStoreFactory per tracciare il modo in cui le credenziali vengono rese persistenti e aggiornate. Non sono indicati file, test o punti di ingresso; l’implementazione deve coprire il rifiuto del locking ottimistico basato sulla versione, in modo che una scrittura concorrente obsoleta non possa sostituire token di accesso e di refresh più recenti, con un test per questa race condition.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- authentication
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100