provision

package
v0.0.0-...-21df278 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URLFmt            = "https://%sconsole.linkai.io/"
	ResetURLFmt       = "https://%sconsole.linkai.io/login/#/confirm"
	LogoutURLFmt      = "https://%sconsole.linkai.io/logout"
	LoginURLFmt       = "https://%sconsole.linkai.io/login/"
	WelcomeTitleMsg   = `Welcome to linkai.io's hakken web management system`
	WelcomeSubjectMsg = `` /* 271-byte string literal not displayed */

	VerificationTitleMsg   = `Verification required for linkai.io's hakken web management system`
	VerificationSubjectMsg = `` /* 282-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type OrgDetails

type OrgDetails struct {
	OrgName         string `json:"org_name" validate:"required,gte=3,lte=128"`
	OwnerEmail      string `json:"owner_email" validate:"required,email"`
	FirstName       string `json:"first_name" validate:"required,gte=1,lte=256"`
	LastName        string `json:"last_name" validate:"required,gte=1,lte=256"`
	Phone           string `json:"phone,omitempty" validate:"omitempty,gte=7,lte=256"`
	Country         string `json:"country" validate:"required,gte=2,lte=3"`
	StatePrefecture string `json:"state_prefecture,omitempty" validate:"omitempty,gte=3,lte=256"`
	Street          string `json:"street,omitempty" validate:"omitempty,gte=3,lte=256"`
	Address1        string `json:"address1,omitempty" validate:"omitempty,gte=3,lte=256"`
	Address2        string `json:"address2,omitempty" validate:"omitempty,gte=3,lte=256"`
	City            string `json:"city,omitempty" validate:"omitempty,gte=3,lte=256"`
	PostalCode      string `json:"postal_code,omitempty" validate:"omitempty,gte=3,lte=24"`
	StatusID        int    `json:"status_id" validate:"required,oneof=1 2 3 100 1000"`
	SubscriptionID  int32  `json:"subscription_id" validate:"required,oneof=1 10 100 101 102 1000"`
}

OrgDetails represents the details necessary to provision an organization to be converted to an am.Organization after validation.

func (*OrgDetails) ToOrganization

func (o *OrgDetails) ToOrganization() (*am.Organization, error)

ToOrganization converts the details to an am.Organization if it validates successfully.

type OrgProvision

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

OrgProvision for provisioning support and customer organizations

func NewOrgProvision

func NewOrgProvision(env, region string, userClient am.UserService, orgClient am.OrganizationService) *OrgProvision

NewOrgProvision in the env/region

func (*OrgProvision) Add

func (p *OrgProvision) Add(ctx context.Context, userContext am.UserContext, orgData *am.Organization, roles map[string]string) (string, error)

Add an organization to hakken provided the organization does not already exist.

func (*OrgProvision) AddSupportOrganization

func (p *OrgProvision) AddSupportOrganization(ctx context.Context, userContext am.UserContext, orgData *am.Organization, roles map[string]string, password string) (string, string, error)

AddSupportOrganization to manage the hakken service (provision, troubleshoot etc) TODO: Need to look up support userID by modifying UserService to allow looking up non-same-org users

func (*OrgProvision) Delete

func (p *OrgProvision) Delete(ctx context.Context, orgData *am.Organization) error

Delete the identity pool and user

func (*OrgProvision) DeleteSupportOrganization

func (p *OrgProvision) DeleteSupportOrganization(ctx context.Context, userContext am.UserContext, orgName string) (string, string, error)

DeleteSupportOrganization delete the support org

func (*OrgProvision) List

func (p *OrgProvision) List() (map[string]*am.Organization, error)

List TODO: implement

type OrgProvisioner

type OrgProvisioner interface {
	AddSupportOrganization(ctx context.Context, userContext am.UserContext, orgData *am.Organization, roles map[string]string, password string) (string, string, error)
	Add(ctx context.Context, userContext am.UserContext, orgData *am.Organization, roles map[string]string) (string, error)
	DeleteSupportOrganization(ctx context.Context, userContext am.UserContext, orgName string) (string, string, error)
	Delete(ctx context.Context, orgData *am.Organization) error
}

OrgProvisioner interface for creating all resources necessary to provision an organization

Jump to

Keyboard shortcuts

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