RelayAuth class sealed

Which identity a request may be attributed to on a relay (NIP-42).

A connection carries at most one identity, chosen when it is opened and immutable for its whole lifetime (RelayConnectionKey), so asking for an identity is really asking for a connection.

Implementers

Constructors

RelayAuth.allow(Account account)
Starts anonymous and moves to a connection bound to account only once a relay refused the request without an identity.
const
factory
RelayAuth.never()
Stays on the anonymous connection and never sends AUTH. A relay that refuses the request without an identity simply does not serve it.
const
factory
RelayAuth.require(Account account)
Goes out on a connection bound to account from the start; it is never sent on the anonymous one.
const
factory

Properties

account Account?
identity this may authenticate as, null when it never authenticates
no setter
canonical String
stable representation, for logs and for telling two requests apart
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromDeprecatedAccounts(List<Account>? accounts) RelayAuth?
The policy the deprecated authenticateAs list stands for: the first account it names that can sign, and nobody when none can.
keyFor(String url, RelayAuth? auth) RelayConnectionKey?
The connection a request under auth must use towards url.