fileprovider

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTokenConfig

func LoadTokenConfig(fileOpener fileioperformer.FileIoPerformer, path string, tokenConf *TokenConfFile) error

func Main

func Main(ctx context.Context, cancel context.CancelFunc, _ *mux.Router, _ chan<- bool)

Types

type Bootstrap

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

func NewBootstrap

func NewBootstrap() *Bootstrap

func (*Bootstrap) BootstrapHandler

func (b *Bootstrap) BootstrapHandler(_ context.Context, _ *sync.WaitGroup, _ startup.Timer, dic *di.Container) bool

BootstrapHandler fulfills the BootstrapHandler contract and performs initialization needed by the data service.

func (*Bootstrap) ExitCode

func (b *Bootstrap) ExitCode() int

ExitCode returns desired exit code of program

type FilePermissions

type FilePermissions struct {
	Uid       *int    `json:"uid,omitempty"`
	Gid       *int    `json:"gid,omitempty"`
	ModeOctal *string `json:"mode_octal,omitempty"`
}

type ServiceKey

type ServiceKey struct {
	UseDefaults           bool                   `json:"edgex_use_defaults"`
	CustomPolicy          map[string]interface{} `json:"custom_policy"` // JSON serialization of HCL
	CustomTokenParameters map[string]interface{} `json:"custom_token_parameters"`
	FilePermissions       *FilePermissions       `json:"file_permissions,omitempty"`
}

type TokenConfFile

type TokenConfFile map[string]ServiceKey

func GetTokenConfigFromEnv

func GetTokenConfigFromEnv() (TokenConfFile, error)

GetTokenConfigFromEnv function gets a list of token service keys from environment variable and populates the default configuration with default token parameters and policies the function returns a TokenConfFile map instance and error if any if the environment variable is not present or the value of that is empty then it will return empty map if the value for the list is not well-formed, not comma-separated then it will return an error

type TokenFileProviderInfo

type TokenFileProviderInfo struct {
	// Path to Vault authorization token to be used by the service
	PrivilegedTokenPath string
	// Configuration file used to control token creation
	ConfigFile string
	// Base directory for token file output
	OutputDir string
	// File name for token file
	OutputFilename string
}

type TokenProvider

type TokenProvider interface {
	// Set configuration
	SetConfiguration(secretConfig secretstoreclient.SecretServiceInfo, tokenConfig config.TokenFileProviderInfo)
	// Generate tokens
	Run() error
}

TokenProvider is the interface that the main program expects for implemeneting token generation

func NewTokenProvider

NewTokenProvider creates a new TokenProvider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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