cattle_grid.extensions.examples.webfinger_lookup
Puts performing a webfinger lookup in the processing chain. In a production setting, one can include this extension via
cattle_grid.toml
[[extensions]]
module = "cattle_grid.extensions.examples.webfinger_lookup"
lookup_order = 10
Where the higher the lookup_order
, the earlier the conversion from acct
to resolvable URI happens.
In a test setting, one can make webfinger use http via
cattle_grid.toml
[[extensions]]
module = "cattle_grid.extensions.examples.webfinger_lookup"
config = { protocol = "http" }
Protocol
WebfingerLookupConfig
Bases: BaseModel
Configuration for the webfinger lookup
Parameters:
Name | Type | Description | Default |
---|---|---|---|
protocol
|
Protocol
|
|
<Protocol.https: 'https'>
|
Source code in cattle_grid/extensions/examples/webfinger_lookup.py
protocol = Field(Protocol.https)
class-attribute
instance-attribute
protocol to use, defaults to https
build_domain(config, acct_uri)
Builds the domain to use for webfinger lookups
>>> build_domain(WebfingerLookupConfig(protocol=Protocol.http),
... "acct:alice@server.example")
'http://server.example'