Module Peertube_auth.Client

PeerTube client with authentication.

This module provides a high-level client that handles authentication and session management for PeerTube API access.

Client Type

type t

An authenticated PeerTube client.

Authentication

val login_password : sw:Eio.Switch.t -> env: < clock : _ Eio.Time.clock ; fs : Eio.Fs.dir_ty Eio.Path.t ; net : _ Eio.Net.t.. > -> ?requests_config:Requests.Cmd.config -> ?profile:string -> server_url:string -> username:string -> password:string -> unit -> t

login_password ~sw ~env ?requests_config ?profile ~server_url ~username ~password () authenticates with username and password using OAuth2 password grant.

The OAuth client credentials are automatically retrieved from the server. On success, the session is saved to disk.

val resume : sw:Eio.Switch.t -> env: < clock : _ Eio.Time.clock ; fs : Eio.Fs.dir_ty Eio.Path.t ; net : _ Eio.Net.t.. > -> ?requests_config:Requests.Cmd.config -> ?profile:string -> session:Session.t -> unit -> t

resume ~sw ~env ?requests_config ?profile ~session () creates a client from an existing session.

val logout : t -> unit

logout t removes the saved session.

Accessors

val client : t -> Peer_tube.t

client t returns the underlying PeerTube API client.

val session : t -> Session.t

session t returns the session.

val profile : t -> string option

profile t returns the profile name, if any.

fs t returns the filesystem.