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
- Variables
- func AuthorizationPolicyIdToPath(policyId string) string
- func AuthorizationPolicyPathToId(policyPath string) string
- func DataStoreEntriesToPaths(dataStoreEntries []*DataStoreEntry) []string
- func DataStoreEntryToAuthorizationPolicyEntry(dataStoreEntry *DataStoreEntry) (*model.AuthorizationPolicyEntry, error)
- func DataStoreEntryToNamespaceEntry(dataStoreEntry *DataStoreEntry) (*model.NamespaceEntry, error)
- func DataStoreEntryToSecretEntry(dataStoreEntry *DataStoreEntry) (*model.SecretEntry, error)
- func DataStoreEntryToUserEntry(dataStoreEntry *DataStoreEntry) (*model.UserEntry, error)
- func IsAuthorizationPolicyEntry(dsEntry *DataStoreEntry) bool
- func IsNamespaceEntry(dsEntry *DataStoreEntry) bool
- func IsSecretEntry(dsEntry *DataStoreEntry) bool
- func IsUserEntry(dsEntry *DataStoreEntry) bool
- func SecretIdToPath(secretId string) string
- func SecretPathToId(secretPath string) string
- func UsernameToPath(username string) string
- func UserpathToName(userpath string) string
- type CassandraDS
- func (ds *CassandraDS) CompleteInit(cfg *config.DataStoreConfig) error
- func (ds *CassandraDS) CreateEntry(entry *DataStoreEntry) error
- func (ds *CassandraDS) DeleteEntry(entryId string) error
- func (ds *CassandraDS) Init(cfg *config.DataStoreConfig) error
- func (ds *CassandraDS) Initialized() bool
- func (ds *CassandraDS) Location() string
- func (ds *CassandraDS) ReadEntry(entryId string) (*DataStoreEntry, error)
- func (ds *CassandraDS) SearchChildEntries(parentEntryId string) ([]*DataStoreEntry, error)
- func (ds *CassandraDS) Type() string
- type DataStoreAdapter
- type DataStoreEntry
- func AuthorizationPolicyEntryToDataStoreEntry(policyEntry *model.AuthorizationPolicyEntry) (*DataStoreEntry, error)
- func NamespaceEntryToDataStoreEntry(namespaceEntry *model.NamespaceEntry) (*DataStoreEntry, error)
- func SecretEntryToDataStoreEntry(secretEntry *model.SecretEntry) (*DataStoreEntry, error)
- func UserEntryToDataStoreEntry(userEntry *model.UserEntry) (*DataStoreEntry, error)
- type InMemoryDS
- func (ds *InMemoryDS) CompleteInit(storeConfig *config.DataStoreConfig) error
- func (ds *InMemoryDS) CreateEntry(entry *DataStoreEntry) error
- func (ds *InMemoryDS) DeleteEntry(entryId string) error
- func (ds *InMemoryDS) Init(storeConfig *config.DataStoreConfig) error
- func (ds *InMemoryDS) Initialized() bool
- func (ds *InMemoryDS) Location() string
- func (ds *InMemoryDS) ReadEntry(entryId string) (*DataStoreEntry, error)
- func (ds *InMemoryDS) SearchChildEntries(parentEntryId string) ([]*DataStoreEntry, error)
- func (ds *InMemoryDS) Type() string
- type MetaData
- type MongoDBDS
- func (ds *MongoDBDS) CompleteInit(cfg *config.DataStoreConfig) error
- func (ds *MongoDBDS) CreateEntry(entry *DataStoreEntry) error
- func (ds *MongoDBDS) DeleteEntry(entryId string) error
- func (ds *MongoDBDS) Init(cfg *config.DataStoreConfig) error
- func (ds *MongoDBDS) Initialized() bool
- func (ds *MongoDBDS) Location() string
- func (ds *MongoDBDS) ReadEntry(entryId string) (*DataStoreEntry, error)
- func (ds *MongoDBDS) SearchChildEntries(parentEntryId string) ([]*DataStoreEntry, error)
- func (ds *MongoDBDS) Type() string
- type OperationMetaData
- type RoleMetaData
Constants ¶
const ( PropertyNameDataStore = "dataStore" PropertyNameDataStoreType = "type" )
const (
PoliciesDirname = "policies"
)
Variables ¶
var DataStoreRegistrar *dataStoreRegistrar = newRegistrar()
singleton registrar for data store types
Functions ¶
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 SecretPathToId ¶
func UsernameToPath ¶
func UserpathToName ¶
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 ¶
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 (*MongoDBDS) Initialized ¶
func (*MongoDBDS) ReadEntry ¶
func (ds *MongoDBDS) ReadEntry(entryId string) (*DataStoreEntry, error)
func (*MongoDBDS) SearchChildEntries ¶
func (ds *MongoDBDS) SearchChildEntries(parentEntryId string) ([]*DataStoreEntry, error)
type OperationMetaData ¶
type OperationMetaData struct {
Label string
}