Apps
Last updated
Last updated
You can extend Aidbox with custom Apps. The app can:
define custom resources,
define custom endpoints,
subscribe to hooks or subscriptions.
The app is a standalone service that will work with Aidbox to implement your specific app. The app should be registered in Aidbox. Aidbox SDKs support using Apps:
To define the App, we should provide the app manifest.
Here's the manifest structure:
In the endpoint
section, you describe how Aidbox will communicate with your service:
In the operation section, you define Custom REST operations as a map <operation-id>: <operation-definition> and access policy (which will be bound to this operation):
Parameters:
In the resources section, you can provide other resources for Aidbox in the form {resourceType: {id: resource}}
using Aidbox format:
In this example, the AccessPolicy resource will be created as well as the App resource.
It is a deprecated option to create custom resources via Entity/Attribute approach.
In the entities
section of the App manifest, you can extend existing resources, define custom profiles, or hook into the lifecycle:
As well as define custom resources:
In the entities
section, resources are defined in the format <resourceType> : <structure>
:
Resource structure is defined by attrs
keyword:
At the root of resource definition, you can also define hooks and profiles for this resource.
Element definition will be translated into Attribute Meta-Resource and have the following properties:
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
id
string
Id of the App resource
apiVersion (required)
integer
App API version. Currently, the only option is 1
type (required)
enum
Type of application. Currently, the only option is app
endpoint
object
Information about endpoint: url to redirect the request, protocol, and secret
operations
array of operations
Custom endpoints
resources
array of resources in Aidbox format
Related resources that should be also created
subscriptions
array of subscriptions
Deprecated subscriptions support. Consider using Aidbox topic-based subscriptions or SubsSubscriptions instead
entities
array of entities
Deprecated Entities/Attributes approach to create custom resources
type (required)
string
Protocol of communication. The only option now is http-rpc
url (required)
string
Url of the service to redirect a request
secret
string
Secret for Basic Authorization header: base64(<id>:<secret>)
method
string
One of: GET
, POST
, PUT,
DELETE
, PATCH
, OPTION
path
array of strings or objects
New endpoint in Aidbox in array
policies
object
Access policies to create and bound to this operation