orchestrator

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadHandlers

func LoadHandlers(database *sql.DB, store hawk.CredentialStore, hostPort string, providers map[string]Provider) (func(router *mux.Router), *workflowsupport.WorkScheduler)

Types

type Action

type Action struct {
	ActionUri string `json:"action_uri" validate:"required"`
}

type Application

type Application struct {
	ID            string `json:"id"`
	IntegrationId string `json:"integration_id"`
	ObjectId      string `json:"object_id"`
	Name          string `json:"name"`
	Description   string `json:"description"`
	ProviderName  string `json:"provider_name"`
	Service       string `json:"service"`
}

type ApplicationInfo

type ApplicationInfo struct {
	ObjectID    string `validate:"required"`
	Name        string
	Description string
	Service     string
}

type ApplicationRecord

type ApplicationRecord struct {
	ID            string
	IntegrationId string
	ObjectId      string
	Name          string
	Description   string
	Service       string
}

type Applications

type Applications struct {
	Applications []Application `json:"applications"`
}

type ApplicationsDataGateway

type ApplicationsDataGateway struct {
	DB *sql.DB
}

func (ApplicationsDataGateway) CreateIfAbsent

func (gateway ApplicationsDataGateway) CreateIfAbsent(integrationId string, objectId string, name string, description string, service string) (string, error)

func (ApplicationsDataGateway) DeleteById

func (gateway ApplicationsDataGateway) DeleteById(id string) error

func (ApplicationsDataGateway) Find

func (gateway ApplicationsDataGateway) Find() ([]ApplicationRecord, error)

func (ApplicationsDataGateway) FindById

func (gateway ApplicationsDataGateway) FindById(id string) (*ApplicationRecord, error)

func (ApplicationsDataGateway) FindByIntegrationId

func (gateway ApplicationsDataGateway) FindByIntegrationId(integrationId string) (*ApplicationRecord, error)

func (ApplicationsDataGateway) FindByObjectId

func (gateway ApplicationsDataGateway) FindByObjectId(objectId string) (*ApplicationRecord, error)

type ApplicationsHandler

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

func (ApplicationsHandler) GetPolicies

func (handler ApplicationsHandler) GetPolicies(w http.ResponseWriter, r *http.Request)

func (ApplicationsHandler) List

func (handler ApplicationsHandler) List(w http.ResponseWriter, _ *http.Request)

func (ApplicationsHandler) SetPolicies

func (handler ApplicationsHandler) SetPolicies(w http.ResponseWriter, r *http.Request)

func (ApplicationsHandler) Show

func (handler ApplicationsHandler) Show(w http.ResponseWriter, r *http.Request)

type ApplicationsService

type ApplicationsService struct {
	ApplicationsGateway ApplicationsDataGateway
	IntegrationsGateway IntegrationsDataGateway
	Providers           map[string]Provider
}

func (ApplicationsService) Apply

func (service ApplicationsService) Apply(jsonRequest Orchestration) error

func (ApplicationsService) GatherRecords

func (service ApplicationsService) GatherRecords(identifier string) (ApplicationInfo, IntegrationInfo, Provider, error)

func (ApplicationsService) RetainAction

func (service ApplicationsService) RetainAction(fromPolicies, toPolicies []policysupport.PolicyInfo) ([]policysupport.PolicyInfo, error)

func (ApplicationsService) RetainResource

func (service ApplicationsService) RetainResource(fromPolicies, toPolicies []policysupport.PolicyInfo) ([]policysupport.PolicyInfo, error)

type DiscoveryWorkFinder

type DiscoveryWorkFinder struct {
	Results chan bool
	Gateway IntegrationsDataGateway
}

func NewDiscoveryWorkFinder

func NewDiscoveryWorkFinder(gateway IntegrationsDataGateway) DiscoveryWorkFinder

func (*DiscoveryWorkFinder) FindRequested

func (finder *DiscoveryWorkFinder) FindRequested() []interface{}

func (*DiscoveryWorkFinder) MarkCompleted

func (finder *DiscoveryWorkFinder) MarkCompleted()

func (*DiscoveryWorkFinder) MarkErroneous

func (finder *DiscoveryWorkFinder) MarkErroneous()

func (*DiscoveryWorkFinder) Stop

func (finder *DiscoveryWorkFinder) Stop()

type DiscoveryWorker

type DiscoveryWorker struct {
	Providers map[string]Provider
	Gateway   ApplicationsDataGateway
}

func (*DiscoveryWorker) Run

func (n *DiscoveryWorker) Run(work interface{}) error

type Integration

type Integration struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Provider string `json:"provider"`
	Key      []byte `json:"key"`
}

type IntegrationInfo

type IntegrationInfo struct {
	Name string
	Key  []byte
}

type IntegrationRecord

type IntegrationRecord struct {
	ID       string
	Name     string
	Provider string
	Key      []byte
}

type Integrations

type Integrations struct {
	Integrations []Integration `json:"integrations"`
}

type IntegrationsDataGateway

type IntegrationsDataGateway struct {
	DB *sql.DB
}

func (IntegrationsDataGateway) Create

func (gateway IntegrationsDataGateway) Create(name string, provider string, key []byte) (string, error)

func (IntegrationsDataGateway) Delete

func (gateway IntegrationsDataGateway) Delete(id string) error

func (IntegrationsDataGateway) Find

func (gateway IntegrationsDataGateway) Find() ([]IntegrationRecord, error)

func (IntegrationsDataGateway) FindById

func (gateway IntegrationsDataGateway) FindById(id string) (IntegrationRecord, error)

type IntegrationsHandler

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

func (IntegrationsHandler) Create

func (handler IntegrationsHandler) Create(w http.ResponseWriter, r *http.Request)

func (IntegrationsHandler) Delete

func (handler IntegrationsHandler) Delete(w http.ResponseWriter, r *http.Request)

func (IntegrationsHandler) List

func (handler IntegrationsHandler) List(w http.ResponseWriter, _ *http.Request)

func (IntegrationsHandler) RunWorker

func (handler IntegrationsHandler) RunWorker()

type Meta

type Meta struct {
	Version string `json:"version" validate:"required"`
}

type Object

type Object struct {
	ResourceID string `json:"resource_id" validate:"required"`
}

type Orchestration

type Orchestration struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type OrchestrationHandler

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

func (OrchestrationHandler) Update

func (o OrchestrationHandler) Update(writer http.ResponseWriter, request *http.Request)

type Policies

type Policies struct {
	Policies []Policy `json:"policies"`
}

type Policy

type Policy struct {
	Meta    Meta     `json:"meta" validate:"required"`
	Actions []Action `json:"actions" validate:"required"`
	Subject Subject  `json:"subject" validate:"required"`
	Object  Object   `json:"object" validate:"required"`
}

type Provider

type Provider interface {
	Name() string
	DiscoverApplications(IntegrationInfo) ([]ApplicationInfo, error)
	GetPolicyInfo(IntegrationInfo, ApplicationInfo) ([]policysupport.PolicyInfo, error)
	SetPolicyInfo(IntegrationInfo, ApplicationInfo, []policysupport.PolicyInfo) (status int, foundErr error)
}

type Subject

type Subject struct {
	Members []string `json:"members" validate:"required"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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