Documentation ¶
Index ¶
- type IntegrationInterface
- type Manager
- func (m *Manager) CheckIfAdmin(ctx context.Context, token string) error
- func (m *Manager) CheckIfCachingCanBeEnabled(ctx context.Context) error
- func (m *Manager) GenerateToken(ctx context.Context, token string, tokenClaims map[string]interface{}) (string, error)
- func (m *Manager) GetClusterID() string
- func (m *Manager) GetCredentials() map[string]interface{}
- func (m *Manager) GetIntegrationToken(id string) (string, error)
- func (m *Manager) GetInternalAccessToken() (string, error)
- func (m *Manager) GetPermissions(ctx context.Context, params model.RequestParams) (int, interface{}, error)
- func (m *Manager) GetSecret() string
- func (m *Manager) IsDBConfigValid(config config.DatabaseConfigs) error
- func (m *Manager) IsTokenValid(ctx context.Context, token, resource, op string, attr map[string]string) (model.RequestParams, error)
- func (m *Manager) LoadEnv() (bool, string, error)
- func (m *Manager) Login(ctx context.Context, user, pass string) (int, string, error)
- func (m *Manager) RefreshToken(ctx context.Context, token string) (string, error)
- func (m *Manager) SetIntegrationConfig(integrations config.Integrations)
- func (m *Manager) SetIntegrationMan(i IntegrationInterface)
- func (m *Manager) SetServices(eventType string, services model.ScServices)
- func (m *Manager) SetSyncMan(s model.SyncManAdminInterface)
- func (m *Manager) ValidateProjectSyncOperation(c *config.Config, project *config.ProjectConfig) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntegrationInterface ¶
type IntegrationInterface interface { HandleConfigAuth(ctx context.Context, resource, op string, claims map[string]interface{}, attr map[string]string) config.IntegrationAuthResponse InvokeHook(ctx context.Context, params model.RequestParams) config.IntegrationAuthResponse }
IntegrationInterface s used to describe the features of integration manager we need.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages all admin transactions
func (*Manager) CheckIfAdmin ¶
CheckIfAdmin simply checks the token
func (*Manager) CheckIfCachingCanBeEnabled ¶
CheckIfCachingCanBeEnabled checks if the user can configure caching module
func (*Manager) GenerateToken ¶
func (m *Manager) GenerateToken(ctx context.Context, token string, tokenClaims map[string]interface{}) (string, error)
GenerateToken creates a token with the appropriate claims
func (*Manager) GetClusterID ¶
GetClusterID returns the cluster id
func (*Manager) GetCredentials ¶
GetCredentials gets user name & pass
func (*Manager) GetIntegrationToken ¶
GetIntegrationToken returns the admin token required by an intergation
func (*Manager) GetInternalAccessToken ¶
GetInternalAccessToken returns the token that can be used internally by Space Cloud
func (*Manager) GetPermissions ¶
func (m *Manager) GetPermissions(ctx context.Context, params model.RequestParams) (int, interface{}, error)
GetPermissions returns the permissions the user has. The permissions is for the format `projectId:resource`. This only applies to the config level endpoints.
func (*Manager) IsDBConfigValid ¶
func (m *Manager) IsDBConfigValid(config config.DatabaseConfigs) error
IsDBConfigValid checks if the database config is valid
func (*Manager) IsTokenValid ¶
func (m *Manager) IsTokenValid(ctx context.Context, token, resource, op string, attr map[string]string) (model.RequestParams, error)
IsTokenValid checks if the token is valid
func (*Manager) RefreshToken ¶
RefreshToken is used to create a new token based on an existing one
func (*Manager) SetIntegrationConfig ¶
func (m *Manager) SetIntegrationConfig(integrations config.Integrations)
SetIntegrationConfig sets integration config
func (*Manager) SetIntegrationMan ¶
func (m *Manager) SetIntegrationMan(i IntegrationInterface)
SetIntegrationMan sets integration manager
func (*Manager) SetServices ¶
func (m *Manager) SetServices(eventType string, services model.ScServices)
SetServices sets services in admin
func (*Manager) SetSyncMan ¶
func (m *Manager) SetSyncMan(s model.SyncManAdminInterface)
SetSyncMan sets syncman manager
func (*Manager) ValidateProjectSyncOperation ¶
func (m *Manager) ValidateProjectSyncOperation(c *config.Config, project *config.ProjectConfig) bool
ValidateProjectSyncOperation validates if an operation is permitted based on the mode