provisioner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamRegion      = "cosi.linode.com/v1/region"
	ParamACL         = "cosi.linode.com/v1/acl"
	ParamCORS        = "cosi.linode.com/v1/cors"
	ParamPermissions = "cosi.linode.com/v1/permissions"
)
View Source
const (
	S3                      = "s3"
	S3Region                = "region"
	S3Endpoint              = "endpoint"
	S3SecretAccessKeyID     = "accessKeyID"
	S3SecretAccessSecretKey = "accessSecretKey"
)
View Source
const (
	KeyBucketID                = "bucket.id"
	KeyBucketLabel             = "bucket.label"
	KeyBucketCluster           = "bucket.cluster"
	KeyBucketCreationTimestamp = "bucket.created_at"
	KeyBucketACL               = "bucket.acl"
	KeyBucketCORS              = "bucket.cors_enabled"
	KeyBucketAccessIDRaw       = "bucket.access.id_raw"
	KeyBucketAccessID          = "bucket.access.id"
	KeyBucketAccessName        = "bucket.access.name"
	KeyBucketAccessAuth        = "bucket.access.auth"
	KeyBucketAccessPermissions = "bucket.access.permissions"
)

Variables

View Source
var (
	ErrNotFound            = linodego.Error{Code: http.StatusNotFound}
	ErrBucketExists        = errors.New("bucket exists with different parameters")
	ErrUnsuportedAuth      = errors.New("unsupported authentication schema")
	ErrMissingRegion       = errors.New("region was not provided")
	ErrUnknownPermsissions = errors.New("unknown permissions")
)

Functions

This section is empty.

Types

type ParamCORSValue

type ParamCORSValue string
const (
	ParamCORSValueEnabled  ParamCORSValue = "enabled"
	ParamCORSValueDisabled ParamCORSValue = "disabled"
)

func (ParamCORSValue) Bool

func (v ParamCORSValue) Bool() bool

func (ParamCORSValue) BoolP

func (v ParamCORSValue) BoolP() *bool

type ParamPermissionsValue

type ParamPermissionsValue string
const (
	ParamPermissionsValueReadOnly  ParamPermissionsValue = "read_only"
	ParamPermissionsValueReadWrite ParamPermissionsValue = "read_write"
)

type Server

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

Server implements cosi.ProvisionerServer interface.

func New

func New(logger *slog.Logger, client linodeclient.Client) (*Server, error)

New returns provisioner.Server with default values.

func (*Server) DriverCreateBucket

DriverCreateBucket call is made to create the bucket in the backend.

NOTE: this call needs to be idempotent.

  1. If a bucket that matches both name and parameters already exists, then OK (success) must be returned.
  2. If a bucket by same name, but different parameters is provided, then the appropriate error code ALREADY_EXISTS must be returned.

func (*Server) DriverDeleteBucket

DriverDeleteBucket call is made to delete the bucket in the backend.

NOTE: this call needs to be idempotent. If the bucket has already been deleted, then no error should be returned.

func (*Server) DriverGrantBucketAccess

DriverGrantBucketAccess call grants access to an account. The account_name in the request shall be used as a unique identifier to create credentials.

NOTE: this call needs to be idempotent. The account_id returned in the response will be used as the unique identifier for deleting this access when calling DriverRevokeBucketAccess. The returned secret does not need to be the same each call to achieve idempotency.

func (*Server) DriverRevokeBucketAccess

DriverRevokeBucketAccess call revokes all access to a particular bucket from a principal.

NOTE: this call needs to be idempotent.

Jump to

Keyboard shortcuts

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