repository: unexport SearchKey

This commit is contained in:
Michael Eischer
2026-06-13 19:49:03 +02:00
parent 79e92b3bc6
commit 1acc19dac5
3 changed files with 9 additions and 5 deletions
+6 -2
View File
@@ -65,9 +65,11 @@ func testRunKeyAddNewKeyUserHost(t testing.TB, gopts global.Options) {
_ = withTermStatus(t, gopts, func(ctx context.Context, gopts global.Options) error {
repo, err := global.OpenRepository(ctx, gopts, progress.NewNoopPrinter())
rtest.OK(t, err)
key, err := repository.SearchKey(ctx, repo, testKeyNewPassword, 2, "")
err = repo.SearchKey(ctx, testKeyNewPassword, 2, "")
rtest.OK(t, err)
key, err := repository.LoadKey(ctx, repo, repo.KeyID())
rtest.OK(t, err)
rtest.Equals(t, "john", key.Username)
rtest.Equals(t, "example.com", key.Hostname)
return nil
@@ -107,9 +109,11 @@ func testRunKeyPasswdUserHost(t testing.TB, newPassword string, gopts global.Opt
_ = withTermStatus(t, gopts, func(ctx context.Context, gopts global.Options) error {
repo, err := global.OpenRepository(ctx, gopts, progress.NewNoopPrinter())
rtest.OK(t, err)
key, err := repository.SearchKey(ctx, repo, testKeyNewPassword, 1, "")
err = repo.SearchKey(ctx, testKeyNewPassword, 1, "")
rtest.OK(t, err)
key, err := repository.LoadKey(ctx, repo, repo.KeyID())
rtest.OK(t, err)
rtest.Equals(t, "john", key.Username)
rtest.Equals(t, "example.com", key.Hostname)
return nil