pub struct Claims {
pub channels: ChannelScope,
pub permissions: SegmentPermissions,
pub reference: Option<String>,
pub replay: Replay,
pub allow_echo: bool,
}Expand description
What one set of credentials grants. Your server decides the claims for a user that it has authenticated. Nothing from the client can make them wider.
Claims has no default. You must choose the channels and the permissions,
so unrestricted access is never granted by omission (AUTH-02).
Claims::new sets the other fields to their defaults: no reference, no
replay and no echo.
Fields§
§channels: ChannelScopeThe channels that the credentials can connect to.
permissions: SegmentPermissionsThe access to the segments of those channels.
reference: Option<String>Identifies the token, such as a user id, in presence and in
deliveries. It must not be empty and must not contain a colon, CR or
LF. None leaves it out.
replay: ReplayThe history that the server replays each time the connection joins a segment.
allow_echo: boolLets a connection receive its own publishes.
Implementations§
Source§impl Claims
impl Claims
Sourcepub fn new(channels: ChannelScope, permissions: SegmentPermissions) -> Claims
pub fn new(channels: ChannelScope, permissions: SegmentPermissions) -> Claims
Claims with the given channels and permissions, no reference, no replay and no echo.