This PR contains the following updates:
| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [go.yaml.in/yaml/v3](https://github.com/yaml/go-yaml) | `v3.0.6` → `v4.0.0` |  |  |
---
### Release Notes
<details>
<summary>yaml/go-yaml (go.yaml.in/yaml/v3)</summary>
### [`v4.0.0`](https://github.com/yaml/go-yaml/releases/tag/v4.0.0): go-yaml v4.0.0
[Compare Source](https://github.com/yaml/go-yaml/compare/v3.0.6...v4.0.0)
### go-yaml v4.0.0
go-yaml v4.0.0 is the first stable release of the v4 series, maintained by the
YAML organization.
It adds configurable loading and dumping, public plugin interfaces, structured
errors, and a CLI for inspecting YAML processing.
The classic APIs remain supported, so applications can adopt v4 incrementally.
#### Getting started
Install the release:
```bash
go get go.yaml.in/yaml/v4@v4.0.0
```
Use this import path in your Go code:
```go
import "go.yaml.in/yaml/v4"
```
For an existing v3 application, start by updating imports, reviewing custom
unmarshalers, and running your tests.
You can continue using `Unmarshal`, `Marshal`, `NewDecoder`, and `NewEncoder`.
The v2 and v3 APIs remain frozen, with security fixes only; new features and
routine bug fixes are developed in v4.
#### Why add Load and Dump?
Applications need different YAML policies: strict configuration validation,
particular output layouts, or custom anchor handling.
The new `Load` and `Dump` functions and streaming `Loader` and `Dumper` accept
functional options and plugins for those choices.
They use YAML's load/dump terminology and are recommended for new code.
The classic entry points keep compatibility settings rather than changing
formatting and error presentation for every existing caller.
Moving to the new API is an explicit choice to use v4 defaults, with presets
available when you want older settings.
Classic APIs remain supported.
For example, load a configuration with strict field checking, then choose its
output indentation:
```go
package main
import (
"fmt"
"log"
"go.yaml.in/yaml/v4"
)
func main() {
var config struct {
Name string `yaml:"name"`
Port int `yaml:"port"`
}
input := []byte("name: api\nport: 8080\n")
if err := yaml.Load(input, &config, yaml.WithKnownFields()); err != nil {
log.Fatal(err)
}
output, err := yaml.Dump(config, yaml.WithIndent(4))
if err != nil {
log.Fatal(err)
}
fmt.Print(string(output))
}
```
Unknown struct fields are ignored by default; `WithKnownFields()` opts into
rejecting them.
Duplicate mapping keys are rejected by default.
Options apply in order, so later options override earlier settings.
#### Defaults and compatibility
| Setting | Classic Marshal / Unmarshal | Load / Dump defaults |
| ---------------------- | --------------------------- | -------------------------------- |
| Output indentation | 4 spaces | 2 spaces |
| Sequence indentation | Non-compact | Compact |
| Quote preference | Legacy mixed quoting | Single quotes where possible |
| Preferred output width | Unlimited for Marshal | 80 characters |
| Error presentation | v3 style | v4 style with stage and position |
Quoting still depends on scalar content and styles, and line width is a
preference rather than a guaranteed maximum.
`NewDecoder` uses v3 error formatting; `NewEncoder` retains v3 output settings
with v4 error formatting.
Choose `WithV3Defaults()` to select compatibility defaults through the new API.
When replacing `Marshal`, also disable wrapping to match its line-width setting:
```go
output, err := yaml.Dump(config,
yaml.WithV3Defaults(),
yaml.WithLineWidth(-1),
)
```
Presets select defaults; they do not reverse every v4 bug fix or reproduce every
legacy code path.
For example, package-level `Load` requires exactly one document, whereas
`Unmarshal` retains legacy handling of empty input and trailing content.
`WithSingleDocument()` deliberately skips validation of later documents.
Use `WithAllDocuments()` to load or dump slices as document streams, or use a
streaming loader or dumper to process documents individually.
#### Options, plugins, and nodes
Options control indentation, sequence layout, quoting, document markers,
Unicode escaping, field validation, and more.
`OptsYAML` accepts YAML configuration for supported settings, which can also be
shared with the CLI.
The public plugin APIs cover six areas:
- **Loader-Limits:** configure depth and alias expansion checks.
- **Merge-Key:** control merge directives and mapping conflicts, or replace the
merge algorithm.
- **Alias-Data:** supply external anchors, retain anchors across documents, use
dotted paths, or reject alias references.
- **Error-format:** select error presentation or implement a custom formatter.
- **YAML-parser:** select an alternative parser implementation.
- **Tab-indent:** opt into tab-aware input and output indentation.
The core module provides implementations for these APIs.
Additional parsers live in separate modules, keeping their dependencies optional.
Existing depth and alias protections remain enabled by default.
`yaml.Node` gives access to tags, styles, comments, anchors, and source positions.
`Node.Load` and `Node.Dump` accept options for node conversion.
Pass construction options explicitly inside custom unmarshaler hooks;
`Node.Load` starts with fresh defaults independently of its calling loader.
Stream nodes can expose encoding and YAML directives.
Node output retains supported styles and comments without promising identical
source formatting.
#### Migration details to check
`NewLoader` and `NewDumper` return errors; check them before using the stream.
Check dumper `Dump` and `Close` errors as well.
Custom `UnmarshalYAML(*yaml.Node) error` hooks must use the v4 node type.
Recognized v3 node hooks produce a migration error rather than silently losing
custom behavior.
The legacy `UnmarshalYAML(func(any) error) error` callback remains supported.
Conversion failures return structured `*yaml.LoadErrors` values.
Use `errors.As` to inspect structured errors or match legacy `*yaml.TypeError`
values, rather than relying on a direct type assertion or fixed message text.
Review the [migration guide](https://github.com/yaml/go-yaml/blob/v4.0.0/docs/v3-to-v4-migration.md)
for the complete compatibility guidance.
#### Inspect YAML with the CLI
Install the CLI from this release:
```bash
go install go.yaml.in/yaml/v4/cmd/go-yaml@v4.0.0
```
Convert to JSON, inspect nodes, or examine scanner and parser output:
```bash
go-yaml -J config.yaml
go-yaml -N config.yaml
go-yaml -T config.yaml
go-yaml -E config.yaml
```
The CLI also supports reusable options files and pipelines between intermediate
stages, making small bug reports easier to reproduce.
Runtime plugin selection chooses implementations already linked into the binary.
#### Further reading and thanks
See the [options guide](https://github.com/yaml/go-yaml/blob/v4.0.0/docs/options.md),
[plugin guide](https://github.com/yaml/go-yaml/blob/v4.0.0/docs/plugin.md),
[CLI guide](https://github.com/yaml/go-yaml/blob/v4.0.0/cmd/go-yaml/README.md),
and [API reference](https://pkg.go.dev/go.yaml.in/yaml/v4@v4.0.0).
Please report problems with minimal input, a reproducer, and your Go version in
[the issue tracker](https://github.com/yaml/go-yaml/issues).
Release-candidate users should update to v4.0.0 and rerun their tests, as some APIs
changed during prerelease development.
Thanks to everyone who tested, reported problems, and contributed to this release.
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- "before 6am on monday"
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNTQuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE1NC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Reviewed-on: #100
Co-authored-by: Renovate Bot <renovate-bot@noreply.git.kebcloud.no>
Renovate's dependency updates for a vulnerability (`[security]` in the title) now get a Security section in the changelog and release notes, so a release with only a security fix has notes and isn't refused by `release.sh`.
The next release regenerates CHANGELOG.md, so the earlier security updates (#42, #46, #47, #48, #94) show up under their releases there too.
Reviewed-on: #97
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
- In nvim, lazysecrets asks lazysecrets.nvim whether its window is
shown: a hidden one is brought back for a link, unless nvim is busy
(typing, a command, a picker, mid-operator), when the link opens
elsewhere. Without an answer (an older plugin), nothing changes.
- The Azure group is named for its account, Azure · alice, also with
a single account; its ID, and so stars and cache, stay as they were.
Needs keb/lazysecrets.nvim#6 for the reveal; without it, links behave as before.
Reviewed-on: #95
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
- Text inputs come from newTextInput; the link and folder prompts share one width.
- One starred-first sort for sources, vaults and secrets; accountOf where the account was cut from the label by hand.
- One helper each for the reveal and clipboard countdowns' tick and seconds, the "Open with" choices, the vaults-loaded count, and Go to's and the panes' tabs.
- The details pane builds its label prefix, indent, note and source once; list rows mark matches with MarkMatches.
- The release page opens through openPage, so it now says it opened, as other pages do.
- The cache's account filter is built once per load or save, not per key.
Reviewed-on: #77
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
- ObjectType.Collection names a type's segment in Key Vault URLs and links (secrets, keys, certificates), instead of four copies in ref, azure and fake.
- Azure lists through one pager helper instead of eight hand-written page loops; Value is VersionedValue without the version, rather than the two calling each other.
- Databricks' Key Vault fallback check lives in fallbackVault.
- The repo provider reads .lazysecrets.yaml in one place, builds plain and sops objects in one loop, and parses a file's sops metadata from the bytes Objects already read.
Reviewed-on: #75
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
- main: the subcommand is a name rather than nil-or-empty argument slices; the cache file and start directory are worked out once; config values with a default go through one valueOr helper.
- The link handler's --config argument comes from one configArgs helper.
- lazysecrets update parses its flags like the other subcommands, so -check and --check=true work too, and tells a development build by its dev version.
- Instance reach is named (unreachable, switchable, inView), tmux client activity is compared as a number, and the best client loop starts from the first.
- update: serverTimeout (it bounds the checksums request too), and parentheses in the platform check.
Reviewed-on: #73
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
No behaviour change.
- Deleted, unused or one-line wrappers: panes.RuneIndexes, Detail.Refresh (SetDescribed does it), SecretValue.Len, Query.Empty, Clipboard.Native, config.Load, get's value, Model.done, providerOf (cachefile.ProviderOf), contextWithTimeout, searchCoverage, startCrawl, showKeybindings, the expiry aliases and daysLeft.
- cmp.Or instead of the two cmpOr copies; slices.Sorted(maps.Keys(…)), maps.Copy, wg.Go, utf8.RuneCountInString and new(true) instead of loops and helpers that do the same.
- A container's pane title is set once, not twice; a redundant length check in share links and a no-op assignment in linkhandler.Launch are gone.
- Tests call ansi.Strip and lastLines directly; gofmt -s on links.go.
Reviewed-on: #76
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
- Comments that only restate a name (sgr, fg, mdLink, the repo provider's starred and current-repo notes) are gone.
- Stale ones match the code again: the repo package covers plain env files too, Launch runs argv, closeVersions no longer claims to move the cursor, and Check's fallback says why rather than naming a state no release had.
- The doc for versionString was attached to pseudo; the backtick in SourcesView's doc was a string-concatenation leftover; openFailed's doc was garbled.
- recentReleases sits next to latest, its user.
- .gitignore drops the Go template's boilerplate and patterns for files this project doesn't make.
Reviewed-on: #72
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
Fixes:
- A newer release shows in the status pane (`↑ v0.2.0`), not the footer.
- The account in `lazysecrets list` is plain `Azure` with one az account; `Azure:<user>/<tenant>` only with several.
- Sharing lists subscription, workspace and scope links, and opening takes Azure portal links.
- `--timeout` and `--clipboard-clear` are documented, next to their config keys.
- `--kind`'s description reads, and says `vault` covers scopes and repo files.
- `lazysecrets -h` lists `list`'s `--stars`, `--notes`, `--recent` and `--expiry`.
- README typos; "Supported platforms" is "Sources".
Trimmed:
- An option is documented on its topic's page; config.md's example keeps the general ones and links the rest.
- The fzf picker lives in docs/integration.md; the README keeps a link and the screenshot.
- The clipboard clear, reveal timeout, per-account stars, Azure's "no extra requests" and `open --action` are each said once.
- The status pane's contents are a list; build sizes and PR-title spellings are gone from development.md.
Reviewed-on: #74
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
The link handler's window starts with an app's minimal environment, and only PATH, the config locations and XDG_CONFIG_HOME/XDG_STATE_HOME were carried into it. With XDG_CACHE_HOME or XDG_RUNTIME_DIR set, lazysecrets opened from a link used another cache file and didn't see running instances' sockets; on Linux, without XDG_DATA_HOME it looked for its desktop entry in the wrong place. `handler install` now records those three too: run it again to pick them up.
Reviewed-on: #71
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
`lazysecrets list` prints every source, vault and secret lazysecrets can find, one per line, for fzf, editor pickers and scripts: what Go to searches, without the TUI. What's cached prints at once; what's missing or older than `--max-age` loads in the background and streams in. It stops when the reader goes (a pick in fzf), saving what it loaded.
- Text: kind, mark (✗/⚠, ★, ◷ and the provider icon), name, status (why it couldn't be read, or expired / expires in 12d), note, account and link, tab-separated; kind first and account and link last, so new fields go between. Coloured from the theme; `--color never`, `--icons=false`, `--stars=false`, `--recent`, `--notes=false`, `--expiry=false`.
- `--format json`: an object per line, with starred, recent, lastUsed and uses, expires, enabled, note, reference and url too.
- `--kind` lists only some kinds, and doesn't load lists only other kinds need; `--cached` loads nothing.
- `lazysecrets open --action go|copy|show` skips the "what to do" menu and ends in the list, like Go to; `open` and `get` take `--account`, the account list printed, rather than asking which.
- The cache file moved to `internal/cachefile`: saves merge with the file under a lock, so list and the TUI don't undo each other.
- `ui.recentIcon` marks items used lately with ◷ in the TUI's lists too; Recent now means the last 90 days.
- --demo has stars, notes, recent use, and expired, expiring and disabled secrets.
- docs/integration.md documents get, list and an fzf picker; docs/links.md is docs/sharing.md.
Reviewed-on: #70
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
A long value in the details pane (a ref, a note, a vault's detail, an error) was coloured, then wrapped: the colour's reset only came on the last line, and each line is drawn on its own, so the lines after the first lost the colour. Each wrapped line now starts with the styles still on at the end of the one before.
Reviewed-on: #69
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
Go now stamps local builds with a module pseudo-version (v0.1.3-0.20261014174204-1c31a75d0507+dirty), so the version showed that instead of dev-<commit> as the docs say. The update check also took it for a pre-release of 0.1.3, a version that doesn't exist, rather than a development build. A pseudo-version is now dev-<its commit>, -dirty with uncommitted changes; real versions are unchanged.
Reviewed-on: #68
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
fzf's become hands lazysecrets its /dev/tty still non-blocking. Go can't poll /dev/tty on macOS, so it reads it directly, and the TUI's first read failed with "resource temporarily unavailable" (EAGAIN). lazysecrets now makes a terminal on stdin blocking before the TUI starts (Unix; nothing on Windows).
Reviewed-on: #67
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
Changes that would break configs or links once people use lazysecrets, made while nobody does yet.
- **Repo key names**: a dot or bracket inside a key is escaped (`app\.name`), so links to it resolve to that key and not to `app` → `name`. Dotenv files are flat, so their names stay as they are.
- **Config**: `updates.updateSources` is now `updates.sources`. A negative provider timeout, or `--timeout` of 0 or less, is an error instead of making every request fail.
- **Keybindings**: `lists.share` is now `lists.copyLink`, `lists.search` is `lists.goTo` and `lists.enter` is `lists.open`, matching what they do.
- **Version skew**, e.g. a lazysecrets.nvim theme file made for a newer lazysecrets:
- an unknown theme role is skipped with a warning instead of stopping startup;
- a state file from a newer version is read but not saved to, with a warning;
- a link with an unknown provider suggests `lazysecrets update`.
Reviewed-on: #66
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
SECURITY.md asks for vulnerabilities to be reported privately, through GitHub's private vulnerability reporting or by email to karl-einarb@outlook.com.
docs/development.md: the "Pull requests" heading is now "How changes land". The section covers squash merges, PR titles and branch protection, not how to send one.
Reviewed-on: #65
Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>