Documentation
¶
Index ¶
- Constants
- Variables
- func New(ctx context.Context, cc *cfg.Cloudflare, _ *cli.ConnectorOpts) (connectorbuilder.ConnectorBuilderV2, []connectorbuilder.Opt, error)
- func V1GrantID(entitlementID string, userID string) string
- func V1MembershipEntitlementID(resourceID string) string
- func WithAuthorizationBearerHeader(token string) uhttp.RequestOption
- type Cloudflare
- func (c *Cloudflare) Asset(_ context.Context, _ *v2.AssetRef) (string, io.ReadCloser, error)
- func (c *Cloudflare) Metadata(ctx context.Context) (*v2.ConnectorMetadata, error)
- func (c *Cloudflare) ResourceSyncers(_ context.Context) []connectorbuilder.ResourceSyncerV2
- func (c *Cloudflare) Validate(ctx context.Context) (annotations.Annotations, error)
- type CloudflareError
- type InvitationResourceType
- func (o *InvitationResourceType) Delete(ctx context.Context, resourceId *v2.ResourceId, _ *v2.ResourceId) (annotations.Annotations, error)
- func (o *InvitationResourceType) Entitlements(_ context.Context, _ *v2.Resource, _ rs.SyncOpAttrs) ([]*v2.Entitlement, *rs.SyncOpResults, error)
- func (o *InvitationResourceType) Grants(_ context.Context, _ *v2.Resource, _ rs.SyncOpAttrs) ([]*v2.Grant, *rs.SyncOpResults, error)
- func (o *InvitationResourceType) List(ctx context.Context, _ *v2.ResourceId, opts rs.SyncOpAttrs) ([]*v2.Resource, *rs.SyncOpResults, error)
- func (o *InvitationResourceType) ResourceType(_ context.Context) *v2.ResourceType
- type Response
- type UserResourceType
- func (o *UserResourceType) CreateAccount(ctx context.Context, accountInfo *v2.AccountInfo, _ *v2.LocalCredentialOptions) (connectorbuilder.CreateAccountResponse, []*v2.PlaintextData, ...)
- func (o *UserResourceType) CreateAccountCapabilityDetails(_ context.Context) (*v2.CredentialDetailsAccountProvisioning, annotations.Annotations, error)
- func (o *UserResourceType) Delete(ctx context.Context, resourceId *v2.ResourceId, _ *v2.ResourceId) (annotations.Annotations, error)
- func (o *UserResourceType) Entitlements(_ context.Context, _ *v2.Resource, _ rs.SyncOpAttrs) ([]*v2.Entitlement, *rs.SyncOpResults, error)
- func (o *UserResourceType) Grants(_ context.Context, _ *v2.Resource, _ rs.SyncOpAttrs) ([]*v2.Grant, *rs.SyncOpResults, error)
- func (o *UserResourceType) List(ctx context.Context, _ *v2.ResourceId, opts rs.SyncOpAttrs) ([]*v2.Resource, *rs.SyncOpResults, error)
- func (o *UserResourceType) ResourceType(_ context.Context) *v2.ResourceType
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 New ¶
func New(ctx context.Context, cc *cfg.Cloudflare, _ *cli.ConnectorOpts) (connectorbuilder.ConnectorBuilderV2, []connectorbuilder.Opt, error)
func WithAuthorizationBearerHeader ¶
func WithAuthorizationBearerHeader(token string) uhttp.RequestOption
Types ¶
type Cloudflare ¶
type Cloudflare struct {
// contains filtered or unexported fields
}
func (*Cloudflare) Asset ¶
func (c *Cloudflare) Asset(_ context.Context, _ *v2.AssetRef) (string, io.ReadCloser, error)
func (*Cloudflare) Metadata ¶
func (c *Cloudflare) Metadata(ctx context.Context) (*v2.ConnectorMetadata, error)
func (*Cloudflare) ResourceSyncers ¶
func (c *Cloudflare) ResourceSyncers(_ context.Context) []connectorbuilder.ResourceSyncerV2
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
func (o *InvitationResourceType) Delete(ctx context.Context, resourceId *v2.ResourceId, _ *v2.ResourceId) (annotations.Annotations, error)
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 (o *InvitationResourceType) Entitlements(_ context.Context, _ *v2.Resource, _ rs.SyncOpAttrs) ([]*v2.Entitlement, *rs.SyncOpResults, error)
func (*InvitationResourceType) Grants ¶ added in v0.0.13
func (o *InvitationResourceType) Grants(_ context.Context, _ *v2.Resource, _ rs.SyncOpAttrs) ([]*v2.Grant, *rs.SyncOpResults, error)
func (*InvitationResourceType) List ¶ added in v0.0.13
func (o *InvitationResourceType) List(ctx context.Context, _ *v2.ResourceId, opts rs.SyncOpAttrs) ([]*v2.Resource, *rs.SyncOpResults, error)
func (*InvitationResourceType) ResourceType ¶ added in v0.0.13
func (o *InvitationResourceType) ResourceType(_ context.Context) *v2.ResourceType
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
func (o *UserResourceType) CreateAccount( ctx context.Context, accountInfo *v2.AccountInfo, _ *v2.LocalCredentialOptions, ) (connectorbuilder.CreateAccountResponse, []*v2.PlaintextData, annotations.Annotations, error)
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 (o *UserResourceType) CreateAccountCapabilityDetails(_ context.Context) (*v2.CredentialDetailsAccountProvisioning, annotations.Annotations, error)
func (*UserResourceType) Delete ¶ added in v0.0.12
func (o *UserResourceType) Delete(ctx context.Context, resourceId *v2.ResourceId, _ *v2.ResourceId) (annotations.Annotations, error)
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 (o *UserResourceType) Entitlements(_ context.Context, _ *v2.Resource, _ rs.SyncOpAttrs) ([]*v2.Entitlement, *rs.SyncOpResults, error)
func (*UserResourceType) Grants ¶
func (o *UserResourceType) Grants(_ context.Context, _ *v2.Resource, _ rs.SyncOpAttrs) ([]*v2.Grant, *rs.SyncOpResults, error)
func (*UserResourceType) List ¶
func (o *UserResourceType) List(ctx context.Context, _ *v2.ResourceId, opts rs.SyncOpAttrs) ([]*v2.Resource, *rs.SyncOpResults, error)
func (*UserResourceType) ResourceType ¶
func (o *UserResourceType) ResourceType(_ context.Context) *v2.ResourceType
Click to show internal directories.
Click to hide internal directories.