pub enum OnboardMethod<'a> {
Code {
code: &'a str,
hub: Option<HubAddress<'a>>,
},
Invite(&'a OnboardingInvite),
LocalApp {
approval_timeout: Option<Duration>,
app_tag: Option<&'a str>,
},
}Expand description
The onboarding path, chained as exactly one mode extension. An app joins in one of three ways:
as a local app (OnboardMethod::LocalApp), as a companion of a local app
(OnboardMethod::Invite with the app’s crate::Session::request_onboarding_invite), or
through a member hub (OnboardMethod::LocalApp with
OnboardExtensions::remote_app_grant).
Variants§
Code
code onboarding is no longer a supported way to join: use OnboardMethod::LocalApp (an app on the hub’s PC), OnboardMethod::Invite with an invite from Session::request_onboarding_invite (a companion process), or OnboardMethod::LocalApp with OnboardExtensions::remote_app_grant (an app on a member hub’s PC)
A short pairing code minted for the hub’s operators (the QAROS
Visualizer shows none: its hub join code is for another hub only).
Without an address the library finds only this user’s
hub: through the hub-endpoint.json the hub writes to the QAROS data
root, then a discovery beacon whose owner is this user (up to 6 s), else
crate::StatusCode::ONBOARDING_HUB_UNREACHABLE. Any other hub needs
its host and port in hub.
Fields
code: &'a strcode onboarding is no longer a supported way to join: use OnboardMethod::LocalApp (an app on the hub’s PC), OnboardMethod::Invite with an invite from Session::request_onboarding_invite (a companion process), or OnboardMethod::LocalApp with OnboardExtensions::remote_app_grant (an app on a member hub’s PC)
hub: Option<HubAddress<'a>>code onboarding is no longer a supported way to join: use OnboardMethod::LocalApp (an app on the hub’s PC), OnboardMethod::Invite with an invite from Session::request_onboarding_invite (a companion process), or OnboardMethod::LocalApp with OnboardExtensions::remote_app_grant (an app on a member hub’s PC)
Invite(&'a OnboardingInvite)
An invite: a co-process invite from the local app that started this process
(crate::Session::request_onboarding_invite), or one the hub’s operators minted. The
invite is borrowed for the call (for Runtime::start_onboard, for the start call,
during which the library copies it).
LocalApp
A source app joining the QAROS hub installed on this PC, with no code
(QarOnboardLocalAppExt, Windows only). The first start of an app
waits until a person allows it in the hub, at most approval_timeout
(None: the hub’s default of 120 s). The C API reads a zero timeout as
that default, so a duration under 1 ms (Duration::ZERO included) or
over u32::MAX milliseconds fails with crate::Error::InvalidArgument
before the call; pass None for the default. A refusal ends in one of the
ONBOARDING_APPROVAL_*, ONBOARDING_HUB_NOT_AUTHENTIC or
ONBOARDING_APP_IDENTITY_MISMATCH codes, see
crate::StatusCode::user_action. Stateless: nothing to persist, every start onboards
again.
app_tag (QarOnboardLocalAppTagExt) names this instance of the app: the hub remembers
one peer id per approval and tag, so the next start with the same tag gets the same peer
id back while no other live process holds it. An identity key: printable ASCII, no space
at either end, at most QAR_MAX_APP_TAG_LENGTH bytes, never starting with member/, and
constant across versions of the app; anything else fails with
crate::StatusCode::ARGUMENT_NOT_SUPPORTED. None is the default tag, remembered the
same way. Give instances that run together different tags.
A member hub’s remote-app grant is redeemed with
OnboardExtensions::remote_app_grant next to this mode.