pub struct PersonaDialer { /* private fields */ }Expand description
Reusable handle for the control plane’s PersonaService.
The verified identity-linking ceremonies. Shares the AgentService
endpoint — all three services are served on one internal Connect port —
so it is built from the same address.
Implementations§
Source§impl PersonaDialer
impl PersonaDialer
Sourcepub fn new(addr: &str) -> Result<Self, DialError>
pub fn new(addr: &str) -> Result<Self, DialError>
Build a dialer pointed at addr (expects http://host:port).
§Errors
Returns DialError::InvalidAddress if addr isn’t a valid URI.
Sourcepub fn with_bearer(addr: &str, bearer: &str) -> Result<Self, DialError>
pub fn with_bearer(addr: &str, bearer: &str) -> Result<Self, DialError>
Build a dialer pointed at addr, authenticated with bearer.
Every call this dialer makes carries an Authorization: Bearer <bearer> header. PersonaService doesn’t send AgentStart, so no
signed AssertedAttribution envelope rides these calls — bearer-only.
§Errors
Returns DialError::InvalidAddress if addr isn’t a valid URI, or
DialError::InvalidBearer if bearer can’t be encoded as an HTTP
header value.
Sourcepub fn new_admin(addr: &str, bearer: &str) -> Result<Self, DialError>
pub fn new_admin(addr: &str, bearer: &str) -> Result<Self, DialError>
Build a dialer pointed at addr, presenting bearer as the #803
admin service-credential (Authorization: Bearer pc_<id>_<secret>,
a current record in State’s credential authority carrying admin
access) every require_admin-gated PersonaService RPC checks before
it will even look at the body-supplied actor. Self::new’s dialer never presents this header
— use new_admin (not new) for Self::rebuild_usage_rollups and
any future RPC gated the same way.
§Errors
Returns DialError::InvalidAddress if addr isn’t a valid URI,
DialError::InvalidBearer if bearer can’t be encoded as an HTTP
header value, or DialError::Tls if an https endpoint’s TLS setup
fails.
Sourcepub async fn rebuild_usage_rollups(
&self,
actor: ExternalIdentity,
) -> Result<UsageRollupsRebuilt, DialError>
pub async fn rebuild_usage_rollups( &self, actor: ExternalIdentity, ) -> Result<UsageRollupsRebuilt, DialError>
Admin-gated maintenance (#457): recompute every persona’s usage
rollup from a full eventlog replay and overwrite the maintained
counters wholesale — the repair path for the crash window a
best-effort post-commit rollup write leaves open. Build this dialer
with Self::new_admin, not Self::new.
§Errors
Returns DialError::Connect for any transport/encoding error,
including a permission_denied refusal (missing/invalid bearer, or a
non-admin actor).
Sourcepub async fn start_link(
&self,
identity: ExternalIdentity,
) -> Result<StartedLink, DialError>
pub async fn start_link( &self, identity: ExternalIdentity, ) -> Result<StartedLink, DialError>
Mint a single-use link-ceremony code bound to identity’s persona
(provisioning one on first contact). The returned StartedLink::code
is a credential the caller must deliver only to a private channel the
user owns.
§Errors
Returns DialError::Connect for any transport/encoding error.
Sourcepub async fn start_deeplink(
&self,
identity: ExternalIdentity,
) -> Result<StartedDeepLink, DialError>
pub async fn start_deeplink( &self, identity: ExternalIdentity, ) -> Result<StartedDeepLink, DialError>
Mint a high-entropy deep-link token bound to identity’s persona, for
a no-typing ceremony (the caller embeds StartedDeepLink::token in a
platform URL like https://t.me/<bot>?start=<token>). The token is a
credential — deliver the URL only to a private channel the user owns.
Completed via Self::complete_link from the target platform.
§Errors
Returns DialError::Connect for any transport/encoding error.
Sourcepub async fn admin_invite(
&self,
actor: ExternalIdentity,
target: ExternalIdentity,
) -> Result<StartedLink, DialError>
pub async fn admin_invite( &self, actor: ExternalIdentity, target: ExternalIdentity, ) -> Result<StartedLink, DialError>
Admin-gated: mint an invite code for a TARGET identity distinct from the acting admin. The code binds to the target — only the target can redeem it — and is a credential: deliver it only to a private channel the TARGET owns, never back through the admin’s shared surfaces.
§Errors
Returns DialError::Connect for any transport/encoding error; a
non-admin actor surfaces as permission_denied.
Sourcepub async fn set_incognito(
&self,
actor: ExternalIdentity,
conversation_id: &str,
on: bool,
) -> Result<bool, DialError>
pub async fn set_incognito( &self, actor: ExternalIdentity, conversation_id: &str, on: bool, ) -> Result<bool, DialError>
Toggle incognito for a conversation (#796): suppresses memory
extraction from here on when on, clears the suppression when not.
The control plane authorizes actor — an admin may toggle any
conversation, anyone else only one they are a caller or participant
of — so a non-admin’s own conversation is reachable through this same
call; an unrelated conversation surfaces as permission_denied.
§Errors
Returns DialError::Connect for any transport/encoding error,
including a permission_denied refusal.
Sourcepub async fn auto_link(
&self,
identity: ExternalIdentity,
asserted_email: &str,
basis: &str,
) -> Result<Option<String>, DialError>
pub async fn auto_link( &self, identity: ExternalIdentity, asserted_email: &str, basis: &str, ) -> Result<Option<String>, DialError>
Deterministic workspace-email auto-link: bind identity to the
persona already holding a ceremony-verified email matching
asserted_email. The email must come from the PLATFORM API (e.g.
Slack users.info) — never from user-typed text. Returns whether a
link happened so the edge can notify the user (“if this wasn’t
you…”); halting outcomes come back as Ok(None).
§Errors
Returns DialError::Connect for any transport/encoding error.
Sourcepub async fn attest_verified_email(
&self,
identity: ExternalIdentity,
verified_email: &str,
) -> Result<AttestedEmail, DialError>
pub async fn attest_verified_email( &self, identity: ExternalIdentity, verified_email: &str, ) -> Result<AttestedEmail, DialError>
First-party backend attestation (docs/reference/personas.md §2): assert
that identity’s email is already verified by the calling backend’s
own signup flow — no code, no magic-link round trip. Requires a
service credential carrying Capabilities::attest_email; the caller
is authenticated as itself, never as identity. Resolves-or-
provisions identity: a genuinely first-time identity (no prior
agent contact) still gets a fresh persona in this one call — the
caller may attest at raw account creation or lazily on/after first
contact, whichever fits.
§Errors
Returns DialError::Connect for any transport/encoding error,
including permission_denied when the presented credential lacks
attest_email.
Sourcepub async fn complete_link(
&self,
code: &str,
identity: ExternalIdentity,
) -> Result<LinkCeremony, DialError>
pub async fn complete_link( &self, code: &str, identity: ExternalIdentity, ) -> Result<LinkCeremony, DialError>
Consume code from the channel being claimed, binding identity to
the minting persona (merging identity’s prior persona if it had one).
§Errors
Returns DialError::Connect for any transport/encoding error.
Sourcepub async fn describe(
&self,
identity: ExternalIdentity,
) -> Result<PersonaView, DialError>
pub async fn describe( &self, identity: ExternalIdentity, ) -> Result<PersonaView, DialError>
Read-only: the profile the identity resolves to, as an edge-friendly
PersonaView. Returns an all-empty view for an identity not yet in
the directory; never provisions a persona.
§Errors
Returns DialError::Connect for any transport/encoding error.
Trait Implementations§
Source§impl Clone for PersonaDialer
impl Clone for PersonaDialer
Source§fn clone(&self) -> PersonaDialer
fn clone(&self) -> PersonaDialer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PersonaDialer
impl !UnwindSafe for PersonaDialer
impl Freeze for PersonaDialer
impl Send for PersonaDialer
impl Sync for PersonaDialer
impl Unpin for PersonaDialer
impl UnsafeUnpin for PersonaDialer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request