vault

package
v0.0.0-...-a61cce2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Invalid = iota
	Outdated
	Valid
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateLifecycle

type CertificateLifecycle interface {
	RenewableSecret
	SecretLifecycle
}

PKI certificate lifecycle interface

type CredentialLifecycle

type CredentialLifecycle interface {
	ExtendableSecret
	RenewableSecret
	SecretLifecycle
}

Most credential lifecycle interface

type ExtendableSecret

type ExtendableSecret interface {
	Extend(path string)

	// this is unit function for measuring when to extend
	// checking whether secret is need to be extended or not
	// the logic mostly 2/3 total time
	IsOutdated(path string) bool
}

ExtendableSecret : Interface behavior for vault extendable lease secrets (not every secret resource in vault does support lease extension).

type LeaseMetadata

type LeaseMetadata struct {
	Id              string        `json:"id"`
	IssueTime       time.Time     `json:"issue_time"`
	ExpireTime      time.Time     `json:"expire_time"`
	LastRenewalTime time.Time     `json:"last_renewal_time,omitempty"`
	Renewable       bool          `json:"renewable"`
	Ttl             time.Duration `json:"ttl"`
}

Note: format time from vault

2017-04-30T10:18:11.228946471-04:00

type RenewableSecret

type RenewableSecret interface {
	Renew(path string)

	// this is unit function for measuring when to renew
	IsValid(path string) bool
}

Interface behavior for vault renewable secret

type SecretLifecycle

type SecretLifecycle interface {
	SecretTrait

	//
	// This combine whether secret are still valid/invalid or outdated
	//
	// see ExtendableSecret#IsOutdated and RenewableSecret#IsValid
	//
	Status(path string) Status

	//
	// this sums up and hide the underlying logic of SecretLifecycle implementation.
	// since the underlying implementation might not support ExtendableSecret.
	//
	Refresh(path string)
}

type SecretTrait

type SecretTrait interface {
	// this function make sure whether the current path
	// are being supported in this lifecycle or not
	IsDynamic(string) bool

	// lookup method to fetch secret
	// it resolves around :
	// - local cache first
	// - remote
	Lookup(path string) (*v.Secret, error)
}

type Status

type Status int

this enum represents whether current secret need to be renewed or extended

Invalid ~ renew Outdated ~ extend

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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