Documentation
¶
Index ¶
- Constants
- type CertificateParams
- type CertificateRecord
- type CertificateRequest
- func (r *CertificateRequest) CredentialName() string
- func (r *CertificateRequest) CredentialType() string
- func (r *CertificateRequest) Generate(secretStore secret.Store) (CredentialRecordInterface, error)
- func (r *CertificateRequest) GenerateIntermediateCertificate(rootCaCert *x509.Certificate, rootCaKey *rsa.PrivateKey) (CredentialRecordInterface, error)
- func (r *CertificateRequest) GenerateRegularCertificate(rootCaCert *x509.Certificate, rootCaKey *rsa.PrivateKey) (CredentialRecordInterface, error)
- func (r *CertificateRequest) GenerateRootCertificate() (CredentialRecordInterface, error)
- func (r CertificateRequest) IsIntermediateCaRequest() bool
- func (r CertificateRequest) IsRegularCertificateRequest() bool
- func (r CertificateRequest) IsRootCaRequest() bool
- func (r *CertificateRequest) Validate() bool
- type CertificateResponse
- type CredentialGenerationRequest
- type CredentialRecordInterface
- type CredentialResponse
- type CredentialSetRequest
- type GenericCredentialGenerationRequest
- type GenericCredentialSetRequest
- type PasswordParams
- type PasswordRecord
- type PasswordRequest
- type PasswordResponse
- type RsaKeypairRecord
- type RsaKeypairRequest
- type RsaKeypairResponse
- type SshKeypairRecord
- type SshKeypairRequest
- type SshKeypairResponse
Constants ¶
View Source
const CertificateDefaultCountry = "USA"
View Source
const CertificateDefaultOrg = "bosh vault"
View Source
const CertificateDefaultRsaKeyBits = 2048
View Source
const CertificateDefaultTtl = 365
View Source
const CertificateType = "certificate"
View Source
const NoOverwriteMode = "no-overwrite"
View Source
const PasswordDefaultLength = 30
View Source
const PasswordType = "password"
View Source
const RsaKeySizeBits = 2048
View Source
const RsaKeypairType = "rsa"
View Source
const SshKeypairType = "ssh"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificateParams ¶
type CertificateParams struct { CommonName string `json:"common_name"` IsCa bool `json:"is_ca,omitempty"` Ca string `json:"ca,omitempty"` AlternativeNames []string `json:"alternative_names,omitempty"` ExtendedKeyUsage []string `json:"extended_key_usage,omitempty"` Organization string `json:"organization"` OrganizationalUnit string `json:"organizational_unit"` Locality string `json:"locality"` State string `json:"state"` Country string `json:"country"` KeyUsage []string `json:"key_usage"` KeyLength int `json:"key_length"` Duration int `json:"duration"` SelfSign bool `json:"self_sign"` }
type CertificateRecord ¶
type CertificateRecord struct { Certificate string `json:"certificate"` Ca string `json:"ca"` PrivateKey string `json:"private_key"` }
func (CertificateRecord) Store ¶
func (record CertificateRecord) Store(secretStore secret.Store, name string) (CredentialResponse, error)
type CertificateRequest ¶
type CertificateRequest struct { Name string `json:"name"` Type string `json:"type"` Parameters CertificateParams `json:"parameters"` }
func (*CertificateRequest) CredentialName ¶
func (r *CertificateRequest) CredentialName() string
func (*CertificateRequest) CredentialType ¶
func (r *CertificateRequest) CredentialType() string
func (*CertificateRequest) Generate ¶
func (r *CertificateRequest) Generate(secretStore secret.Store) (CredentialRecordInterface, error)
func (*CertificateRequest) GenerateIntermediateCertificate ¶
func (r *CertificateRequest) GenerateIntermediateCertificate(rootCaCert *x509.Certificate, rootCaKey *rsa.PrivateKey) (CredentialRecordInterface, error)
func (*CertificateRequest) GenerateRegularCertificate ¶
func (r *CertificateRequest) GenerateRegularCertificate(rootCaCert *x509.Certificate, rootCaKey *rsa.PrivateKey) (CredentialRecordInterface, error)
func (*CertificateRequest) GenerateRootCertificate ¶
func (r *CertificateRequest) GenerateRootCertificate() (CredentialRecordInterface, error)
func (CertificateRequest) IsIntermediateCaRequest ¶
func (r CertificateRequest) IsIntermediateCaRequest() bool
func (CertificateRequest) IsRegularCertificateRequest ¶
func (r CertificateRequest) IsRegularCertificateRequest() bool
func (CertificateRequest) IsRootCaRequest ¶
func (r CertificateRequest) IsRootCaRequest() bool
func (*CertificateRequest) Validate ¶
func (r *CertificateRequest) Validate() bool
type CertificateResponse ¶
type CertificateResponse struct { Name string `json:"name"` Id string `json:"id"` Value CertificateRecord `json:"value"` }
type CredentialGenerationRequest ¶
type CredentialGenerationRequest interface { Generate(secretStore secret.Store) (CredentialRecordInterface, error) Validate() bool CredentialType() string CredentialName() string }
func ParseCredentialGenerationRequest ¶
func ParseCredentialGenerationRequest(requestBody []byte) (req CredentialGenerationRequest, noOverwrite bool, err error)
type CredentialRecordInterface ¶
type CredentialRecordInterface interface {
Store(secretStore secret.Store, name string) (CredentialResponse, error)
}
type CredentialResponse ¶
type CredentialResponse interface{}
type CredentialSetRequest ¶
type CredentialSetRequest struct { Name string Type string Record CredentialRecordInterface }
func ParseCredentialSetRequest ¶
func ParseCredentialSetRequest(requestBody []byte) (CredentialSetRequest, error)
type GenericCredentialGenerationRequest ¶
type GenericCredentialGenerationRequest struct { Name string `json:"name"` Type string `json:"type"` Parameters json.RawMessage `json:"parameters,omitempty"` Mode string `json:"mode"` }
@see: https://golang.org/pkg/encoding/json/#RawMessage Keeping generic parameters as RawMessages allows us to delay unmarhsaling the largest part of this struct until we've determined what type of credential we're dealing with. This allows us to efficiently determine credential type without needing to use expensive reflection operations.
type GenericCredentialSetRequest ¶
type GenericCredentialSetRequest struct { Name string `json:"name"` Type string `json:"type"` Value json.RawMessage `json:"value,omitempty"` }
type PasswordParams ¶
type PasswordRecord ¶
type PasswordRecord string
func (PasswordRecord) Store ¶
func (record PasswordRecord) Store(secretStore secret.Store, name string) (CredentialResponse, error)
type PasswordRequest ¶
type PasswordRequest struct { Name string `json:"name"` Type string `json:"type"` Parameters PasswordParams `json:"parameters"` }
func (*PasswordRequest) CredentialName ¶
func (r *PasswordRequest) CredentialName() string
func (*PasswordRequest) CredentialType ¶
func (r *PasswordRequest) CredentialType() string
func (*PasswordRequest) Generate ¶
func (r *PasswordRequest) Generate(secretStore secret.Store) (CredentialRecordInterface, error)
func (*PasswordRequest) Validate ¶
func (r *PasswordRequest) Validate() bool
type PasswordResponse ¶
type RsaKeypairRecord ¶
type RsaKeypairRecord struct { PublicKey string `json:"public_key"` PrivateKey string `json:"private_key"` }
func (RsaKeypairRecord) Store ¶
func (record RsaKeypairRecord) Store(secretStore secret.Store, name string) (CredentialResponse, error)
type RsaKeypairRequest ¶
func (*RsaKeypairRequest) CredentialName ¶
func (r *RsaKeypairRequest) CredentialName() string
func (*RsaKeypairRequest) CredentialType ¶
func (r *RsaKeypairRequest) CredentialType() string
func (*RsaKeypairRequest) Generate ¶
func (r *RsaKeypairRequest) Generate(secretStore secret.Store) (CredentialRecordInterface, error)
func (*RsaKeypairRequest) Validate ¶
func (r *RsaKeypairRequest) Validate() bool
type RsaKeypairResponse ¶
type RsaKeypairResponse struct { Name string `json:"name"` Id string `json:"id"` Value RsaKeypairRecord `json:"value"` }
type SshKeypairRecord ¶
type SshKeypairRecord struct { PublicKey string `json:"public_key"` PrivateKey string `json:"private_key"` PublicKeyFingerprint string `json:"public_key_fingerprint"` }
func (SshKeypairRecord) Store ¶
func (record SshKeypairRecord) Store(secretStore secret.Store, name string) (CredentialResponse, error)
type SshKeypairRequest ¶
func (*SshKeypairRequest) CredentialName ¶
func (r *SshKeypairRequest) CredentialName() string
func (*SshKeypairRequest) CredentialType ¶
func (r *SshKeypairRequest) CredentialType() string
func (*SshKeypairRequest) Generate ¶
func (r *SshKeypairRequest) Generate(secretStore secret.Store) (CredentialRecordInterface, error)
func (*SshKeypairRequest) Validate ¶
func (r *SshKeypairRequest) Validate() bool
type SshKeypairResponse ¶
type SshKeypairResponse struct { Name string `json:"name"` Id string `json:"id"` Value SshKeypairRecord `json:"value"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.