Documentation ¶
Overview ¶
Package objectscale implements custom server handlers for communication with Dell ObjectScale platform.
Index ¶
- Constants
- Variables
- func BuildPrincipalString(namespace, bucketName string) string
- func BuildResourceString(objectScaleID, objectStoreID, bucketName string) string
- func BuildUsername(namespace, bucketName string) string
- func GetBucketName(bucketID string) (string, error)
- type Server
- func (s *Server) DriverCreateBucket(ctx context.Context, req *cosi.DriverCreateBucketRequest) (*cosi.DriverCreateBucketResponse, error)
- func (s *Server) DriverDeleteBucket(ctx context.Context, req *cosi.DriverDeleteBucketRequest) (*cosi.DriverDeleteBucketResponse, error)
- func (s *Server) DriverGrantBucketAccess(ctx context.Context, req *cosi.DriverGrantBucketAccessRequest) (*cosi.DriverGrantBucketAccessResponse, error)
- func (s *Server) DriverRevokeBucketAccess(ctx context.Context, req *cosi.DriverRevokeBucketAccessRequest) (*cosi.DriverRevokeBucketAccessResponse, error)
- func (s *Server) ID() string
Constants ¶
const ( CreateBucketTraceName = "CreateBucketRequest" DeleteBucketTraceName = "DeleteBucketRequest" GrantBucketAccessTraceName = "GrantBucketAccessRequest" RevokeBucketAccessTraceName = "RevokeBucketAccessRequest" )
Variables ¶
var ( ErrEmptyBucketName = errors.New("empty bucket name") ErrFailedToCreateBucket = errors.New("failed to create bucket") )
All errors that can be returned by DriverCreateBucket.
var ( ErrEmptyBucketAccessName = errors.New("empty bucket access name") ErrInvalidAuthenticationType = errors.New("invalid authentication type") ErrUnknownAuthenticationType = errors.New("unknown authentication type") ErrBucketNotFound = errors.New("bucket not found") ErrFailedToCreateUser = errors.New("failed to create user") ErrFailedToDecodePolicy = errors.New("failed to decode bucket policy") ErrFailedToUpdatePolicy = errors.New("failed to update bucket policy") ErrFailedToCreateAccessKey = errors.New("failed to create access key") ErrFailedToGeneratePolicyID = errors.New("failed to generate PolicyID UUID") ErrGeneratedPolicyIDIsEmpty = errors.New("generated PolicyID was empty") ErrAuthenticationTypeNotImplemented = errors.New("authentication type IAM not implemented") )
All errors that can be returned by DriverGrantBucketAccess.
var ( ErrEmptyAccountID = errors.New("empty accountID") ErrExistingPolicyIsEmpty = errors.New("existing policy is empty") ErrFailedToUpdateBucketPolicy = errors.New("failed to update bucket policy") ErrFailedToListAccessKeys = errors.New("failed to list access keys") ErrFailedToDeleteAccessKey = errors.New("failed to delete access key") ErrFailedToDeleteUser = errors.New("failed to delete user") )
All errors that can be returned by DriverRevokeBucketAccess.
var ( WarnBucketNotFound = "Bucket not found." WarnUserNotFound = "User not found." )
All warnings that can be returned by DriverRevokeBucketAccess.
var ( // ErrParameterNotFound is general instance of the model.Error with the CodeParameterNotFound. // It indicates that request parameter cannot be found - e.g. requested bucket does not exist. ErrParameterNotFound = model.Error{Code: model.CodeParameterNotFound} // ErrInternalException is general instance of the model.Error with the CodeInternalException. // It indicates that internal exception occurred, and user should look at ObjectScale logs to find the cause. ErrInternalException = model.Error{Code: model.CodeInternalException} )
var ( // All common errors that can be returned by // DriverCreateBucket, DriverDeleteBucket, DriverGrantBucketAccess, DriverRevokeBucketAccess. ErrInvalidBucketID = errors.New("invalid bucketID") ErrFailedToCheckBucketExists = errors.New("failed to check bucket existence") ErrFailedToMarshalPolicy = errors.New("failed to marshal policy into JSON") ErrFailedToCheckPolicyExists = errors.New("failed to check bucket policy existence") ErrFailedToCheckUserExists = errors.New("failed to check for user existence") // ErrInvalidRequest is an edge case error, which should be returned when incoming request is not of type // DriverCreateBucket, DriverDeleteBucketRequest, DriverGrantBucketAccessRequest or DriverRevokeBucketAccessRequest. ErrInvalidRequest = errors.New("incoming request invalid") )
var ErrFailedToDeleteBucket = errors.New("bucket was not successfully deleted")
All errors that can be returned by DriverDeleteBucket.
Functions ¶
func BuildPrincipalString ¶
BuildPrincipalString constructs policy principal string.
func BuildResourceString ¶
BuildResourceString constructs policy resource string.
func BuildUsername ¶
func GetBucketName ¶
GetBucketName splits BucketID by -, the first element is backendID, the second element is bucketName.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is implementation of driver.Driver interface for ObjectScale platform.
func New ¶
func New(config *config.Objectscale) (*Server, error)
New initializes server based on the config file. TODO: verify if emptiness verification can be moved to a separate function.
func (*Server) DriverCreateBucket ¶
func (s *Server) DriverCreateBucket( ctx context.Context, req *cosi.DriverCreateBucketRequest, ) (*cosi.DriverCreateBucketResponse, error)
DriverCreateBucket creates Bucket on specific Object Storage Platform.
func (*Server) DriverDeleteBucket ¶
func (s *Server) DriverDeleteBucket(ctx context.Context, req *cosi.DriverDeleteBucketRequest, ) (*cosi.DriverDeleteBucketResponse, error)
DriverDeleteBucket deletes Bucket on specific Object Storage Platform.
func (*Server) DriverGrantBucketAccess ¶
func (s *Server) DriverGrantBucketAccess( ctx context.Context, req *cosi.DriverGrantBucketAccessRequest, ) (*cosi.DriverGrantBucketAccessResponse, error)
DriverGrantBucketAccess provides access to Bucket on specific Object Storage Platform.
func (*Server) DriverRevokeBucketAccess ¶
func (s *Server) DriverRevokeBucketAccess(ctx context.Context, req *cosi.DriverRevokeBucketAccessRequest, ) (*cosi.DriverRevokeBucketAccessResponse, error)
DriverRevokeBucketAccess revokes access from Bucket on specific Object Storage Platform.