Class SignInRecorder
SignInRecordStore. Called at every completed sign-in and re-sign-in of a client session - from AppSessionGyro.signInAuthenticatedUser, the one path of the server's own sign-in, for every client session of the AppSession, and from the ClientSessionGyro constructor for a session whose AppSession has its user at the connection already (an application with its own sign-in: entry URL, app.json).Nothing here is in the sign-in's path. onSignedIn(ClientSessionGyro, UserInfoBase, boolean) starts a virtual thread and returns; the thread gathers what the record holds, waiting a bounded time for the two answers that come from elsewhere, writes one row and logs the SIGN_IN security event. A failure anywhere is logged and ends there.
What is gathered, and from where (step 2 of the order, the best source first):
- the time (UTC) and the device's time zone, from the client environment (
time.zone.name,time.zone.offset) when the client sent one; - the client address, as the throttle, the session geolocation log and the account notices resolve it (
ClientPlace: the connection's address, or the client a trusted proxy forwarded); - the place of the address from the region location provider (IP2Location when the local service is on), waited for at most
ClientPlace.PLACE_LOOKUP_MS; a private or local address is not looked up; - the device's own location through
GeoProps.requestQuietLocation(ILocationListener): the client answers with a position only when it can do so WITHOUT asking its user - in iiziRun through the Cordova geolocation plugin when the build carries it and the app has the permission, in a Browser only when the Geolocation permission is granted for the origin already - and otherwise with an error at once; waited for at mostLOCATION_WAIT_MS. The coordinates are rounded to about a kilometer (SN-D-15). The source column says which: CORDOVA, BROWSER, IP (the place of the address only) or NONE.
A Browser has no device identifier of its own until the server remembers the user on it (CC-LOGIN-L5-DEVICE-TOKEN); its record is written under SignInRecordStore.BROWSER_DEVICE and given the identifier when the session learns it (onDeviceIdentified(ClientSessionGyro, long, String)), so that the devices list and the records of one Browser meet.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longHow long the device's location is waited for: the client answers at once when it cannot give one; a position may take a moment.Constructor Summary
ConstructorsConstructorDescriptionSignInRecorder(SignInRecordStore store, Executor executor, SecurityEventLog events) Constructs a recorder on a store, an executor and an event log: the tests' constructor.Method Summary
Modifier and TypeMethodDescriptionfirstAndLastPerDevice(long uid) Gets the first and the last record of every device and application of a user, for the devices lists.static SignInRecorderGets the server's recorder.getStore()Gets the store.voidonDeviceIdentified(ClientSessionGyro clientGyro, long recordID, String deviceID) Called when a session learns the device identifier of its Browser after a record was written: the row is given the identifier (once per record of the session).voidonSignedIn(ClientSessionGyro clientGyro, UserInfoBase user, boolean reSignIn) Called when a client session has a signed-in user: starts the capture and returns.intpurge(int days) Deletes the records older than the days kept: the daily purge (DV-6).
Field Details
LOCATION_WAIT_MS
public static final long LOCATION_WAIT_MSHow long the device's location is waited for: the client answers at once when it cannot give one; a position may take a moment.- See Also:
Constructor Details
SignInRecorder
Constructs a recorder on a store, an executor and an event log: the tests' constructor.- Parameters:
store- The store.executor- Where the capture runs;Runnable::runruns it in the caller.events- The event log.
Method Details
getInstance
getStore
onSignedIn
Called when a client session has a signed-in user: starts the capture and returns.- Parameters:
clientGyro- The client session.user- The user, defined, with its basic user information.reSignIn- true when the session had the user signed in already.
onDeviceIdentified
Called when a session learns the device identifier of its Browser after a record was written: the row is given the identifier (once per record of the session).- Parameters:
clientGyro- The client session.recordID- A record of the session, zero for none yet.deviceID- The identifier.
firstAndLastPerDevice
Gets the first and the last record of every device and application of a user, for the devices lists.- Parameters:
uid- The user.- Returns:
- The entries, the most recent last sign-in first; none when the store is unavailable or failed (logged).
purge
public int purge(int days) Deletes the records older than the days kept: the daily purge (DV-6).- Parameters:
days- The days kept.- Returns:
- The rows deleted, 0 when the store is unavailable or the purge failed (logged).