Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Web.Finger.Client
Description
A Haskell client library for performing WebFinger queries.
This module provides functions and data types for constructing and sending WebFinger queries over HTTPS. It allows users to query information about various resources, such as accounts or URIs, and retrieve associated metadata as described in the WebFinger protocol.
The main entry points are:
webfinger
– Sends a WebFinger query and returns a structured response.newManager
– Creates an HTTPS connection manager required for making requests.
The core data types include:
Query
– Represents a WebFinger query.Resource
– Specifies the entity being queried.Description
– Contains the response data from a WebFinger query.Link
– Represents links returned in a WebFinger response.Language
– Defines language codes used in WebFinger responses.
This module depends on 'http-client' and aeson
for handling HTTP requests
and JSON parsing.
Synopsis
- data Account = Account {}
- data Resource
- data Auth = Auth {}
- data Query = Query {}
- data Link = Link {}
- data Description = Description {
- desSubject :: Maybe Text
- desAliases :: [Text]
- desProperties :: HashMap Text (Maybe Text)
- desLinks :: [Link]
- data Result
- newManager :: IO Manager
- webfinger :: Manager -> Query -> IO Result
- data Language
Documentation
A given user at a given host. For example, john@example.org means the user is john and the host is example.org.
Constructors
Account | |
Fields
|
A web resource about which you'd like to make a query.
Constructors
ResAccount Account | |
ResUri URI | |
ResUriStr ByteString |
HTTP user authentication details.
Constructors
Auth | |
Fields |
A WebFinger query, for which the client can get a response.
In the Default
instance, all fields are empty/null and there are no
auth details. Therefore you must at least (but it is also enough to) specify
the qryTarget
URI.
Constructors
Query | |
Fields
|
Represents a link from the target resource to some other web resource. This is more than a simple webpage link: It also has a relation type (i.e. what is the relation between the target resource and the referred resource) and additional properties.
Constructors
Link | |
Fields
|
data Description Source #
Information about the target resource, returned when a query succeeds.
Constructors
Description | |
Fields
|
Instances
Show Description Source # | |
Defined in Web.Finger.Client Methods showsPrec :: Int -> Description -> ShowS # show :: Description -> String # showList :: [Description] -> ShowS # | |
FromJSON Description Source # | |
Defined in Web.Finger.Client |
Response to the query.
Constructors
Success Description | The WebFinger server returned a valid resource description. |
InvalidDesc String | The server returned a description but we failed to parse it. |
NoInfoFound | The server doesn't have information about the query target. |
TargetMalformed | The server says the target URI is either absent from the HTTP request, or is malformed. |
HostNotDetected String | We (client side) couldn't determine the host to which to send the query. This usually means no host was explicitly specified, and the attempt to extract the host from the query target resource failed. |
newManager :: IO Manager Source #
A connection manager, see Network.HTTP.Client for details. This function
creates a manager which can handle HTTPS, which is required for WebFinger
and regular HTTP isn't allowed. If you'd like to make queries in other
ways which require more support (e.g. perhaps Tor), create your own manager
instead using one of the http-client-*
packages.
Arguments
:: Manager | Connection manager. See |
-> Query | A query expressing what you'd like to know, and whom to ask. |
-> IO Result |
Send a WebFinger query over HTTPS to a WebFinger server, and get a response.
Some HTTP exceptions which represent common query results are caught and
used to determine the return value, i.e. the Result
. All other HTTP
exceptions aren't handled.
Natural Language code. Used to express in which language a text string is written.
Instances
Generic Language Source # | |
Show Language Source # | |
Eq Language Source # | |
Hashable Language Source # | |
Defined in Web.Finger.Client | |
FromJSON Language Source # | |
Defined in Web.Finger.Client | |
FromJSONKey Language Source # | |
Defined in Web.Finger.Client Methods | |
type Rep Language Source # | |
Defined in Web.Finger.Client type Rep Language = D1 ('MetaData "Language" "Web.Finger.Client" "webfinger-client-0.2.1.0-inplace" 'False) (C1 ('MetaCons "LanguageCode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "LanguageUndefined" 'PrefixI 'False) (U1 :: Type -> Type)) |