dart_wot library

A W3C Web of Things implementation written in Dart.

Classes

AccessTokenRequest
Request for an access token, sent from the client, as defined in section 5.8.1 of draft-ietf-ace-oauth-authz.
AccessTokenResponse
Response to an AccessTokenRequest containing the Access Token among additional information, as defined in section 5.8.2 of draft-ietf-ace-oauth-authz.
AceCredentials
Credentials used for the AceSecurityScheme.
AifScope
A scope encoded using the Authorization Information Format (AIF) for ACE.
AifScopeElement
An element as part of an AifScope, consisting of a path and a set of permissions which are specified as a set of REST methods.
ApiKeyCredentials
Credentials used for the ApiKeySecurityScheme.
AuthServerRequestCreationHint
This is sent by an RS as a response to an Unauthorized Resource Request Message to help the sender of the Unauthorized Resource Request Message acquire a valid access token.
BasicCredentials
Credentials used for the BasicSecurityScheme.
BearerCredentials
Credentials used for the BearerSecurityScheme.
BinaryScope
A scope encoded using a custom binary encoding. See Scope for more information.
ClientSecurityProvider
Class for providing callbacks for client Credentials at runtime.
CoapClientFactory
A ProtocolClientFactory that produces CoAP clients.
CoapConfig
Allows for configuring the behavior of CoAP clients and servers.
CoapServer
A ProtocolServer for the Constrained Application Protocol (CoAP).
ConsumedThing
Represents a client API to operate a Thing. Belongs to the WoT Consumer conformance class.
ContentCodec
Interface for providing a codec for a specific media type.
ContentSerdes
Class providing serializing and deserializing capabilities.
CoseKey
A COSE Key structure as specified in RFC 8152, section 7.
Credentials
Base class used for defining credentials for Thing Interactions.
DigestCredentials
Credentials used for the DigestSecurityScheme.
EncryptedCoseKey
An encrypted CoseKey used to represent a symmetric key.
ErrorResponse
Details about an error which occurred for an access token request.
ExposedThing
The ExposedThing interface is the server API to operate the Thing that allows defining request handlers, Property, Action, and Event interactions.
Form
Contains the information needed for performing interactions with a Thing.
HttpClientFactory
A ProtocolClientFactory that produces HTTP and HTTPS clients.
HttpConfig
Allows for configuring the behavior of HTTP clients and servers.
HttpServer
A ProtocolServer for the Hypertext Transfer Protocol (HTTP).
InteractionOptions
Holds the interaction options that need to be exposed for application scripts according to the Thing Description.
InteractionOutput
Exposes the data obtained by Thing interactions.
LibdcafScope
A scope encoded using the Authorization Information Format (AIF) for ACE as in AifScope, but only consisting of a single AifScopeElement instead of an array of them.
MqttClientFactory
ProtocolClientFactory for creating MqttClients.
MqttConfig
Allows for configuring the behavior of MQTT clients and servers.
OAuth2Credentials
Credentials used for the OAuth2SecurityScheme.
PlainCoseKey
An unencrypted CoseKey used to represent an asymmetric public key or (if the CWT it's contained in is encrypted) a symmetric key.
PlainKeyId
Proof-of-possession key represented by only its Key ID.
ProofOfPossessionKey
A proof-of-possession key as specified by RFC 8747, section 3.1.
ProtocolClient
Base class for a Protocol Client.
ProtocolClientFactory
Base class for a factory that produces ProtocolClients.
ProtocolServer
Base class for a Protocol Server.
PskCredentials
Credentials used for the PskSecurityScheme.
Scope
Scope of an access token as specified in draft-ietf-ace-oauth-authz, section 5.8.1.
Servient
A software stack that implements the WoT building blocks.
Subscription
Represents a subscription to Property change and Event interactions.
TextScope
A scope encoded as a space-delimited list of strings, as defined in RFC 6749, section 1.3.
ThingDescription
Represents a WoT Thing Description
ThingDiscovery
Provides the properties and methods controlling the discovery process.
ThingFilter
Contains the constraints for discovering Things as key-value pairs.
ThingModel
Class representing a WoT Thing Model.
WoT
Interface for a WoT runtime.

Enums

AceProfile
Profiles for ACE-OAuth as specified in section 5.8.4.3 of draft-ietf-ace-oauth-authz.
AifRestMethod
Possible REST (CoAP or HTTP) methods, intended for use in an AifScopeElement.
Algorithm
COSE algorithms as described in draft-ietf-cose-rfc8152bis-algs and draft-ietf-cose-hash-algs.
DiscoveryMethod
Enumeration of possible discovery methods.
ErrorCode
Error code specifying what went wrong for a token request, as specified in section 5.2 of RFC 6749 and section 5.8.3 of draft-ietf-ace-oauth-authz.
GrantType
Type of the resource owner's authorization used by the client to obtain an access token. For more information, see section 1.3 of RFC 6749.
KeyOperation
An operation that a key can be used for, as defined in Table 4 of section 7.1 of RFC 8152.
KeyType
Denotes a family of keys.
QoS
Enum for indicating the default Quality of Service (QoS) that should be used for triggering interaction affordances.
SubscriptionType
Indicates the type of the subscription.
TokenType
The type of the token issued as described in section 7.1 of RFC 6749.

Constants

defaultMediaType → const String
Defines application/json as the default content type.

Properties

thingDescriptionSchema → JsonSchema
JSON Schema definition used for validating Thing Descriptions.
final

Functions

findUnsubscribeForm(InteractionAffordance interaction, SubscriptionType type, Form form, int? formIndex) Form
Finds a matching unsubscribe Form for a subscription form.

Typedefs

AceSecurityCallback = Future<AceCredentials?> Function(Uri uri, Form? form, AuthServerRequestCreationHint? creationHint, AceCredentials? invalidAceCredentials)
Function signature for an asynchronous callback for providing client AceCredentials at runtime, based on an optional creationHint given by the Resource Server. This creation hint has to be parsed by the library user.
ActionHandler = Future<void> Function(InteractionOutput params, InteractionOptions? options)
A function that is called when an external request for invoking an Action is received and defines what to do with such requests.
AsyncClientSecurityCallback<T extends Credentials> = Future<T?> Function(Uri uri, Form? form, T? invalidCredentials)
Function signature for an asynchronous callback for providing client Credentials at runtime.
ClientPskCallback = PskCredentials? Function(Uri uri, Form? form, Uint8List? identityHint)
Function signature for a synchronous callback for providing client PskCredentials at runtime.
ContextEntry = ({String? key, String value})
Type definition for a JSON-LD @context entry.
ErrorListener = void Function(Exception data)
User provided callback that is given an argument of type Error and is used for conveying critical and non-critical errors from the Protocol Bindings to applications.
EventListenerHandler = Future<InteractionInput?> Function()
A function that is called when an associated Event is triggered and provides the data to be sent with the Event to subscribers.
EventSubscriptionHandler = Future<void> Function(InteractionOptions? options)
A function that is called when an external request for subscribing to an Event is received and defines what to do with such requests.
ExposedThingInit = Map<String, dynamic>
Dictionary used for the initialization of an exposed Thing.
InteractionInput = Object?
The (optional) input for an interaction.
InteractionListener = void Function(InteractionOutput data)
User provided callback that is given an argument of type InteractionOutput and is used for observing Property changes and handling Event notifications.
PropertyReadHandler = Future<InteractionInput?> Function(InteractionOptions? options)
A function that is called when an external request for reading a Property is received and defines what to do with such requests.
PropertyReadMap = Map<String, InteractionOutput>
Maps multiple InteractionOutputs to property names.
PropertyWriteHandler = Future<void> Function(InteractionOutput value, InteractionOptions? options)
A function that is called when an external request for writing a Property is received and defines what to do with such requests.
PropertyWriteMap = Map<String, InteractionInput?>
Maps multiple InteractionInputs to property names.
ServerSecurityCallback = Map<String, Credentials> Function(String id)
Function signature for a synchronous callback retrieving server Credentials by Thing id at runtime.

Exceptions / Errors

ContentSerdesException
Custom Exception that is thrown when Serialization or Deserialization fails.
ServientException
Exception that is thrown by a Servient.
UnsubscribeException
Exception that is thrown when error during the unsubscribe process occurs.
UriVariableException
This Exception is thrown when URI variables are being used in the Form of a TD but no (valid) values were provided.