Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
matograine
silkaj
Commits
374cce0a
Commit
374cce0a
authored
Jan 30, 2019
by
Moul
Committed by
Mael
Mar 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[enh] #130: prevent erasing authfile:
- ask for confirmation if file exists in order to erase.
parent
897dbdd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
silkaj/auth.py
silkaj/auth.py
+11
-1
No files found.
silkaj/auth.py
View file @
374cce0a
...
...
@@ -16,7 +16,7 @@ along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
"""
from
silkaj.tools
import
message_exit
from
click
import
command
,
option
,
pass_context
from
click
import
command
,
option
,
pass_context
,
confirm
from
getpass
import
getpass
from
pathlib
import
Path
from
re
import
compile
,
search
...
...
@@ -40,6 +40,16 @@ def auth_method(ctx):
@
option
(
"--file"
,
default
=
"authfile"
,
show_default
=
True
,
help
=
"Path file"
)
def
generate_auth_file
(
file
):
key
=
auth_method
()
authfile
=
Path
(
file
)
if
authfile
.
is_file
():
confirm
(
"Would you like to erase "
+
file
+
" by an authfile corresponding to following pubkey `"
+
key
.
pubkey
+
"`?"
,
abort
=
True
,
)
key
.
save_seedhex_file
(
file
)
print
(
"Authentication file 'authfile' generated and stored in current
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment