secrets

package
v0.16.521 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package secrets is the safe: the tokens and keys the person hands to the agents of this machine, kept encrypted on the machine and handed to a command's environment or a short-lived file, never to a conversation. A value comes in only from the person's page (Settings → Safe, or the card an agent's `harnessly secret ask` puts on screen) and goes out only through the CLI routes a command runs with; it is never logged, never in a list, never in an answer of the page's routes. See docs/safe.md for the model and what it does not protect against.

Index

Constants

View Source
const (
	AskWaiting  = "waiting"
	AskReady    = "ready"
	AskDeclined = "declined"
)

How an ask ended, or that it still waits.

View Source
const (
	ReasonRateLimited = "rate-limited"
	ReasonTooMany     = "too-many"
)

Reasons an ask is refused with.

View Source
const (
	CodeWaiting   = "waiting"
	CodeReady     = "ready"
	CodeCancelled = "cancelled"
	CodeExpired   = "expired"
	CodeGone      = "gone"
)

How a code ask stands.

View Source
const (
	ReasonBadCode = "bad-code"
	ReasonNoChat  = "no-chat"
)

ReasonBadCode: the code is not as many digits as asked; ReasonNoChat: a code is asked only from a chat.

View Source
const (
	// DefaultCodeWait and MaxCodeWait: how long an ask waits for the person.
	DefaultCodeWait = 10 * time.Minute
	MaxCodeWait     = 30 * time.Minute

	MinCodeDigits = 4
	MaxCodeDigits = 8
)
View Source
const (
	DefaultFileTTL = 15 * time.Minute
	MaxFileTTL     = 2 * time.Hour
)

DefaultFileTTL is how long a secret's file lives when the command names no time; MaxFileTTL the longest it may.

View Source
const (
	LimitsKey = "harnessly-limits"
	MaxLimits = 16 << 10
)

LimitsKey is the key a secret's limits are kept under at its path, MaxLimits their size.

View Source
const (
	// ReasonDenied: the server refused this machine's login or this path.
	ReasonDenied = "denied"
	// ReasonUnavailable: the server did not answer, or answered that it cannot now.
	ReasonUnavailable = "unavailable"
	// ReasonReadOnly: a reference is read only; it is changed where it lives.
	ReasonReadOnly = "read-only"
)

More reasons, of a safe whose values live on a server.

View Source
const (
	WhereLocal = "local"
	WhereVault = "vault"
)

Where a secret lives, as View.Where says it when the safe has more than one place.

View Source
const (
	ReasonBadName  = "bad-name"
	ReasonEmpty    = "empty"
	ReasonTooLarge = "too-large"
	ReasonNotFound = "not-found"
	ReasonKeyLost  = "key-lost"
	ReasonFailed   = "failed"
)

Reasons a change or a read is refused with; the page and the CLI put them in words.

View Source
const MaxValue = 64 << 10

MaxValue is the largest value the safe keeps (a private key with its chain fits).

View Source
const ReasonIntegration = "integration"

ReasonIntegration refuses a command the credentials of an integration.

View Source
const SysConnections = "sys/connections"

SysConnections is harnessly's record of the person's connections (Settings → Connections) in their shared safe: the list without credentials, so a new machine of the person has them. Like an app's secret it has a slash, so no route that takes a plain name (the page's safe list, `harnessly secret run`) ever sees it.

View Source
const ValueKey = "value"

ValueKey is the key a secret's value is kept under at its path.

Variables

This section is empty.

Functions

func AppName added in v0.16.154

func AppName(app, name string) string

AppName is the name an app's secret has in the safe; "" when the app id or the secret name is not one.

func BrowserValue added in v0.16.154

func BrowserValue(value string, now time.Time) (string, error)

BrowserValue resolves a TOTP URI to its current RFC 6238 code. Other values are unchanged. Errors never include the URI or its key.

func Clean

func Clean(value string) string

