From f68f779bee033fe732252230851ee0cb150de908 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 22 Jun 2018 22:26:17 +0100 Subject: [PATCH] Change box_pub_key to key in admin API --- src/yggdrasil/admin.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/yggdrasil/admin.go b/src/yggdrasil/admin.go index 0a9194ef..bd5eb0c8 100644 --- a/src/yggdrasil/admin.go +++ b/src/yggdrasil/admin.go @@ -189,34 +189,34 @@ func (a *admin) init(c *Core, listenaddr string) { a.addHandler("getAllowedEncryptionPublicKeys", []string{}, func(in admin_info) (admin_info, error) { return admin_info{"allowed_box_pubs": a.getAllowedEncryptionPublicKeys()}, nil }) - a.addHandler("addAllowedEncryptionPublicKey", []string{"box_pub_key"}, func(in admin_info) (admin_info, error) { - if a.addAllowedEncryptionPublicKey(in["box_pub_key"].(string)) == nil { + a.addHandler("addAllowedEncryptionPublicKey", []string{"key"}, func(in admin_info) (admin_info, error) { + if a.addAllowedEncryptionPublicKey(in["key"].(string)) == nil { return admin_info{ "added": []string{ - in["box_pub_key"].(string), + in["key"].(string), }, }, nil } else { return admin_info{ "not_added": []string{ - in["box_pub_key"].(string), + in["key"].(string), }, - }, errors.New("Failed to add allowed box pub key") + }, errors.New("Failed to add allowed key") } }) - a.addHandler("removeAllowedEncryptionPublicKey", []string{"box_pub_key"}, func(in admin_info) (admin_info, error) { - if a.removeAllowedEncryptionPublicKey(in["box_pub_key"].(string)) == nil { + a.addHandler("removeAllowedEncryptionPublicKey", []string{"key"}, func(in admin_info) (admin_info, error) { + if a.removeAllowedEncryptionPublicKey(in["key"].(string)) == nil { return admin_info{ "removed": []string{ - in["box_pub_key"].(string), + in["key"].(string), }, }, nil } else { return admin_info{ "not_removed": []string{ - in["box_pub_key"].(string), + in["key"].(string), }, - }, errors.New("Failed to remove allowed box pub key") + }, errors.New("Failed to remove allowed key") } }) }