Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
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
ops
coco
Commits
fe7c8dad
Commit
fe7c8dad
authored
Jun 11, 2018
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 添加功能,系统用户选择登录模式(自动/手动登录)
parent
e4da494d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
proxy.py
coco/proxy.py
+7
-1
No files found.
coco/proxy.py
View file @
fe7c8dad
...
...
@@ -18,6 +18,8 @@ from .utils import wrap_with_line_feed as wr, wrap_with_warning as warning, \
logger
=
get_logger
(
__file__
)
TIMEOUT
=
10
BUF_SIZE
=
4096
MANUAL_LOGIN
=
'manual'
AUTO_LOGIN
=
'auto'
class
ProxyServer
:
...
...
@@ -34,13 +36,17 @@ class ProxyServer:
"""
password
,
private_key
=
\
app_service
.
get_system_user_auth_info
(
system_user
)
if
not
password
and
not
private_key
:
if
system_user
.
login_mode
==
MANUAL_LOGIN
or
(
not
password
and
not
private_key
)
:
prompt
=
"{}'s password: "
.
format
(
system_user
.
username
)
password
=
net_input
(
self
.
client
,
prompt
=
prompt
,
sensitive
=
True
)
system_user
.
password
=
password
system_user
.
private_key
=
private_key
def
proxy
(
self
,
asset
,
system_user
):
if
system_user
.
login_mode
==
MANUAL_LOGIN
and
not
system_user
.
username
:
system_user_name
=
net_input
(
self
.
client
,
prompt
=
'username: '
,
before
=
1
)
system_user
.
username
=
system_user_name
self
.
get_system_user_auth
(
system_user
)
self
.
send_connecting_message
(
asset
,
system_user
)
self
.
server
=
self
.
get_server_conn
(
asset
,
system_user
)
...
...
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