Skip to main content

Module enrollment

Module enrollment 

Source
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Β§

ServerStatus πŸ”’
What the server reports about an enrollment.
Stop πŸ”’
Why an enrollment ended early. It also decides what end_enrollment reports.

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 started as 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 msga that replaces replaced. 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 at WAITING_FOR_CODE first, 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.