cattle_grid.extensions.examples.simple_register ¶
This extension is meant to create an endpoint, where people can register. It is deployed on dev.bovine.social, and can be seen as an opportunity to test cattle_grid’s public APIs.
Sample configuration, see RegisterConfiguration for details.
[[extensions]]
module = "cattle_grid.extensions.examples.simple_register"
api_prefix = "/simple_register"
[[extensions.config.registration_types]]
name = "dev"
permissions = ["dev"]
extra_parameters = ["fediverse"]
create_default_actor_on = "https://dev.bovine.social"
The parameter create_default_actor_on causes an actor to be created.
It will
- have the acct-uri
acct:{name}@dev.bovine.social. - be linked to the account
namewith the namedefault. - automatically accept followers.
extension
module-attribute
¶
extension = Extension(
"simple_register",
__name__,
config_class=RegisterConfiguration,
)
Definition of the extension
config ¶
RegisterConfiguration ¶
Bases: BaseModel
Configuration for the register endpoint
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registration_types
|
list[RegistrationType]
|
List of registration types |
required |
Source code in cattle_grid/extensions/examples/simple_register/config.py
RegistrationType ¶
Bases: BaseModel
Configuration for one registration path
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
name of the registration. Will be part of the path, i.e. |
required |
permissions
|
list[str]
|
List of permissions given to the registering account. |
required |
extra_parameters
|
list[str]
|
Extra parameters that should be in the request, will be stored in the actors meta information |
[]
|
create_default_actor_on
|
str | None
|
Attempt to create an actor on the specified base_url. The actor will be given the acct-uri |
None
|