config

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExampleAWSInstance = Config{
	ProviderName:          "aws",
	DisableSecretCreation: false,
	ProviderConfig: struct {
		AWSConfig *ops.ProviderAWS `yaml:"aws,omitempty"`
		GCPConfig *ops.ProviderGCP `yaml:"gcp,omitempty"`
	}{AWSConfig: &ops.ProviderAWS{
		SigningCA:        "<your ACM PCA CA ARN>",
		TemplateARN:      "arn:aws:acm-pca:::template/SubordinateCACertificate_PathLen0/V1",
		SigningAlgorithm: "SHA256WITHRSA",
	}},
	CertParameters: defaultCertParams,
}
View Source
var ExampleGCPInstance = Config{
	ProviderName:          "gcp",
	DisableSecretCreation: false,
	ProviderConfig: struct {
		AWSConfig *ops.ProviderAWS `yaml:"aws,omitempty"`
		GCPConfig *ops.ProviderGCP `yaml:"gcp,omitempty"`
	}{GCPConfig: &ops.ProviderGCP{
		CASCAName:        "projects/{project-id}/locations/{location}/certificateAuthorities/{YourCA}",
		MaxIssuerPathLen: 0,
	}},
	CertParameters: defaultCertParams,
}

Functions

This section is empty.

Types

type Config

type Config struct {
	// ProviderName is the name of the provider to be used.
	ProviderName          string `yaml:"providerName"`
	DisableSecretCreation bool   `yaml:"disableSecretCreation"`
	// ProviderConfig encapsulates all the configuration
	// needed to connect to the Provider.
	ProviderConfig struct {
		// AWSConfig contains all the AWS related configuration
		AWSConfig *ops.ProviderAWS `yaml:"aws,omitempty"`
		GCPConfig *ops.ProviderGCP `yaml:"gcp,omitempty"`
	} `yaml:"providerConfig"`

	// CertParameters contains all the Certificate related information.
	CertParameters models.IssueCAOptions `yaml:"certificateParameters,omitempty"`
}

Config represent a structure used to accept request for `getmesh` from a config file. Sample Config for AWS: providerName: "aws" disableSecretCreation: "true" providerConfig:

aws:
  creds: "creds"
  rootCAArn: "ROOT_CA_ARN"
  region: "us-west-2"
  templateArn: "TEMPLATE_ARN"

certificateParameters:

secretOptions:
  istioCANamespace: "istio-system"
  secretFilePath: "/tmp/getmesh/secret.yaml"
caOptions:
  validityDays: 3650
  keyLength: 2048
  certSigningRequestParams:
    subject:
      commonname: "Istio CA"
      country:
        - "US"
      locality:
        - "Sunnyvale"
      organization:
        - "Istio"

func NewConfig

func NewConfig(path string) (*Config, error)

NewConfig returns new parsed config from the absolute path provided.

func (*Config) SetDefaultValues

func (c *Config) SetDefaultValues()

SetDefaultValues sets the defaults in config struct as follows: certificateParameters:

secretOptions:
  istioCANamespace: "istio-system"
caOptions:
  validityDays: 3650
  keyLength: 2048
    subject:
      commonname: "Istio CA"
      country:
        - "US"
      locality:
        - "Sunnyvale"
      organization:
        - "Istio"

func (*Config) ToYaml

func (c *Config) ToYaml() (string, error)

func (*Config) ValidationsForConfig

func (c *Config) ValidationsForConfig() error

ValidationsForConfig validates the config before proceeding.

Jump to

Keyboard shortcuts

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