vds

package
v0.0.0-...-b9fdcee Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0, BSD-2-Clause, MIT Imports: 13 Imported by: 0

Documentation

Overview

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Copyright © 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause

Index

Constants

View Source
const (
	PropertyNameDataStore     = "dataStore"
	PropertyNameDataStoreType = "type"
)
View Source
const (
	PoliciesDirname = "policies"
)

Variables

View Source
var DataStoreRegistrar *dataStoreRegistrar = newRegistrar()

singleton registrar for data store types

Functions

func AuthorizationPolicyIdToPath

func AuthorizationPolicyIdToPath(policyId string) string

func AuthorizationPolicyPathToId

func AuthorizationPolicyPathToId(policyPath string) string

func DataStoreEntriesToPaths

func DataStoreEntriesToPaths(dataStoreEntries []*DataStoreEntry) []string

func DataStoreEntryToAuthorizationPolicyEntry

func DataStoreEntryToAuthorizationPolicyEntry(dataStoreEntry *DataStoreEntry) (*model.AuthorizationPolicyEntry, error)

func DataStoreEntryToNamespaceEntry

func DataStoreEntryToNamespaceEntry(dataStoreEntry *DataStoreEntry) (*model.NamespaceEntry, error)

func DataStoreEntryToSecretEntry

func DataStoreEntryToSecretEntry(dataStoreEntry *DataStoreEntry) (*model.SecretEntry, error)

func DataStoreEntryToUserEntry

func DataStoreEntryToUserEntry(dataStoreEntry *DataStoreEntry) (*model.UserEntry, error)

func IsAuthorizationPolicyEntry

func IsAuthorizationPolicyEntry(dsEntry *DataStoreEntry) bool

func IsNamespaceEntry

func IsNamespaceEntry(dsEntry *DataStoreEntry) bool

func IsSecretEntry

func IsSecretEntry(dsEntry *DataStoreEntry) bool

func IsUserEntry

func IsUserEntry(dsEntry *DataStoreEntry) bool

func SecretIdToPath

func SecretIdToPath(secretId string) string

func SecretPathToId

func SecretPathToId(secretPath string) string

func UsernameToPath

func UsernameToPath(username string) string

func UserpathToName

func UserpathToName(userpath string) string

Types

type CassandraDS

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

An implementation of a datastore based on Apache Cassandra.

The Cassandra cluster is expected to have a table (whose name is determined by the constant cassandraVSMTable) under a key space (whose name is determined by the constant cassandraVSMKeySpace) with a schema corresponding to (id: string, parentId: string, data: []byte, metaData: string);

For example:

CREATE KEYSPACE vsm WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};
CREATE TABLE vsm.vsm_entries (id text PRIMARY KEY, parent_id text, data blob, meta_data text);

The field parentId is needed to implement SearchChildEntries as Cassandra does not support regexp queries.

func NewCassandraDS

func NewCassandraDS() *CassandraDS

func (*CassandraDS) CompleteInit

func (ds *CassandraDS) CompleteInit(cfg *config.DataStoreConfig) error

func (*CassandraDS) CreateEntry

func (ds *CassandraDS) CreateEntry(entry *DataStoreEntry) error

func (*CassandraDS) DeleteEntry

func (ds *CassandraDS) DeleteEntry(entryId string) error

func (*CassandraDS) Init

func (ds *CassandraDS) Init(cfg *config.DataStoreConfig) error

func (*CassandraDS) Initialized

func (ds *CassandraDS) Initialized() bool

func (*CassandraDS) Location

func (ds *CassandraDS) Location() string

func (*CassandraDS) ReadEntry

func (ds *CassandraDS) ReadEntry(entryId string) (*DataStoreEntry, error)

func (*CassandraDS) SearchChildEntries

func (ds *CassandraDS) SearchChildEntries(parentEntryId string) ([]*DataStoreEntry, error)

func (*CassandraDS) Type

func (ds *CassandraDS) Type() string

type DataStoreAdapter

