OnboardingInvite class
A one-time onboarding invite minted by the hub: everything another instance needs to
onboard with OnboardOptions.UseInvite, or a code to hand out by
OnboardingInvite.GetCode.
Namespace: Quaternar.Qaros · Assembly: Quaternar.Qaros.dll
public sealed class OnboardingInvite : IDisposable
Implements: IDisposable
Remarks
The caller owns every instance and disposes it; an onboard only borrows it. Invites expire
(OnboardingInvite.GetExpiresUnix) and work once: mint them when needed and do not stockpile
them. They carry a secret, so never log their bytes or code.
Methods
| Member | Description |
|---|---|
| IsValid() | |
| GetMethod() | |
| GetExpiresUnix() | Expiry in Unix seconds, so a UI can warn before handing out a stale invite. |
| GetCode() | The code text to onboard with (OnboardCode). It names its own invitation, so it works for any code the hub minted. It is a secret: never log it. |
| Serialize() | The invite as bytes for your IPC boundary (pipe, shared memory, config field); the receiving instance turns them back with OnboardingInvite.Deserialize. |
| Deserialize(byte[]) | Parses invite bytes from OnboardingInvite.Serialize, or the launch invite QAROS writes as the first stdin line of an API app it starts: pass that JSON line's UTF-8 bytes unchanged. Bytes that are not an invite fail with StatusCode.PakeError. |
| Dispose() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
IsValid
public bool IsValid()
Returns: bool
GetMethod
public Result<OnboardingMethod> GetMethod()
Returns: Result<OnboardingMethod>
GetExpiresUnix
Expiry in Unix seconds, so a UI can warn before handing out a stale invite.
public Result<long> GetExpiresUnix()
GetCode
The code text to onboard with (OnboardCode). It names its own invitation, so it works for any code the hub minted. It is a secret: never log it.
public Result<string> GetCode()
Remarks
Only a OnboardingMethod.Pake invite has one; any other fails with
StatusCode.ArgumentNotSupported.
Serialize
The invite as bytes for your IPC boundary (pipe, shared memory, config field); the
receiving instance turns them back with OnboardingInvite.Deserialize.
public Result<byte[]> Serialize()
Deserialize
Parses invite bytes from OnboardingInvite.Serialize, or the launch invite QAROS writes as
the first stdin line of an API app it starts: pass that JSON line's UTF-8 bytes unchanged.
Bytes that are not an invite fail with StatusCode.PakeError.
public static Result<OnboardingInvite> Deserialize(byte[] inviteData)
Parameters
| Name | Type | Description |
|---|---|---|
inviteData | byte[] |
Returns: Result<OnboardingInvite>
Dispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()