admin

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages all admin transactions

func New

func New() *Manager

New creates a new admin manager instance

func (*Manager) GetInternalAccessToken

func (m *Manager) GetInternalAccessToken() (string, error)

GetInternalAccessToken returns the token that can be used internally by Space Cloud

func (*Manager) IsAdminOpAuthorised

func (m *Manager) IsAdminOpAuthorised(token, scope string) (int, error)

IsAdminOpAuthorised checks if the admin operation is authorised. TODO add scope level restrictions as well

func (*Manager) IsTokenValid

func (m *Manager) IsTokenValid(token string) error

IsTokenValid checks if the token is valid

func (*Manager) LoadEnv

func (m *Manager) LoadEnv() bool

LoadEnv gets the env

func (*Manager) Login

func (m *Manager) Login(user, pass string) (int, string, error)

Login handles the admin login operation

func (*Manager) SetConfig

func (m *Manager) SetConfig(admin *config.Admin)

SetConfig sets the admin config

func (*Manager) SetEnv

func (m *Manager) SetEnv(isProd bool)

SetEnv sets the env

func (*Manager) ValidateSyncOperation

func (m *Manager) ValidateSyncOperation(c *config.Config, project *config.Project) bool

ValidateSyncOperation validates if an operation is permitted based on the mode

Jump to

Keyboard shortcuts

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