messaging

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package messaging contains common constants and utilities functions used when setting up Secure MessageBus. A common bootstrap handler can not be here due to the fact that it would pull in dependency on go-mod-messaging which is dependent on ZMQ. This causes all services that use go-mod-boostrap to them have a dependency on ZMQ which breaks the security bootstrapping.

Index

Constants

View Source
const (
	AuthModeKey   = "authmode"
	SecretNameKey = "secretname"

	AuthModeNone             = "none"
	AuthModeUsernamePassword = "usernamepassword"
	AuthModeCert             = "clientcert"
	AuthModeCA               = "cacert"

	SecretUsernameKey = "username"
	SecretPasswordKey = "password"
	SecretClientKey   = "clientkey"
	SecretClientCert  = AuthModeCert
	SecretCACert      = AuthModeCA

	OptionsUsernameKey     = "Username"
	OptionsPasswordKey     = "Password"
	OptionsCertPEMBlockKey = "CertPEMBlock"
	OptionsKeyPEMBlockKey  = "KeyPEMBlock"
	OptionsCaPEMBlockKey   = "CaPEMBlock"
)

Variables

This section is empty.

Functions

func SetOptionsAuthData

func SetOptionsAuthData(messageBusInfo *config.MessageBusInfo, lc logger.LoggingClient, dic *di.Container) error

func ValidateSecretData

func ValidateSecretData(authMode string, secretName string, secretData *SecretData) error

Types

type SecretData

type SecretData struct {
	Username     string
	Password     string
	KeyPemBlock  []byte
	CertPemBlock []byte
	CaPemBlock   []byte
}

func GetSecretData

func GetSecretData(authMode string, secretName string, provider SecretDataProvider) (*SecretData, error)

type SecretDataProvider

type SecretDataProvider interface {
	// GetSecret retrieves secrets from the service's SecretStore at the specified path.
	GetSecret(path string, keys ...string) (map[string]string, error)
}

Jump to

Keyboard shortcuts

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