pub struct UserProfile<'a> {
pub id: UserId,
pub login_name: Cow<'a, str>,
pub display_name: Option<Cow<'a, str>>,
pub profile_pic_url: Option<Url>,
pub groups: Vec<Cow<'a, str>>,
}Expand description
Display-friendly data for a User. Includes the Login::login_name for display purposes.
but not the Login::provider. Also includes derived data from one of the Logins
associated with a User.
Fields§
§id: UserIdThe unique integer ID of this Tailscale user this UserProfile is associated with.
login_name: Cow<'a, str>An email address or “email-ish” string (e.g. “alice@github”) associated with this Tailscale
user’s UserProfile, according to the IdP. For display purposes only.
display_name: Option<Cow<'a, str>>If populated, the display name of this Tailscale user (e.g. “Alice Smith”), according to the IdP.
profile_pic_url: Option<Url>If populated, a URL to a profile picture representing this Tailscale user.
groups: Vec<Cow<'a, str>>A subset of the groups that contain this user and that the coordination server was
configured to report to this node: either SCIM groups (e.g. engineering@example.com) or
group names from the tailnet policy document (e.g. group:eng).
This is the one attribute of an owning user that a node cannot re-derive from anything else
control sends it, so it is what an embedder authorising an inbound connection on group
membership needs (Go surfaces it through WhoIs).
Control sorts the list when it loads the profile from storage, so it arrives sorted; it is
carried through verbatim rather than re-sorted here. The field is omitempty on the wire —
an older control server, or a tailnet that reports no groups to this node, simply omits it —
so it decodes to an empty list, never a missing profile. null (what a non-Go control
plane emits for an empty slice) lands the same way, per the crate-wide null_to_default
convention for bare Vec fields.
Trait Implementations§
Source§impl<'a> Clone for UserProfile<'a>
impl<'a> Clone for UserProfile<'a>
Source§fn clone(&self) -> UserProfile<'a>
fn clone(&self) -> UserProfile<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more