cloudflare

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package cloudflare provides the Cloudflare integration definition for integrations

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAPITokenMissing indicates the Cloudflare API token is missing from the credential
	ErrAPITokenMissing = errors.New("cloudflare: api token missing")
	// ErrCredentialInvalid indicates credential metadata could not be decoded
	ErrCredentialInvalid = errors.New("cloudflare: credential invalid")
	// ErrCredentialMetadataRequired indicates no credential metadata was provided
	ErrCredentialMetadataRequired = errors.New("cloudflare: credential metadata required")
	// ErrTokenVerificationFailed indicates the Cloudflare token verification failed
	ErrTokenVerificationFailed = errors.New("cloudflare: token verification failed")
	// ErrTokenNotActive indicates the Cloudflare token is not in an active state
	ErrTokenNotActive = errors.New("cloudflare: token is not active")
	// ErrClientType indicates the provided client is not a Cloudflare client
	ErrClientType = errors.New("cloudflare: unexpected client type")
	// ErrResultEncode indicates an operation result could not be serialized
	ErrResultEncode = errors.New("cloudflare: result encode failed")
	// ErrMembersFetchFailed indicates the account members list request failed
	ErrMembersFetchFailed = errors.New("cloudflare: members fetch failed")
	// ErrMembersFetchFailed indicates the account members list request failed
	ErrGroupsFetchFailed = errors.New("cloudflare: groups fetch failed")
	// ErrPayloadEncode indicates a collected Cloudflare payload could not be serialized for ingest
	ErrPayloadEncode = errors.New("cloudflare: ingest payload encode failed")
	// ErrAccountIDMissing indicates the account ID is missing from user input
	ErrAccountIDMissing = errors.New("cloudflare: account id missing")
	// ErrOperationConfigInvalid indicates operation configuration could not be decoded
	ErrOperationConfigInvalid = errors.New("cloudflare: operation config invalid")
	// ErrFindingsFetchFailed indicates the Security Center insights list request failed
	ErrFindingsFetchFailed = errors.New("cloudflare: findings fetch failed")
)

Functions

func Builder

func Builder() registry.Builder

Builder returns the Cloudflare definition builder

Types

type Client

type Client struct{}

Client builds Cloudflare API clients for one installation

func (Client) Build

Build constructs the Cloudflare API client for one installation

type CredentialSchema

type CredentialSchema struct {
	// APIToken is the Cloudflare API token with permissions to read account and zone metadata
	APIToken string `json:"apiToken"          jsonschema:"required,title=API Token"`
	// AccountID is the Cloudflare account identifier used for account-scoped API calls
	AccountID string `` /* 137-byte string literal not displayed */
}

CredentialSchema holds the Cloudflare API credentials for one installation

type DirectorySync

type DirectorySync struct {
	// Disable is used to disable the directory sync operation from Cloudflare
	Disable bool `json:"disable,omitempty" jsonschema:"title=Disable,description=Disable the syncing of users and groups from Cloudflare"`
	// FilterExpr limits imported records to envelopes matching the CEL expression
	FilterExpr string `` /* 216-byte string literal not displayed */
}

DirectorySync holds installation-specific configuration collected from the user

func (DirectorySync) IngestHandle

func (d DirectorySync) IngestHandle() types.IngestHandler

IngestHandle adapts directory sync to the ingest operation registration boundary

func (DirectorySync) Run

Run collects Cloudflare account members and emits directory account ingest payloads

type FindingsCollect added in v1.21.7

type FindingsCollect struct{}

FindingsCollect collects Cloudflare Security Center insights for ingest as findings

func (FindingsCollect) IngestHandle added in v1.21.7

func (f FindingsCollect) IngestHandle() types.IngestHandler

IngestHandle adapts findings collection to the ingest operation registration boundary

func (FindingsCollect) Run added in v1.21.7

func (FindingsCollect) Run(ctx context.Context, credentials types.CredentialBindings, client *cf.Client, lastRunAt *time.Time) ([]types.IngestPayloadSet, error)

Run collects Cloudflare Security Center insights and emits finding ingest payloads

type FindingsSync added in v1.21.7

type FindingsSync struct {
	// Disable is used to disable the findings sync operation from Cloudflare
	Disable bool `` /* 136-byte string literal not displayed */
	// FilterExpr limits imported records to envelopes matching the CEL expression
	FilterExpr string `` /* 185-byte string literal not displayed */
}

FindingsSync holds installation-specific configuration for Cloudflare Security Center insights

type HealthCheck

type HealthCheck struct {
	// Status is the token verification status returned by Cloudflare
	Status string `json:"status,omitempty"`
	// ExpiresOn is the token expiry time if set
	ExpiresOn string `json:"expiresOn,omitempty"`
}

HealthCheck holds the result of a Cloudflare health check

func (HealthCheck) Handle

func (h HealthCheck) Handle() types.OperationHandler

Handle adapts the health check to the generic operation registration boundary

func (HealthCheck) Run

Run executes the Cloudflare token verification

type InstallationMetadata

type InstallationMetadata struct {
	// AccountID is the Cloudflare account identifier used for account-scoped collection
	AccountID string `json:"accountId,omitempty" jsonschema:"title=Account ID"`
}

InstallationMetadata holds the stable Cloudflare account identity for one installation

func (InstallationMetadata) InstallationIdentity

InstallationIdentity implements types.InstallationIdentifiable

type UserInput

type UserInput struct {
	// DirectorySync includes the configuration for identity accounts from Cloudflare members
	DirectorySync DirectorySync `json:"directorySync,omitempty" jsonschema:"title=Directory Account Sync"`
	// FindingsSync includes the configuration for findings from Cloudflare Security Center insights
	FindingsSync FindingsSync `json:"findingSync,omitempty" jsonschema:"title=Security Insights Sync"`
}

UserInput holds installation-specific configuration collected from the user

Jump to

Keyboard shortcuts

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