Skip to content

Commit

Permalink
debug: authorized-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly committed Nov 8, 2023
1 parent f959a07 commit df4472a
Show file tree
Hide file tree
Showing 4 changed files with 910 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/users/authorized-keys-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function add_authorized_key_dialog(keys) {
caption: _("Add"),
style: "primary",
clicked: () => {
console.log("adding key", state.text);
return keys.add_key(state.text);
}
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/users/authorized-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function AuthorizedKeys (user_name, home_dir) {
}

self.add_key = function(key) {
console.log("adding key", key);
return parse_pubkeys(key)
.then(keys => {
const obj = keys[0];
Expand All @@ -109,6 +110,8 @@ function AuthorizedKeys (user_name, home_dir) {
// eslint-disable-next-line prefer-promise-reject-errors
.catch(ex => Promise.reject(_("Error saving authorized keys: ") + ex)); // not-covered: OS error
} else {
console.log("objects", keys);
console.log("key", key);
return Promise.reject(_("The key you provided was not valid."));
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/run
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ case "${TEST_SCENARIO:=}" in
PREPARE_OPTS="$PREPARE_OPTS --quick"
;;&
*other*)
RUN_OPTS="$RUN_OPTS $(echo "$ALL_TESTS" | grep -Ev "$RE_NETWORKING|$RE_STORAGE|$RE_EXPENSIVE")"
RUN_OPTS="$RUN_OPTS TestKeys.testAuthorizedKeys"
;;&

esac
Expand Down
Loading

0 comments on commit df4472a

Please sign in to comment.