Documentation ¶
Index ¶
- func CreateCertificate(org string, keyPath string, certPath string) error
- type AuthenticationCredential
- type AuthenticationManager
- func (a *AuthenticationManager) Authenticate(authId string, appSecret string) (bool, string, error)
- func (a *AuthenticationManager) CreateCredential(key string, id string, ver string) error
- func (a *AuthenticationManager) GetCredentialPath(key string) string
- func (a *AuthenticationManager) RemoveAll() error
- func (a *AuthenticationManager) RemoveCredential(key string) error
- func (a AuthenticationManager) String() string
- type FSSAuthenticate
- type NodeConfigCommand
- type NodeUnconfigCommand
- type ResourceManager
- func (r *ResourceManager) Configured() bool
- func (r *ResourceManager) NodeConfigUpdate(org string, pattern string, id string, token string)
- func (r *ResourceManager) RemovePersistencePath()
- func (r ResourceManager) StartFileSyncService(am *AuthenticationManager) error
- func (r ResourceManager) StopFileSyncService()
- func (r ResourceManager) String() string
- type ResourceWorker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthenticationCredential ¶
type AuthenticationCredential struct { Id string `json:"id"` Token string `json:"token"` Version string `json:"version"` }
func GenerateNewCredential ¶
func GenerateNewCredential(id string, version string) (*AuthenticationCredential, error)
When generating an authetication token, we can use the agreement id generation algorithm because it generates uniquely long strings which are sufficient to use as authentication tokens.
type AuthenticationManager ¶
type AuthenticationManager struct {
AuthPath string
}
func NewAuthenticationManager ¶
func NewAuthenticationManager(authPath string) *AuthenticationManager
func (*AuthenticationManager) Authenticate ¶
Verify that the input credentials are in the auth manager.
func (*AuthenticationManager) CreateCredential ¶
func (a *AuthenticationManager) CreateCredential(key string, id string, ver string) error
Create a new container authentication credential and write it into the Agent's host file system. The credential file live in a directory named by the key input parameter.
func (*AuthenticationManager) GetCredentialPath ¶
func (a *AuthenticationManager) GetCredentialPath(key string) string
func (*AuthenticationManager) RemoveAll ¶
func (a *AuthenticationManager) RemoveAll() error
Remove all container authentication credentials from the Agent's host file system.
func (*AuthenticationManager) RemoveCredential ¶
func (a *AuthenticationManager) RemoveCredential(key string) error
Remove a container authentication credential from the Agent's host file system.
func (AuthenticationManager) String ¶
func (a AuthenticationManager) String() string
type FSSAuthenticate ¶
type FSSAuthenticate struct { AuthMgr *AuthenticationManager // contains filtered or unexported fields }
FSSAuthenticate is the plugin for authenticating FSS (ESS) API calls from a service to anax. It implements the security.Authentication interface. It is also called by the embedded ESS to provide credentials for the node to access the CSS (over the internal SPI).
func (*FSSAuthenticate) Authenticate ¶
FSSAuthenticate authenticates a particular appKey/appSecret pair and indicates whether it is an edge service or not. Also returned is the user's org and identitity. An edge service's identity is <service-org>/<service-name>.
Returns authentication result code, the user's org and id.
func (*FSSAuthenticate) KeyandSecretForURL ¶
func (auth *FSSAuthenticate) KeyandSecretForURL(url string) (string, string)
KeyandSecretForURL returns an app key and an app secret pair to be used by the ESS when communicating with the specified URL. For ESS to CSS SPI communication, the node id and token is used.
func (*FSSAuthenticate) Start ¶
func (auth *FSSAuthenticate) Start()
Start initializes the HorizonAuthenticate plugin.
type NodeConfigCommand ¶
type NodeConfigCommand struct {
// contains filtered or unexported fields
}
This worker command is used to tell the worker than the node is configured and it can init itself.
func NewNodeConfigCommand ¶
func NewNodeConfigCommand(msg *events.EdgeRegisteredExchangeMessage) *NodeConfigCommand
func (NodeConfigCommand) ShortString ¶
func (n NodeConfigCommand) ShortString() string
func (NodeConfigCommand) String ¶
func (n NodeConfigCommand) String() string
type NodeUnconfigCommand ¶
type NodeUnconfigCommand struct {
// contains filtered or unexported fields
}
This worker command is used to tell the worker than the node is done shutting down and so it can terminate itself.
func NewNodeUnconfigCommand ¶
func NewNodeUnconfigCommand(msg *events.NodeShutdownCompleteMessage) *NodeUnconfigCommand
func (NodeUnconfigCommand) ShortString ¶
func (n NodeUnconfigCommand) ShortString() string
func (NodeUnconfigCommand) String ¶
func (n NodeUnconfigCommand) String() string
type ResourceManager ¶
type ResourceManager struct {
// contains filtered or unexported fields
}
func NewResourceManager ¶
func NewResourceManager(cfg *config.HorizonConfig, org string, pattern string, id string, token string) *ResourceManager
func (*ResourceManager) Configured ¶
func (r *ResourceManager) Configured() bool
func (*ResourceManager) NodeConfigUpdate ¶
func (r *ResourceManager) NodeConfigUpdate(org string, pattern string, id string, token string)
func (*ResourceManager) RemovePersistencePath ¶
func (r *ResourceManager) RemovePersistencePath()
Remove any remaining FSS objects from the Agent's host file system.
func (ResourceManager) StartFileSyncService ¶
func (r ResourceManager) StartFileSyncService(am *AuthenticationManager) error
func (ResourceManager) StopFileSyncService ¶
func (r ResourceManager) StopFileSyncService()
func (ResourceManager) String ¶
func (r ResourceManager) String() string
type ResourceWorker ¶
type ResourceWorker struct { worker.BaseWorker // embedded field // contains filtered or unexported fields }
func NewResourceWorker ¶
func NewResourceWorker(name string, config *config.HorizonConfig, db *bolt.DB, am *AuthenticationManager) *ResourceWorker
func (*ResourceWorker) CommandHandler ¶
func (w *ResourceWorker) CommandHandler(command worker.Command) bool
Handle commands that are placed on the command queue.
func (*ResourceWorker) Initialize ¶
func (w *ResourceWorker) Initialize() bool
func (*ResourceWorker) Messages ¶
func (w *ResourceWorker) Messages() chan events.Message
func (*ResourceWorker) NewEvent ¶
func (w *ResourceWorker) NewEvent(incoming events.Message)
Handle events that are propogated to this worker from the internal event bus.
func (*ResourceWorker) NoWorkHandler ¶
func (w *ResourceWorker) NoWorkHandler()
This function gets called when the worker framework has found nothing to do for the "no work interval" that was set when the worker was started.