at_lookup_web library
at_lookup on a browser WebSocket: everything in at_lookup.dart, plus the
transport and the atDirectory lookup that reach an atServer from a browser.
The split exists so that naming the browser transport is what pulls the
web imports in. A caller that imports only at_lookup.dart and injects
its own transport does not acquire package:web through a default it never
asked for.
A browser cannot open raw TLS, so webSocketLookUps asks the atDirectory
over HTTPS and opens wss:// straight to the atServer, which upgrades
/ws on its own TLS port. fixedAddressWebSocketLookUps skips the
atDirectory and connects every atSign to one atServer, for development.
Classes
- AtCommandExecutor
- The narrow view of a connection that an AtAuthenticator is given: enough to run a challenge-response, and nothing else.
- AtLookUp
- AtLookUpExceptionUtil
- AtLookUpExceptionUtil to get ErrorCode and ErrorDescription
- AtLookupImpl
- AtLookupMessageListenerFactory
- Builds the listener that reads an open connection, over any transport.
- AtLookupMuxable
- An AtLookUp that also carries the atServer's asynchronous notification stream, so one class reads every kind of message the atServer sends.
- AtLookupOutboundConnectionFactory
- AtLookupTransport
-
How an AtLookupMuxable makes connections: the three factories
AtLookupImplhas always accepted, bundled into one value. - AtSignServerCheck
- What checkAtSignServer found: the state, and for the two unreachable states the cause the lookup failed with.
- AtTransport
- A bidirectional byte channel to an atServer, opened by an AtTransportFactory.
- AtTransportFactory
- Opens AtTransports.
- FixedSecondaryAddressFinder
- Resolves every atSign to one fixed address, without touching the network.
- HttpsSecondaryAddressFinder
-
Finds an atServer through the atDirectory's HTTPS face:
GET scheme://host:port/@aliceanswers200withatServerHost:port, or404for an atSign it does not hold. - OutboundConnection
- OutboundConnectionImpl
- OutboundConnectionMetadata
- Metadata information for OutboundConnection
- SecondaryAddress
- SecondaryAddressFinder
- WebSocketTransport
- A WebSocket as an AtTransport.
- WebSocketTransportFactory
-
Opens WebSocketTransports to
scheme://host:port+ path.
Enums
- AtSignServerState
- Where an atSign stands, as the atDirectory and its atServer report it.
Functions
-
checkAtSignServer(
AtLookUp lookUp, String atSign, {Duration? timeout}) → Future< AtSignServerCheck> -
Asks, over
lookUp, whetheratSignis in the atDirectory, whether its atServer answers, and whether the atSign has been activated. -
fixedAddressWebSocketLookUps(
{required String host, required int port, String path = '/ws', Future< void> onConnect(AtCommandExecutor connection)?}) → AtLookUpFactory -
An AtLookUpFactory for development, connecting every atSign to the
atServer at
wss://host:port+pathwithout asking the atDirectory. -
validatedFromChallenge(
String challenge, String atSign) → String -
Returns
challengewhen it is a well-formedfrom:challenge issued toatSign; throwsUnAuthenticatedExceptionotherwise. -
webSocketLookUps(
{String path = '/ws', int directoryPort = 443, Future< void> onConnect(AtCommandExecutor connection)?}) → AtLookUpFactory -
The browser AtLookUpFactory: each atSign is looked up with an
HttpsSecondaryAddressFinder on the root domain's host at
directoryPort, and each connection is a WebSocket towss://atServerHost:port+path. -
webSocketTransport(
{String path = '/ws', String scheme = 'wss'}) → AtLookupTransport -
A browser WebSocket — the transport to pass to
AtLookUp.withTransportunless you are supplying your own.schemeiswsonly for tests.
Typedefs
-
AtAuthenticator
= Future<
bool> Function(AtCommandExecutor executor) -
Performs one authentication on a connection that is already open, using
executorto speak to the atServer, and returns whether it succeeded. - AtLookUpFactory = AtLookupMuxable Function({required String atSign, required AtAuthenticator? authenticator, required AtRootDomain rootDomain, SecondaryAddressFinder? secondaryAddressFinder})
- Builds the connection a client uses to reach an atServer: what an application hands the entry points so that every connection the client opens - its own, its sync's, its monitor's - travels the way the application chose.
Exceptions / Errors
- AtLookUpException
- AtLookUpException class