certgen

package
v0.0.0-...-f3b21c9 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSRInfo

type CSRInfo struct {
	Country                string `yaml:"country"`
	State                  string `yaml:"state"`
	Locality               string `yaml:"locality"`
	OrganisationName       string `yaml:"organisationname"`
	OrganisationalUnitName string `yaml:"organisationalunitname"`
}

CSR request details

type CertConfig

type CertConfig struct {
	Name     string                      `yaml:"name"`
	Metadata MetadataInfo                `yaml:"metadata"`
	Spec     map[string]*CertificateInfo `yaml:"spec"`
}

CertConfig cert.yaml file get read into this struct

func GetCertConfig

func GetCertConfig(filename string) (*CertConfig, error)

GetCertConfig reads the cert.yaml and create CertConfig object

func (*CertConfig) GetCertificateObjects

func (c *CertConfig) GetCertificateObjects() []*CertificateObject

GetCertificateObject converts CertConfig to CertificateDetails object

type CertGen

type CertGen struct {
	Namespace string
	// contains filtered or unexported fields
}

CertGen type

func New

func New(namespace string) *CertGen

New creates new CertGen object

func (*CertGen) GenerateCertificate

func (c *CertGen) GenerateCertificate(cs *CertConfig)

GenerateCertificate Generates certificates as per the cert.yaml configuration It performes following steps: 1. Generates local certificate key and CSR 2. Sends CSR to kubernetes certificate services 3. Tries to approve that CSR 4. Once its approved, downloads the certificate 5. Creates the secret in provided namespace

type CertificateInfo

type CertificateInfo struct {
	Name string `yaml:"name"`
	//References     []string `yaml:"references"`
	CSR CSRInfo `yaml:"csr"`
	//AlternameNames []string `yaml:"alternamenames"`
	Hosts []string `yaml:"hosts"`
}

CertificateInfo

type CertificateObject

type CertificateObject struct {
	CertificateInfoObj *CertificateInfo
	CSR                *certificates.CertificateSigningRequest
	CSRSpec            *certificates.CertificateSigningRequestSpec
	CertKey            []byte
	Cert               []byte
}

CertificateObject hosts all the information about specific certificate

func NewCertificateObject

func NewCertificateObject(certInfo *CertificateInfo) *CertificateObject

func (*CertificateObject) CreateCertificate

func (c *CertificateObject) CreateCertificate(name string) *certificates.CertificateSigningRequest

func (*CertificateObject) UpdatedApproval

type Config

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

type MetadataInfo

type MetadataInfo struct {
	Name   string                 `yaml:"name"`
	Lables map[string]interface{} `yaml:"lables"`
}

MetadataInfo

type SecretInfo

type SecretInfo struct {
	Name string
}

SecretInfo

Jump to

Keyboard shortcuts

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