summaryrefslogtreecommitdiff
path: root/components/authorize/src/authorize_keys.erl
diff options
context:
space:
mode:
Diffstat (limited to 'components/authorize/src/authorize_keys.erl')
-rw-r--r--components/authorize/src/authorize_keys.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/authorize/src/authorize_keys.erl b/components/authorize/src/authorize_keys.erl
index f4592db..755ff64 100644
--- a/components/authorize/src/authorize_keys.erl
+++ b/components/authorize/src/authorize_keys.erl
@@ -460,13 +460,13 @@ save_key(K, Conn) ->
?warning("Unknown key type: ~p~n", [K]),
skip;
#'RSAPublicKey'{} = PubKey ->
+ KeyID =
case rvi_common:get_json_element(["kid"], K) of
- {ok, ID} ->
- ets:insert(?KEYS, #key{id = {Conn,ID}, key = PubKey});
- _ ->
- ets:insert(?KEYS, #key{id = {Conn,make_ref()},
- key = PubKey})
- end
+ {ok, ID} -> {Conn, ID};
+ _ -> {Conn, make_ref()}
+ end,
+ ?debug("Saving key ~p, PubKey = ~p~n", [KeyID, PubKey]),
+ ets:insert(?KEYS, #key{id = KeyID, key = PubKey})
end.
keys_by_conn(Conn) ->