From ae014f960fffccbc3c5348b1ff0e25e1e598a2d9 Mon Sep 17 00:00:00 2001 From: Pinghao Wu Date: Sat, 13 Jan 2024 15:53:51 +0800 Subject: [PATCH] update for himitsu 0.5 --- cmd/docker-credential-himitsu/get.ha | 9 +++------ cmd/docker-credential-himitsu/list.ha | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/cmd/docker-credential-himitsu/get.ha b/cmd/docker-credential-himitsu/get.ha index ad37335..3ebdf80 100644 --- a/cmd/docker-credential-himitsu/get.ha +++ b/cmd/docker-credential-himitsu/get.ha @@ -23,18 +23,15 @@ fn get(hi: net::socket) void = { const iter = client::query(hi, client::operation::QUERY, &query, client::flags::DECRYPT)!; const json = json::newobject(); defer json::finish(json); - const res = match (client::next(&iter)!) { + const query = match (client::next(&iter)!) { case void => // see go github.com/docker/docker-credential-helpers/client // client.go fmt::println("credentials not found in native keychain")!; os::exit(255); - case let s: const str => - yield s; + case let q: query::query => + yield q; }; - const parts = shlex::split(res)!; - defer strings::freeall(parts); - const query = query::parse_items(parts)!; defer query::finish(&query); let secreti = 0z, usernamei = 0z; for (let i = 0z; i < len(query.items); i += 1) { diff --git a/cmd/docker-credential-himitsu/list.ha b/cmd/docker-credential-himitsu/list.ha index 97c2e93..7c39be0 100644 --- a/cmd/docker-credential-himitsu/list.ha +++ b/cmd/docker-credential-himitsu/list.ha @@ -19,15 +19,12 @@ fn list(hi: net::socket) void = { const json = json::newobject(); defer json::finish(json); for (true) { - const res = match (client::next(&iter)!) { + const query = match (client::next(&iter)!) { case void => break; - case let s: const str => - yield s; + case let q: query::query => + yield q; }; - const parts = shlex::split(res)!; - defer strings::freeall(parts); - const query = query::parse_items(parts)!; defer query::finish(&query); let hosti = 0z, usernamei = 0z; for (let i = 0z; i < len(query.items); i += 1) { -- 2.45.2