Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webssh
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑天保
webssh
Commits
c873b505
Commit
c873b505
authored
Oct 08, 2018
by
Sheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed attribute filename to privatekey_filename
parent
a576a41e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
handler.py
webssh/handler.py
+8
-5
No files found.
webssh/handler.py
View file @
c873b505
...
@@ -71,7 +71,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
...
@@ -71,7 +71,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
self
.
policy
=
policy
self
.
policy
=
policy
self
.
host_keys_settings
=
host_keys_settings
self
.
host_keys_settings
=
host_keys_settings
self
.
ssh_client
=
self
.
get_ssh_client
()
self
.
ssh_client
=
self
.
get_ssh_client
()
self
.
filename
=
None
self
.
privatekey_
filename
=
None
self
.
result
=
dict
(
id
=
None
,
status
=
None
,
encoding
=
None
)
self
.
result
=
dict
(
id
=
None
,
status
=
None
,
encoding
=
None
)
def
write_error
(
self
,
status_code
,
**
kwargs
):
def
write_error
(
self
,
status_code
,
**
kwargs
):
...
@@ -100,7 +100,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
...
@@ -100,7 +100,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
name
=
'privatekey'
name
=
'privatekey'
lst
=
self
.
request
.
files
.
get
(
name
)
# multipart form
lst
=
self
.
request
.
files
.
get
(
name
)
# multipart form
if
lst
:
if
lst
:
self
.
filename
=
lst
[
0
][
'filename'
]
self
.
privatekey_
filename
=
lst
[
0
][
'filename'
]
data
=
lst
[
0
][
'body'
]
data
=
lst
[
0
][
'body'
]
value
=
self
.
decode_argument
(
data
,
name
=
name
)
.
strip
()
value
=
self
.
decode_argument
(
data
,
name
=
name
)
.
strip
()
else
:
else
:
...
@@ -108,7 +108,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
...
@@ -108,7 +108,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
if
len
(
value
)
>
KEY_MAX_SIZE
:
if
len
(
value
)
>
KEY_MAX_SIZE
:
raise
InvalidValueError
(
raise
InvalidValueError
(
'Invalid private key: {}'
.
format
(
self
.
filename
)
'Invalid private key: {}'
.
format
(
self
.
privatekey_
filename
)
)
)
return
value
return
value
...
@@ -179,8 +179,11 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
...
@@ -179,8 +179,11 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
username
=
self
.
get_value
(
'username'
)
username
=
self
.
get_value
(
'username'
)
password
=
self
.
get_argument
(
'password'
,
u''
)
password
=
self
.
get_argument
(
'password'
,
u''
)
privatekey
=
self
.
get_privatekey
()
privatekey
=
self
.
get_privatekey
()
pkey
=
self
.
get_pkey_obj
(
privatekey
,
password
,
self
.
filename
)
\
if
privatekey
:
if
privatekey
else
None
pkey
=
self
.
get_pkey_obj
(
privatekey
,
password
,
self
.
privatekey_filename
)
else
:
pkey
=
None
args
=
(
hostname
,
port
,
username
,
password
,
pkey
)
args
=
(
hostname
,
port
,
username
,
password
,
pkey
)
logging
.
debug
(
args
)
logging
.
debug
(
args
)
return
args
return
args
...
...
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