The Atsign FoundationThe Atsign Foundation

pub package pub points gitHub license

at_lookup library

Overview:

The AtLookup Library is the low-level direct implementation of the Atsign Protocol verbs. The AtLookup package is an interface to interact with the secondary server to execute commands(scan, update, lookup, llookup, plookup, etc).

Get started:

Installation:

To add this package as the dependency, add it to your pubspec.yaml

dependencies:
  at_lookup: ^3.0.5

Add to your project

pub get 

Import in your application code

import 'package:at_lookup/at_lookup.dart';

Clone it from github

Feel free to fork a copy of the source from the GitHub Repo

Usage

To get the instance of at_lookup

final AtLookupMuxable atLookUp = AtLookUp.withSecureSocket(
  atSign: '@alice',
  rootDomain: AtRootDomain.atsignDomain,
  transport: secureSocketTransport(SecureSocketConfig()),
  // How this connection authenticates, as one closure. at_lookup holds no key
  // material of its own; at_auth builds an authenticator from whatever
  // credential you have - a keystore, an AtChops, or a bare private key.
  // Pass null for a connection that never authenticates.
  authenticator: authenticatorFor(keysIo, '@alice'),
);

withSecureSocket returns an `AtLookupMuxable`, which is an AtLookUp that also carries the atServer's notification stream, so one connection and one parser handle both of the atServer's framings.

A factory, for a client that opens many connections

AtLookUpFactory is the function type an application hands at_client, so that every connection a client opens travels the way the application chose; secureSocketLookUps in package:at_lookup/at_lookup_io.dart is the default, TLS on TCP:

import 'package:at_lookup/at_lookup_io.dart';

// TLS with your own settings.
final lookUps = secureSocketLookUps(
    config: SecureSocketConfig()..pathToCerts = '/certs');

// Behind a proxy that routes on the atSign: `onConnect` runs once on each new
// connection, before anything else is sent on it.
final viaProxy = secureSocketLookUps(
    onConnect: (connection) => connection.sendSync('from:@alice\n'));

A factory of your own returns any AtLookupMuxable. Each call names what the connection is for: the atSign, the root domain, the authenticator (null for a connection that never authenticates), an optional address finder and the client config. The factory captures how bytes travel. Please refer to examples for more details.

Open source usage and contributions

This is freely licensed open source code, so feel free to use it as is, suggest changes or enhancements or create your own version. See CONTRIBUTING.md for detailed guidance on how to setup tools, tests and make a pull request.

Libraries

at_lookup
at_lookup_io
at_lookup on a native socket: everything in at_lookup.dart, plus the transport that reaches an atServer over TLS on TCP.