You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chainloop extensions are a way to extend the functionality of the Chainloop.
4
+
5
+
Currently we only support one type, fan-out extensions. FanOut extensions implement logic that will get executed when attestations or materials are received,
6
+
7
+
## Anatomy of a FanOut Extension
8
+
9
+
### Lifecycle
10
+
11
+
An fanOut extension goes through 4 different stages. Loading, Registration, Attachment and Execution
12
+
13
+
#### Loading
14
+
15
+
Loading is when the extension gets enabled in the Chainloop Control plane. This is implemented via the extension constructor. At this time is when you, as a developer, can configure the identity of the extension and what kind of input you are expecting to receive. Materials, attestations or both.
16
+
17
+
Example:
18
+
19
+
- Load the dependency track instance extension
20
+
21
+
#### Registration
22
+
23
+
Registration is when a specific instance of the extension is configured on a Chainloop organization. A registered instance is then available to be attached to any workflow, more on that later.
24
+
25
+
Example:
26
+
27
+
- Register a dependency track instance by receiving its URL and API key. At this stage, the extension will make sure that the provided information is valid and store it for later use.
28
+
29
+
#### Attachment
30
+
31
+
Attachment happens when a registered instance is attached to a Workflow. This means that any attestations or materials that are received by the workflow will be sent to the attached extension for processing.
32
+
33
+
Example:
34
+
35
+
- Tell the already registered dependency track instance to send the SBOMs to a specific project.
36
+
37
+
#### Execution
38
+
39
+
This is the actual execution of the extension. This is where the extension will do its work. i.e call a workflow, or send a notification.
40
+
41
+
Example:
42
+
43
+
In the dependency track use-case we will
44
+
45
+
- Get the instance URL and API key from the state stored during the registration phase
46
+
- Get the specific project where we want to post the SBOMs from the attachment phase
47
+
- Send the SBOMs to the dependency track instance
48
+
49
+
## How to create a new extension
50
+
51
+
52
+
We offer a starter template in `./core/template`. Just copy it to a new folder and follow the steps shown in its readme.
0 commit comments