Expand description
Enrolling this device as a trusted one: ask the server to start an enrollment, wait for the user to approve it on an enrolled device, then take the credentials that device shares.
The UI drives the enrollment through an SsoEnrollmentContext, which shows the progress, asks
for the verification code and can cancel at any point.
EnumsΒ§
- Server
Status π - What the server reports about an enrollment.
- Stop π
- Why an enrollment ended early. It also decides what
end_enrollmentreports.
ConstantsΒ§
- MAX_
CODE_ πATTEMPTS - How many verification codes the user may try, as many as 1Passwordβs own clients allow.
FunctionsΒ§
- ask_
for_ πcode - Asks for the verification code the enrolled device shows. Polling on makes denying the request there noticed while the user types.
- cancel_
enrollment π - Tells the server to drop the enrollment, so the enrolled devices stop waiting on it. Errors are ignored: there is nothing left to do about them.
- enroll π
- The steps of the enrollment. The uuid goes to
startedas soon as the server hands it out, for the caller to cancel the enrollment should this be dropped halfway. - enroll_
device π - Enrolls this device and returns the credential bundle an enrolled device shared.
- get_
enrollment_ πstatus - Reads the status of the enrollment.
- poll_
status_ πuntil_ done - Polls the status until it is one not in
ignore. - start_
enrollment π - Starts an enrollment and returns its uuid.
- unknown_
status π - A status that nothing expects at this point.
- valid_
status π - Denial ends the enrollment, any other status is up to the caller.
- wait_
for_ πnew_ msg_ a - Waits for the
msgathat replacesreplaced. The server answers 400 to a request for it while the enrolled device checks the wrong code (PENDING_VALIDATION), so the status has to be back atWAITING_FOR_CODEfirst, as it is once that device shows the new code. Only the status tells a denial on the enrolled device from any other failure of the wait.