connector

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MembershipEntitlementIDTemplate = "membership:%s"
	V1GrantIDTemplate               = "grant:%s:%s"
)
View Source
const (

	// The list custom roles endpoint does not return the super admin role, so we are manually adding it with Cloudflares super admin role ID.
	SuperAdminRoleId = "33666b9c79b9a5273fc7344ff42f953d"

	XAuthEmailHeaderKey = "X-Auth-Email"
	XAuthKeyHeaderKey   = "X-Auth-Key"
	NF                  = -1
)

Variables

View Source
var ErrMissingAccountID = errors.New(errMissingAccountID)

Functions

func V1GrantID

func V1GrantID(entitlementID string, userID string) string

func V1MembershipEntitlementID

func V1MembershipEntitlementID(resourceID string) string

func WithAuthorizationBearerHeader

func WithAuthorizationBearerHeader(token string) uhttp.RequestOption

Types

type Cloudflare

type Cloudflare struct {
	// contains filtered or unexported fields
}

func (*Cloudflare) Asset

func (*Cloudflare) Metadata

func (c *Cloudflare) Metadata(ctx context.Context) (*v2.ConnectorMetadata, error)

func (*Cloudflare) ResourceSyncers

func (*Cloudflare) Validate

func (c *Cloudflare) Validate(ctx context.Context) (annotations.Annotations, error)

type CloudflareError

type CloudflareError struct {
	ErrorMessage     string                   `json:"error"`
	ErrorDescription string                   `json:"error_description"`
	ErrorCode        int                      `json:"errorCode,omitempty"`
	ErrorSummary     string                   `json:"errorSummary,omitempty" toml:"error_description"`
	ErrorLink        string                   `json:"errorLink,omitempty"`
	ErrorId          string                   `json:"errorId,omitempty"`
	ErrorCauses      []map[string]interface{} `json:"errorCauses,omitempty"`
}

func (*CloudflareError) Error

func (b *CloudflareError) Error() string

type InvitationResourceType added in v0.0.13

type InvitationResourceType struct {
	// contains filtered or unexported fields
}

func (*InvitationResourceType) Delete added in v0.0.13

Delete cancels a pending invitation. The resource ID is the membership UUID (member.ID), which is what the Cloudflare delete API requires.

func (*InvitationResourceType) Entitlements added in v0.0.13

func (*InvitationResourceType) Grants added in v0.0.13

func (*InvitationResourceType) List added in v0.0.13

func (*InvitationResourceType) ResourceType added in v0.0.13

type Response

type Response struct {
	Errors   []cloudflare.ResponseInfo `json:"errors"`
	Messages []cloudflare.ResponseInfo `json:"messages"`
	Success  bool                      `json:"success"`
	Result   cloudflare.AccountMember  `json:"result"`
}

type UserResourceType

type UserResourceType struct {
	// contains filtered or unexported fields
}

func (*UserResourceType) CreateAccount added in v0.0.12

CreateAccount invites a user to join the Cloudflare account. Cloudflare uses an invitation model — the user receives an email and must accept before gaining access. The profile may include a "roles" field ([]interface{} of role ID strings) to assign initial roles. At least one role ID is required by the Cloudflare API.

func (*UserResourceType) CreateAccountCapabilityDetails added in v0.0.12

func (*UserResourceType) Delete added in v0.0.12

Delete removes a user from the Cloudflare account. The resource ID is the Cloudflare user UUID; the member ID is resolved via API lookup.

func (*UserResourceType) Entitlements

func (*UserResourceType) Grants

func (*UserResourceType) List

func (*UserResourceType) ResourceType

func (o *UserResourceType) ResourceType(_ context.Context) *v2.ResourceType

Jump to

Keyboard shortcuts

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