controller

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, param Param) (Controller, Param, error)

Types

type Config

type Config struct {
	LogLevel              string `yaml:"log_level"`
	SecretID              string `yaml:"secret_id"`
	SecretVersionID       string `yaml:"secret_version_id"`
	AWSAccountID          string `yaml:"-"`
	Region                string
	Message               string
	MessageForSystemUser  string `yaml:"message_for_system_user"`
	Slack                 SlackConfig
	InitialPasswordLength int    `yaml:"initial_password_length"`
	WhenLoginProfileExist string `yaml:"when_login_profile_exist"`
	DynamoDBTableName     string `yaml:"dynamodb_table_name"`
	DynamoDBTTL           int    `yaml:"dynamodb_ttl"`
}

type Controller

type Controller struct {
	Stdin                        io.Reader
	Stdout                       io.Writer
	Stderr                       io.Writer
	Config                       Config
	SlackBot                     *slack.Client
	MessageTemplate              *template.Template
	MessageTemplateForSystemUser *template.Template
}

func (*Controller) CompileTemplate

func (ctrl *Controller) CompileTemplate(text string) (*template.Template, error)

func (*Controller) Run

func (ctrl *Controller) Run(ctx context.Context, param Param) error

type IAM added in v0.1.1

type IAM interface {
	UpdateLoginProfileWithContext(ctx aws.Context, input *iam.UpdateLoginProfileInput, opts ...request.Option) (*iam.UpdateLoginProfileOutput, error)
}

type Param

type Param struct {
	ConfigFilePath        string
	LogLevel              string
	SlackBotAccessToken   string
	MessageTemplateString string
	InitalPasswordLength  int
	// user filter
	// user mapping
	// notifier (slack, SES, etc)
	// integration (datadog, sentry, etc)
	DryRun   bool
	UserName string
}

type Secret

type Secret struct {
	SlackBotToken string `json:"slack_bot_token"`
}

type SlackConfig

type SlackConfig struct {
	ChannelIDForSystemUser string `yaml:"channel_id_for_system_user"`
}

Jump to

Keyboard shortcuts

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