type DataStoreAdapter interface {
	Init(*config.DataStoreConfig) error
	CompleteInit(*config.DataStoreConfig) error
	Initialized() bool

	CreateEntry(entry *DataStoreEntry) error
	ReadEntry(entryId string) (*DataStoreEntry, error)
	DeleteEntry(entryId string) error
	SearchChildEntries(parentEntryId string) ([]*DataStoreEntry, error)

	Type() string
	Location() string
}

func GetDataStoreFromConfig

func GetDataStoreFromConfig(configuration *config.Config) (DataStoreAdapter, error)

type DataStoreEntry

type DataStoreEntry struct {
	Id       string
	Data     []byte
	MetaData string
}

func AuthorizationPolicyEntryToDataStoreEntry

func AuthorizationPolicyEntryToDataStoreEntry(policyEntry *model.AuthorizationPolicyEntry) (*DataStoreEntry, error)

func NamespaceEntryToDataStoreEntry

func NamespaceEntryToDataStoreEntry(namespaceEntry *model.NamespaceEntry) (*DataStoreEntry, error)

func SecretEntryToDataStoreEntry

func SecretEntryToDataStoreEntry(secretEntry *model.SecretEntry) (*DataStoreEntry, error)

func UserEntryToDataStoreEntry

func UserEntryToDataStoreEntry(userEntry *model.UserEntry) (*DataStoreEntry, error)

type InMemoryDS

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

An implementation of a datastore in-memory. Useful for testing. Not recommended for production!!

func NewInMemoryDS

func NewInMemoryDS() *InMemoryDS

func (*InMemoryDS) CompleteInit

func (ds *InMemoryDS) CompleteInit(storeConfig *config.DataStoreConfig) error

func (*InMemoryDS) CreateEntry

func (ds *InMemoryDS) CreateEntry(entry *DataStoreEntry) error

func (*InMemoryDS) DeleteEntry

func (ds *InMemoryDS) DeleteEntry(entryId string) error

func (*InMemoryDS) Init

func (ds *InMemoryDS) Init(storeConfig *config.DataStoreConfig) error

func (*InMemoryDS) Initialized

func (ds *InMemoryDS) Initialized() bool

func (*InMemoryDS) Location

func (ds *InMemoryDS) Location() string

func (*InMemoryDS) ReadEntry

func (ds *InMemoryDS) ReadEntry(entryId string) (*DataStoreEntry, error)

func (*InMemoryDS) SearchChildEntries

func (ds *InMemoryDS) SearchChildEntries(parentEntryId string) ([]*DataStoreEntry, error)

func (*InMemoryDS) Type

func (ds *InMemoryDS) Type() string

type MetaData

type MetaData struct {
	EntryType         string
	SecretType        string
	SecretMetaData    string
	Owner             string
	ExpirationTime    time.Time
	Roles             []RoleMetaData
	AllowedOperations []OperationMetaData
}

type MongoDBDS

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

An implementation of a datastore based on MongoDB.

func NewMongoDBDS

func NewMongoDBDS() *MongoDBDS

func (*MongoDBDS) CompleteInit

func (ds *MongoDBDS) CompleteInit(cfg *config.DataStoreConfig) error

func (*MongoDBDS) CreateEntry

func (ds *MongoDBDS) CreateEntry(entry *DataStoreEntry) error

func (*MongoDBDS) DeleteEntry

func (ds *MongoDBDS) DeleteEntry(entryId string) error

func (*MongoDBDS) Init

func (ds *MongoDBDS) Init(cfg *config.DataStoreConfig) error

func (*MongoDBDS) Initialized

func (ds *MongoDBDS) Initialized() bool

func (*MongoDBDS) Location

func (ds *MongoDBDS) Location() string

func (*MongoDBDS) ReadEntry

func (ds *MongoDBDS) ReadEntry(entryId string) (*DataStoreEntry, error)

func (*MongoDBDS) SearchChildEntries

func (ds *MongoDBDS) SearchChildEntries(parentEntryId string) ([]*DataStoreEntry, error)

func (*MongoDBDS) Type

func (ds *MongoDBDS) Type() string

type OperationMetaData

type OperationMetaData struct {
	Label string
}

type RoleMetaData

type RoleMetaData struct {
	Scope string
	Label string
}

Jump to

Keyboard shortcuts

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