smtp

package
v0.70.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

SMTP Fan-out Plugin

With this plugin, you can send an email for every workflow run and attestation.

How to use it

In the following example, we will use the AWS SES service.

  1. To get started, you need to register the plugin in your Chainloop organization.
chainloop integration registered add smtp --opt user=AHDHSYEE7e73 --opt password=kjsdfda8asd**** --opt host=email-smtp.us-east-1.amazonaws.com --opt port=587 --opt to=platform-team@example.com --opt from=notifier@example.com
  1. When attaching the integration to your workflow, you have the option to specify CC:
chainloop integration attached add --workflow $WID --integration $IID --opt cc=security@example.com

cc is optional:

chainloop workflow integration attach --workflow $WID --integration $IID

Starting now, every time a workflow run occurs, an email notification will be sent containing the details of the run and attestation.

Registration Input Schema

Field Type Required Description
from string (email) yes The email address of the sender.
host string yes The host to use for the SMTP authentication.
password string yes The password to use for the SMTP authentication.
port string yes The port to use for the SMTP authentication
to string (email) yes The email address to send the email to.
user string yes The username to use for the SMTP authentication.
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/chainloop-dev/chainloop/app/controlplane/plugins/core/smtp/v1/registration-request",
  "properties": {
    "to": {
      "type": "string",
      "format": "email",
      "description": "The email address to send the email to."
    },
    "from": {
      "type": "string",
      "format": "email",
      "description": "The email address of the sender."
    },
    "user": {
      "type": "string",
      "minLength": 1,
      "description": "The username to use for the SMTP authentication."
    },
    "password": {
      "type": "string",
      "description": "The password to use for the SMTP authentication."
    },
    "host": {
      "type": "string",
      "description": "The host to use for the SMTP authentication."
    },
    "port": {
      "type": "string",
      "description": "The port to use for the SMTP authentication"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "to",
    "from",
    "user",
    "password",
    "host",
    "port"
  ]
}

Attachment Input Schema

Field Type Required Description
cc string (email) no The email address of the carbon copy recipient.
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/chainloop-dev/chainloop/app/controlplane/plugins/core/smtp/v1/attachment-request",
  "properties": {
    "cc": {
      "type": "string",
      "format": "email",
      "description": "The email address of the carbon copy recipient."
    }
  },
  "additionalProperties": false,
  "type": "object"
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(l log.Logger) (sdk.FanOut, error)

Types

type Integration

type Integration struct {
	*sdk.FanOutIntegration
}

func (*Integration) Attach

func (i *Integration) Attach(_ context.Context, req *sdk.AttachmentRequest) (*sdk.AttachmentResponse, error)

Attachment is executed when to attach a registered instance of this integration to a specific workflow

func (*Integration) Execute

func (i *Integration) Execute(_ context.Context, req *sdk.ExecutionRequest) error

Send the SBOM to the configured Dependency Track instance

func (*Integration) Register

func (i *Integration) Register(_ context.Context, req *sdk.RegistrationRequest) (*sdk.RegistrationResponse, error)

Register is executed when a operator wants to register a specific instance of this integration with their Chainloop organization

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL