connector

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound               = errors.New("microsoft-entra-client: 404 not found")
	ErrNoResponse             = errors.New("HTTP request failed to supply a value")
	ErrRequestFailed          = errors.New("HTTP request failed")
	ErrFailedToParseRateLimit = errors.New("failed to parse rate limit")
)

Functions

func BoolValue

func BoolValue(v *bool) bool

BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.

func IsEmpty

func IsEmpty(field string) bool

func StringValue

func StringValue(v *string) string

StringValue returns the value of the string pointer passed in or "" if the pointer is nil.

func WithBearerToken

func WithBearerToken(token string) uhttp.RequestOption

Types

type Connector

type Connector struct {
	MailboxSettings bool
	SkipAdGroups    bool
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, useCliCredentials bool, tenantID, clientID, clientSecret string, mailboxSettings bool, skipAdGroups bool) (*Connector, error)

New returns a new instance of the connector.

func NewConnectorFromToken

func NewConnectorFromToken(ctx context.Context,
	httpClient *http.Client,
	token azcore.TokenCredential,
	mailboxSettings bool,
	skipAdGroups bool,
) (*Connector, error)

func (*Connector) Asset

func (d *Connector) Asset(ctx context.Context, asset *v2.AssetRef) (string, io.ReadCloser, error)

Asset takes an input AssetRef and attempts to fetch it using the connector's authenticated http client It streams a response, always starting with a metadata object, following by chunked payloads for the asset.

func (*Connector) Metadata

func (d *Connector) Metadata(ctx context.Context) (*v2.ConnectorMetadata, error)

Metadata returns metadata about the connector.

func (*Connector) ResourceSyncers

func (d *Connector) ResourceSyncers(ctx context.Context) []connectorbuilder.ResourceSyncer

ResourceSyncers returns a ResourceSyncer for each resource type that should be synced from the upstream service.

func (*Connector) Validate

func (d *Connector) Validate(ctx context.Context) (annotations.Annotations, error)

Validate is called to ensure that the connector is properly configured. It should exercise any API credentials to be sure that they are valid.

type HTTPError

type HTTPError struct {
	StatusCode  int
	RawResponse string
	RetryAfter  int
	RateLimited bool
	Err         error
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type Organization

type Organization struct {
	ID string `json:"id"`
}

type Organizations

type Organizations struct {
	Value []*Organization `json:"value"`
}

Jump to

Keyboard shortcuts

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