Documentation
¶
Index ¶
Constants ¶
const (
CredentialListLimit = 100
)
const (
DefaultSchema = "credential"
)
Variables ¶
var Objects string
var Queries string
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct {
CredentialKey
Description string `json:"description,omitempty" help:"Credential description, such as what it's for"`
PV uint64 `json:"pv,omitempty" help:"Passphrase version it's encrypted with" readonly:""`
UpdatedAt time.Time `json:"updated_at" help:"Update timestamp" readonly:""`
}
Credential is the public credential row returned from the database. Secret material and passphrase version are intentionally excluded.
func (Credential) Cell ¶
func (r Credential) Cell(col int) string
func (Credential) Header ¶
func (r Credential) Header() []string
func (*Credential) Scan ¶
func (c *Credential) Scan(row pg.Row) error
Expected column order: key, description, pv, updated_at.
func (Credential) String ¶
func (c Credential) String() string
func (Credential) Width ¶
func (r Credential) Width(col int) int
type CredentialCreate ¶
type CredentialCreate struct {
CredentialKey
Credentials any `json:"credentials" help:"Credential value"`
}
CredentialCreate contains the values required to create a credential row. The returned Credential omits PV and Credentials.
func (CredentialCreate) RedactedString ¶
func (c CredentialCreate) RedactedString() string
func (*CredentialCreate) Scan ¶
func (c *CredentialCreate) Scan(row pg.Row) error
Expected column order: key, credential.
func (CredentialCreate) String ¶
func (c CredentialCreate) String() string
type CredentialDescribe ¶
type CredentialDescribe struct {
Description string
}
CredentialDescribe sets a credential's description, or removes it, when it's empty
type CredentialGet ¶
type CredentialGet struct {
CredentialKey
PV uint64 `json:"pv" help:"Passphrase version"`
Credentials any `json:"credentials" help:"Credential value"`
}
CredentialGet contains the values required to retrieve a credential row. The returned Credential includes PV and Credentials.
type CredentialKey ¶
type CredentialKey struct {
Key string `json:"key" help:"Credential key"`
}
func (CredentialKey) Validate ¶
func (c CredentialKey) Validate() error
Validate returns an error if the key, with surrounding spaces removed, is not an identifier
type CredentialList ¶
type CredentialList struct {
CredentialListRequest
Count uint64 `json:"count,omitempty"`
Body []*Credential `json:"body,omitempty"`
}
func (CredentialList) String ¶
func (c CredentialList) String() string
type CredentialListRequest ¶
type CredentialListRequest struct {
pg.OffsetLimit
Rotate *bool `` /* 167-byte string literal not displayed */
}
func (CredentialListRequest) Query ¶
func (r CredentialListRequest) Query() url.Values
func (CredentialListRequest) String ¶
func (c CredentialListRequest) String() string
type CredentialRotate ¶
type CredentialRotate struct {
CredentialKey
PV uint64
Credentials []byte
OldPV uint64
OldCredentials []byte
}
CredentialRotate replaces the encrypted credentials for a key, but only if they are still the old encrypted credentials, so that credentials changed or deleted in the meantime are not overwritten.