Clean is a value as it is kept: a one-line value (a token) without the spaces and line break a paste brings, a several-line one (a private key) as it was typed.

func CleanWhy

func CleanWhy(why string) string

CleanWhy is the agent's reason as one safe line.

func DefaultKeyFile

func DefaultKeyFile(getenv func(string) string, home string) string

DefaultKeyFile is where the key lies when RUNTIME_SECRETS_KEY_FILE names no other file: the user's state folder ($XDG_STATE_HOME/harnessly, else ~/.local/state/harnessly), not the runtime's data folder (which the agents' CLI reads) nor a workspace.

func FileName added in v0.16.154

func FileName(s string) string

FileName is a file name for the value of s (a valid name or reference): the name itself, or for a vault: reference the last segment of its path and its key, "deploy-token" for vault:shared/ci/deploy#token.

func IntegrationCredential

func IntegrationCredential(ref string) bool

IntegrationCredential says whether a name or reference points at an integration's credentials: the runtime uses them itself, behind its own confirmations, and gives their values to no command. A vault: reference counts by the last segment of its path, which is how such a record is reached on a server.

func IntegrationName

func IntegrationName(integration, name string) string

IntegrationName is the name an integration's secret has in the safe; "" when either part is not one.

func IsAppName added in v0.16.154

func IsAppName(name string) bool

IsAppName says whether name is the safe's name of an app's secret.

func IsIntegrationName

func IsIntegrationName(name string) bool

IsIntegrationName says whether name is the safe's name of a built-in integration's secret.

func Mask added in v0.16.154

func Mask(text string, values []string) string

Mask replaces known literal values and common wire encodings in one longest-match pass. A replacement is never matched again, and a short prefix cannot expose a longer value's suffix.

func Origin added in v0.16.154

func Origin(raw string) string

Origin canonicalizes an HTTPS site, or HTTP on an explicitly local development host. Paths, credentials, queries and fragments are rejected rather than silently discarded.

func PromptBlock

func PromptBlock() string

PromptBlock is what every agent of the machine reads in its system prompt about the safe: secrets are asked for and used by name, a value never goes through the conversation.

func ReasonOf

func ReasonOf(err error) string

ReasonOf is the reason of an error of this package; failed for any other error.

func ValidAppName

func ValidAppName(name string) bool

ValidAppName says whether name is a whole, valid app/<id>/<name>: the only name with slashes a shared safe keeps always two parts below app/, so it cannot leave the owner's folder.

func ValidCode

func ValidCode(value string, digits int) bool

ValidCode says whether value is a code of digits digits.

func ValidName

func ValidName(name string) bool

ValidName says whether name may name a secret: letters, digits, '.', '_' and '-', 64 at most, not starting with a sign, so it is safe in a path, a log line and a command line.

func ValidRef added in v0.16.154

func ValidRef(s string) bool

ValidRef says whether s is a secret's name or a reference a command may use.

func ValidSharedName

func ValidSharedName(name string) bool

ValidSharedName is a name a shared safe (the hub's, a server's) keeps: a person's plain name, an app's secret or one of harnessly's own records of the person.

func ValidSysName

func ValidSysName(name string) bool

ValidSysName says whether name is one of harnessly's own records a shared safe keeps.

Types

type AppShared

type AppShared interface {
	ReadApp(full string) (string, error)
	WriteApp(full, value string) error
	DeleteApp(full string) error
}

AppShared is the shared safe an app's secrets are mirrored to, so every machine of the person has them: a VM is only a runner, an app's token put on one is there on the next.

type Ask

type Ask struct {
	Origin  string `json:"origin,omitempty"`
	Project string `json:"project,omitempty"`
	// Grant permits the requested project and site.
	Grant bool `json:"grant,omitempty"`
	// OriginGrant permits only the requested site, without adding project access.
	OriginGrant bool   `json:"originGrant,omitempty"`
	ID          string `json:"id"`
	Name        string `json:"name"`
	// Why is the agent's one line of what it needs the secret for.
	Why string `json:"why"`
	// Conv and Title are the conversation that asked ("" when the asking command ran outside one).
	Conv  string `json:"conv"`
	Title string `json:"title"`
	// Replace: the agent asks for a new value of a secret the safe has (it expired, it was revoked).
	Replace bool  `json:"replace"`
	At      int64 `json:"at"`
}

Ask requests a value or approval to use an existing safe entry.

func (Ask) NeedsGrant added in v0.16.154

func (a Ask) NeedsGrant() bool

NeedsGrant reports whether this card approves access without accepting a value.

type Asks

type Asks struct {
	Now func() time.Time
	// contains filtered or unexported fields
}

Asks are the open asks of this machine: an agent waits on one, the page lists them and settles them.

func NewAsks

func NewAsks() *Asks

NewAsks is the asks with at most 6 a conversation in 10 minutes.

func (*Asks) Decline

func (a *Asks) Decline(id string) bool

Decline settles a waiting ask as declined; false for an id that waits no more.

func (*Asks) Fulfil

func (a *Asks) Fulfil(name string)

Fulfil settles every waiting ask of name as ready: the secret was put.

func (*Asks) Get added in v0.16.154

func (a *Asks) Get(id string) (Ask, bool)

Get returns a still-pending card for a page answer.

func (*Asks) Open

func (a *Asks) Open(name, why, conv, title string, replace bool) (Ask, string, error)

Open is an ask of name: the waiting one of that name when there is one (an agent asking again keeps waiting on it), a declined one of the last two minutes (the person said no), else a new one.

func (*Asks) OpenScoped added in v0.16.154

func (a *Asks) OpenScoped(request Ask) (Ask, string, error)

OpenScoped deduplicates only requests with the same chat, project and requested origin.

func (*Asks) PageOpen

func (a *Asks) PageOpen() bool

PageOpen says whether a page looked at the asks lately (the new interface asks every few seconds while open).

func (*Asks) Pending

func (a *Asks) Pending() []Ask

Pending are the asks waiting for the person, oldest first; the call counts as a page looking.

func (*Asks) Ready added in v0.16.154

func (a *Asks) Ready(id string)

Ready settles only the card that the person answered.

func (*Asks) Wait

func (a *Asks) Wait(ctx context.Context, id string, d time.Duration) string

Wait is how the ask id stands after at most d (or ctx's end): ready, declined, or still waiting.

type CodeAsk

type CodeAsk struct {
	ID     string `json:"id"`
	Why    string `json:"why"`
	Conv   string `json:"conv"`
	Title  string `json:"title"`
	Digits int    `json:"digits"`
	At     int64  `json:"at"`
	Until  int64  `json:"until"`
}

CodeAsk is what the page shows of a code ask: what it is for, how long it waits, never the code.

type Codes

type Codes struct {
	Now func() time.Time
	// contains filtered or unexported fields
}

Codes are the open code asks of this machine.

func NewCodes

func NewCodes() *Codes

NewCodes is the code asks with at most 6 a conversation in 10 minutes.

func (*Codes) Cancel

func (c *Codes) Cancel(id string) bool

Cancel ends the ask id without a code: the person said no, or the command gave up; false for one that waits no more.

func (*Codes) CancelOf

func (c *Codes) CancelOf(id, conv string) bool

CancelOf ends the ask id only for its own chat (the command giving up).

func (*Codes) Open

func (c *Codes) Open(why, conv, title string, digits int, wait time.Duration) (CodeAsk, error)

Open starts an ask of a code of digits digits for the chat conv, waiting at most wait.

func (*Codes) Pending

func (c *Codes) Pending() []CodeAsk

Pending are the asks waiting for the person, oldest first.

func (*Codes) Put

func (c *Codes) Put(id, value string) (bool, error)

Put answers the ask id with the person's code; false for an id that waits no more.

func (*Codes) Wait

func (c *Codes) Wait(ctx context.Context, id, conv string, d time.Duration) (string, string)

Wait is how the ask id of the chat conv stands after at most d: on ready it hands the code over once and forgets it. Another chat's id reads as gone.

type Files

type Files struct {
	Dir string
	// contains filtered or unexported fields
}

Files writes a secret into a file only its owner reads, for a tool that takes a key by path, and removes it when its time is up (or when the runtime starts again: the folder is swept then). The folder is in memory when the machine has /dev/shm, so a value does not reach the disk.

func NewFiles

func NewFiles(base string) *Files

NewFiles is the files in base/harnessly-safe-<uid>, whatever an earlier runtime left there removed.

func (*Files) Close

func (f *Files) Close()

Close removes every file now.

func (*Files) Write

func (f *Files) Write(name, value string, ttl time.Duration) (string, error)

Write puts value into a new file named after the secret and returns its path; it is removed after ttl.

type KV added in v0.16.154

type KV interface {
	Read(ctx context.Context, path string) (map[string]string, error)
	Write(ctx context.Context, path string, data map[string]string) error
	Delete(ctx context.Context, path string) error
	List(ctx context.Context, path string) ([]string, error)
}

KV is the key/value engine of a Vault-compatible server, one mount (internal/secrets/vaultkv).

type Provider added in v0.16.154

type Provider interface {
	List() ([]View, error)
	Has(name string) bool
	Put(name, value string) (View, bool, error)
	Remove(name string) error
	Reveal(names []string, use Use) (map[string]string, error)
	// Lookup, Metadata, Grant, GrantOrigin and PutAsked keep the limits of a secret: the projects whose chats may use
	// it and the sites it may be typed into (access.go). They hold no value.
	Lookup(name, project string) (View, error)
	Metadata(name string, origins, projects []string) (View, error)
	Grant(name, project, origin string) error
	GrantOrigin(name, project, origin string) error
	PutAsked(a Ask, value string) (View, bool, error)
}

Provider is a place the safe keeps secrets in: this machine's sealed file (Store) or a Vault-compatible server (Remote). Every method refuses with a Refusal; none puts a value into an error.

type Ref added in v0.16.154

type Ref struct {
	// Kind is "" for a plain name, WhereLocal or WhereVault.
	Kind string
	Name string
	Path string
	Key  string
}

Ref is a name a command may use besides a plain secret name:

local:<name>          the secret <name> of this machine's file, even when the safe keeps new secrets elsewhere
vault:<path>#<key>    the key <key> at <path> of the server's mount, read only (no #<key>: the key "value")

func ParseRef added in v0.16.154

func ParseRef(s string) (Ref, bool)

ParseRef reads a name or a reference; ok is false for anything else.

type RefReader added in v0.16.154

type RefReader interface {
	ReadRef(path, key string) (string, error)
}

RefReader reads a secret an administrator keeps on the server, by its path and key: a reference.

type Refusal

type Refusal struct {
	Reason string
	Err    error
}

Refusal is an error with its reason.

func (*Refusal) Error

func (r *Refusal) Error() string

func (*Refusal) Unwrap

func (r *Refusal) Unwrap() error

type Remote added in v0.16.154

type Remote struct {
	KV KV
	// Prefix is the folder of the person's secrets in the mount, such as harnessly/users/alice.
	Prefix string
	// RefPrefixes are the folders vault: references may read; "*" any path the login may read; none refuses them.
	RefPrefixes []string
	Now         func() time.Time
	// contains filtered or unexported fields
}

Remote keeps the person's secrets on a Vault-compatible server, one path each under Prefix (<prefix>/<name>, the value under the key "value"). Only the value is there; when it was put and who used it stay on this machine, in a ledger without values (<dir>/remote-ledger.json), as the file safe keeps them.

func NewRemote added in v0.16.154

func NewRemote(kv KV, prefix, dir string) *Remote

NewRemote is a server safe under prefix, its ledger in dir.

func (*Remote) DeleteApp

func (r *Remote) DeleteApp(full string) error

DeleteApp forgets an app's secret on the server.

func (*Remote) Grant added in v0.16.154

func (r *Remote) Grant(name, project, origin string) error

Grant adds a project and a site after a person answered a card.

func (*Remote) GrantOrigin added in v0.16.154

func (r *Remote) GrantOrigin(name, project, origin string) error

GrantOrigin adds only a site; the project must already be allowed.

func (*Remote) Has added in v0.16.154

func (r *Remote) Has(name string) bool

Has says whether the server keeps a secret of that name (by a list at most 10 s old).

func (*Remote) List added in v0.16.154

func (r *Remote) List() ([]View, error)

List is the secrets under Prefix with what the ledger knows of them.

func (*Remote) Lookup added in v0.16.154

func (r *Remote) Lookup(name, project string) (View, error)

Lookup is the public view of a secret for a project's chat; a foreign one looks absent. Its limits lie on the server beside the value (limits.go), their copy in the ledger of this machine.

func (*Remote) Metadata added in v0.16.154

func (r *Remote) Metadata(name string, origins, projects []string) (View, error)

Metadata changes the limits of a secret, never its value.

func (*Remote) Put added in v0.16.154

func (r *Remote) Put(name, value string) (View, bool, error)

Put writes the value to the server.

func (*Remote) PutAsked added in v0.16.154

func (r *Remote) PutAsked(a Ask, value string) (View, bool, error)

PutAsked writes a value a card asked for: a secret of another project is not overwritten, and a new one is limited to the project that asked, as in the file.

func (*Remote) ReadApp

func (r *Remote) ReadApp(full string) (string, error)

ReadApp reads an app's secret (app/<id>/<name>) the server keeps; not-found when it keeps none.

func (*Remote) ReadRef added in v0.16.154

func (r *Remote) ReadRef(path, key string) (string, error)

ReadRef reads key at path, when path lies under one of RefPrefixes.

func (*Remote) ReadSys

func (r *Remote) ReadSys(name string) (string, error)

ReadSys reads one of harnessly's own records of the person (sys/<name>); not-found when the server keeps none.

func (*Remote) Remove added in v0.16.154

func (r *Remote) Remove(name string) error

Remove deletes the secret on the server.

func (*Remote) Reveal added in v0.16.154

func (r *Remote) Reveal(names []string, use Use) (map[string]string, error)

Reveal reads the values from the server and records the use in the ledger. The limits the server keeps decide; for a secret it keeps none of, the ledger's do, and they go to the server then.

func (*Remote) WriteApp

func (r *Remote) WriteApp(full, value string) error

WriteApp keeps an app's secret on the server; the person's list never shows it (it is not a plain name).

func (*Remote) WriteSys

func (r *Remote) WriteSys(name, value string) error

WriteSys keeps one of harnessly's own records of the person on the server.

type Safe added in v0.16.154

type Safe struct {
	Local *Store
	// Primary is where new secrets go; nil keeps everything in Local.
	Primary Provider
	// Refs reads vault: references; nil refuses them.
	Refs RefReader
	// Where names Primary for View.Where (WhereVault).
	Where string
}

Safe is what the routes use: the machine's file, and, when the safe keeps its secrets on a server, that server (Primary) and its references. A plain name is looked up in Primary first, then in the file, so the secrets put before the switch keep working until they are moved. New secrets go to Primary.

func (*Safe) Grant added in v0.16.154

func (s *Safe) Grant(name, project, origin string) error

Grant lets a project (and a site) use a secret, after a person answered its card.

func (*Safe) GrantOrigin added in v0.16.154

func (s *Safe) GrantOrigin(name, project, origin string) error

GrantOrigin lets a secret be typed into one more site.

func (*Safe) Has added in v0.16.154

func (s *Safe) Has(name string) bool

Has says whether a name can be used now; a vault: reference is not looked up (it is read when it is used).

func (*Safe) List added in v0.16.154

func (s *Safe) List() ([]View, error)

List is the secrets of Primary and then those of the file it does not shadow, each with where it lives. With the file alone, the list is the file's, without where.

func (*Safe) Lookup added in v0.16.154

func (s *Safe) Lookup(name, project string) (View, error)

Lookup is what a project's chat may know of a secret: its public view, or not-found for a foreign one.

func (*Safe) Metadata added in v0.16.154

func (s *Safe) Metadata(name string, origins, projects []string) (View, error)

Metadata changes the limits of a secret where it lives.

func (*Safe) Put added in v0.16.154

func (s *Safe) Put(name, value string) (View, bool, error)

Put keeps a value in Primary. Only plain names are put: a reference is changed where it lives. A secret of the file given a new value moves to Primary: its old copy leaves the file, so no stale value stays behind it.

func (*Safe) PutAsked added in v0.16.154

func (s *Safe) PutAsked(a Ask, value string) (View, bool, error)

PutAsked keeps a value a card asked for. With a server, it goes there, as Put; a copy in the file that belongs to another project is not overwritten, and the limits of one this project may use go with its value.

func (*Safe) Remove added in v0.16.154

func (s *Safe) Remove(name string) error

Remove forgets a secret in Primary, or, when Primary has none of that name, in the file (local:<name> says the file outright).

func (*Safe) Reveal added in v0.16.154

func (s *Safe) Reveal(names []string, use Use) (map[string]string, error)

Reveal opens every name for one command: plain names from Primary, then the file; local: from the file; vault: references from the server. Nothing is returned when one of them cannot be opened. The values are keyed by the names as asked.

type Store

type Store struct {
	Now func() time.Time
	// contains filtered or unexported fields
}

Store is the safe's file and its key. The file (<dir>/safe.json) holds only sealed values; the key is a separate file, by default outside the runtime's data folder, which every agent of the machine knows (see DefaultKeyFile).

func Open

func Open(dir, keyFile string) *Store

Open is the safe in dir (created on the first write) with its key in keyFile.

func (*Store) Grant added in v0.16.154

func (s *Store) Grant(name, project, origin string) error

Grant adds a project and requested site after a person approves an access card.

func (*Store) GrantOrigin added in v0.16.154

func (s *Store) GrantOrigin(name, project, origin string) error

GrantOrigin adds only a site and rechecks project access when the card is answered.

func (*Store) Has

func (s *Store) Has(name string) bool

Has says whether a secret of that name is kept.

func (*Store) HasApp added in v0.16.154

func (s *Store) HasApp(app, name string) bool

HasApp says whether an app's secret has a value.

func (*Store) List

func (s *Store) List() ([]View, error)

List is every secret without its value, by name.

func (*Store) Lookup added in v0.16.154

func (s *Store) Lookup(name, project string) (View, error)

Lookup returns only public metadata visible to the project. A foreign entry looks absent.

func (*Store) Metadata added in v0.16.154

func (s *Store) Metadata(name string, origins, projects []string) (View, error)

Metadata changes only public access constraints, never the encrypted value.

func (*Store) Put

func (s *Store) Put(name, value string) (v View, created bool, err error)

Put keeps value under name, a new secret or a new value of one (its uses stay); created says which.

func (*Store) PutApp added in v0.16.154

func (s *Store) PutApp(app, name, value string) error

PutApp keeps the value of an app's secret.

func (*Store) PutAsked added in v0.16.154

func (s *Store) PutAsked(a Ask, value string) (View, bool, error)

PutAsked stores a value from a specific card without overwriting a foreign project entry.

func (*Store) PutIntegration

func (s *Store) PutIntegration(integration, name, value string) error

PutIntegration keeps the value of an integration's secret.

func (*Store) Remove

func (s *Store) Remove(name string) error

Remove forgets a secret.

func (*Store) RemoveApp added in v0.16.154

func (s *Store) RemoveApp(app, name string) error

RemoveApp forgets an app's secret.

func (*Store) RemoveIntegration

func (s *Store) RemoveIntegration(integration, name string) error

RemoveIntegration forgets an integration's secret.

func (*Store) Reveal

func (s *Store) Reveal(names []string, use Use) (map[string]string, error)

Reveal opens the values of names for one command and records the use; nothing is opened when one of them is missing or cannot be read.

func (*Store) RevealApp added in v0.16.154

func (s *Store) RevealApp(app string, names []string) (map[string]string, error)

RevealApp opens the values of an app's secrets for the machine to put into the app's MCP server config. The use is recorded under the app's name; names are the secrets' own names (not the safe's). A missing one is a refusal.

func (*Store) RevealIntegration

func (s *Store) RevealIntegration(integration, name string) (string, error)

RevealIntegration opens the value of an integration's secret; a missing one is a refusal (ReasonNotFound).

func (*Store) SetShared

func (s *Store) SetShared(sh AppShared)

SetShared mirrors the app's secrets of this file to a shared safe; nil keeps them in the file alone.

func (*Store) ShareApps

func (s *Store) ShareApps() int

ShareApps sends up every app's secret this file keeps and has not shared yet: a token put on this machine before the safe was shared reaches the other machines at once, not only on its first use here. One the shared safe already keeps is only marked (its value wins on the next reveal). Errors leave the secret for the next start.

type Use

type Use struct {
	// Project is verified by the caller and is never taken from agent request data.
	Project string `json:"-"`
	Origin  string `json:"origin,omitempty"`
	Conv    string `json:"conv"`
	Title   string `json:"title"`
	At      int64  `json:"at"`
}

Use is one command's use of a secret: the conversation it ran from (its title as it was then), when.

type View

type View struct {
	Origins    []string `json:"origins,omitempty"`
	Projects   []string `json:"projects,omitempty"`
	Name       string   `json:"name"`
	CreatedAt  int64    `json:"createdAt"`
	UpdatedAt  int64    `json:"updatedAt"`
	LastUsedAt int64    `json:"lastUsedAt"`
	UsedBy     []Use    `json:"usedBy"`
	// Where says which store holds it (WhereLocal, WhereVault) when the safe has more than one; empty otherwise.
	Where string `json:"where,omitempty"`
}

View is a secret as anyone may see it: everything but the value.

func (View) Allowed added in v0.16.154

func (v View) Allowed(project string) bool

Allowed reports whether a verified project's chat may use this entry. An empty project never matches a scoped entry; old unscoped entries retain their behavior.

Directories

Path Synopsis
Package execkv keeps the safe in any store a command can reach, without a new build of harnessly: the runtime runs the command once per call, writes one request as JSON to its stdin and reads one answer from its stdout (docs/safe.md, "Any other store").
Package execkv keeps the safe in any store a command can reach, without a new build of harnessly: the runtime runs the command once per call, writes one request as JSON to its stdin and reads one answer from its stdout (docs/safe.md, "Any other store").
Package secretstest has a Vault-compatible store in memory for the tests of the safe's servers.
Package secretstest has a Vault-compatible store in memory for the tests of the safe's servers.
Package vaultkv is a small client of the key/value engine of a Vault-compatible server (OpenBao or HashiCorp Vault): read, write, list and delete one path of a mount, KV version 1 or 2, logged in with a token file, AppRole, Kubernetes or JWT.
Package vaultkv is a small client of the key/value engine of a Vault-compatible server (OpenBao or HashiCorp Vault): read, write, list and delete one path of a mount, KV version 1 or 2, logged in with a token file, AppRole, Kubernetes or JWT.

Jump to

Keyboard shortcuts

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