diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2025-07-22 02:29:12 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2025-07-22 02:29:12 +0300 |
commit | de3fab3c70befe6920d5436ce0bef62f3e70ba29 (patch) | |
tree | 63af5d628c62c846a436d006674ddc66f80137ea /lib/_ak_ns | |
parent | fd12421d9e9589cc8d68a8a64bc2630266e3288f (diff) | |
download | arching-kaos-tools-de3fab3c70befe6920d5436ce0bef62f3e70ba29.tar.gz arching-kaos-tools-de3fab3c70befe6920d5436ce0bef62f3e70ba29.tar.bz2 arching-kaos-tools-de3fab3c70befe6920d5436ce0bef62f3e70ba29.zip |
[api+ns] ns tool outputs JSON format and it's used for the API
Diffstat (limited to 'lib/_ak_ns')
-rwxr-xr-x | lib/_ak_ns | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -99,6 +99,23 @@ function _ak_ns_resolve_from_key_with_proof(){ cat ${AK_NS_DIR}/${key}.map } +function _ak_ns_resolve_from_key_with_proof_json(){ + # $1; exit;; + if [ -z $1 ] || [ ! -n "$1" ] + then + _ak_log_error "No key was given" + exit 1 + fi + key="$1" + json=$(_ak_ns_resolve_from_key_with_proof $key | while read proof resolved; do printf '{"fingerprint":"%s","proof":"%s","resolved":"%s"}' "$1" "$proof" "$resolved"; done) + if [ $? -ne 0 ] + then + _ak_log_error "Something happened" + exit 1 + fi + echo $json +} + function _ak_ns_encode_key(){ # $1; exit;; if [ -z $1 ] || [ ! -n "$1" ] |