bsky.auth

Atproto authenticator
License: BSL-1.0
struct LoginInfo;
Login information
string identifier;
string password;
struct SessionInfo;
Session information
struct DidDoc;
DidDoc didDoc;
string[] atContext;
string id;
string[] alsoKnownAs;
struct VerificationMethod;
VerificationMethod[] verificationMethod;
string id;
string type;
string contoroller;
string publicKeyMultibase;
struct Service;
Service[] service;
string id;
string type;
string serviceEndpoint;
@safe void opAssign(in DidDoc lhs);
string handle;
string did;
string accessJwt;
string refreshJwt;
string email;
bool emailConfirmed;
bool active;
@safe void opAssign(in SessionInfo lhs);
static @safe SessionInfo fromJsonString(string json);
static @safe SessionInfo fromJson(JSONValue json);
const @safe JSONValue toJson();
const @safe string toJsonString();
class AtprotoAuth;
Bluesky authenticator
@safe this(Client = CurlHttpClient!())(string endpoint = "https://bsky.social", Client client = new Client);
@safe this(Client : HttpClientBase)(string endpoint = "https://bsky.social", Client client);
shared @safe this(Client = CurlHttpClient!())(string endpoint = "https://bsky.social", Client client = new Client);
shared @trusted this(Client : HttpClientBase)(string endpoint = "https://bsky.social", Client client);
Constructor
@trusted void createSession(LoginInfo info);
shared @trusted void createSession(LoginInfo info);
@safe void createSession(string id, string password);
shared @trusted void createSession(string id, string password);
createSession API
@trusted void refreshSession();
shared void refreshSession();
refreshSession API
@trusted void deleteSession();
shared @trusted void deleteSession();
deleteSession API
enum UpdateStrategy: int;
Update strategy
force
expired
before5min
herf
@trusted void updateSession();
shared @trusted void updateSession();
@trusted void updateSession(UpdateStrategy strategy);
shared @trusted void updateSession(UpdateStrategy strategy);
Update session information
@trusted void restoreSession(in SessionInfo sessionInfo);
shared @trusted void restoreSession(in SessionInfo sessionInfo);
@trusted void restoreSessionFromTokens(string accessJwt, string refreshJwt);
shared @trusted void restoreSessionFromTokens(string accessJwt, string refreshJwt);
@trusted void restoreSessionFromRefreshToken(string refreshJwt);
shared @trusted void restoreSessionFromRefreshToken(string refreshJwt);
refreshSession API
const @trusted const(SessionInfo) storeSession();
shared const @trusted const(SessionInfo) storeSession();
const @trusted string storeSessionOnlyRefreshToken();
shared const @trusted string storeSessionOnlyRefreshToken();
const @trusted Tuple!(string, "accessJwt", string, "refreshJwt") storeSessionOnlyToken();
shared const @trusted Tuple!(string, "accessJwt", string, "refreshJwt") storeSessionOnlyToken();
refreshSession API
const @trusted bool available();
shared const @trusted bool available();
Available
const @trusted string bearer();
shared const @trusted string bearer();
createSession API
const @trusted string did();
shared const @trusted string did();
createSession API
const @safe SysTime expire();
shared const @trusted SysTime expire();
const @safe SysTime refreshExpire();
shared const @trusted SysTime refreshExpire();
Expire duration of auth