Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
42f4a9ee
O
openEuler-Advisor
项目概览
openeuler
/
openEuler-Advisor
通知
40
Star
4
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openEuler-Advisor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
42f4a9ee
编写于
9月 08, 2020
作者:
Z
Zhangyifan
提交者:
chenyanpan
9月 10, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
limit password length in generate_password and patch-tracking-cli
上级
0badc26d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
2 deletion
+18
-2
patch-tracking/patch_tracking/cli/generate_password
patch-tracking/patch_tracking/cli/generate_password
+2
-2
patch-tracking/patch_tracking/cli/patch_tracking_cli.py
patch-tracking/patch_tracking/cli/patch_tracking_cli.py
+16
-0
未找到文件。
patch-tracking/patch_tracking/cli/generate_password
浏览文件 @
42f4a9ee
...
...
@@ -16,7 +16,7 @@ def usage():
Requirements:
1. PASSWORD must be within the 'latin1' character set
2. PASSWORD strength require:
6 characters or more
length must be between 6 and 32
at least 1 digit [0-9]
at least 1 alphabet [a-z]
at least 1 alphabet of Upper Case [A-Z]
...
...
@@ -41,7 +41,7 @@ def password_strength_check(password):
"""
# calculating the length
length_error
=
len
(
password
)
<
6
length_error
=
len
(
password
)
<
6
or
len
(
password
)
>
32
# searching for digits
digit_error
=
re
.
search
(
r
"\d"
,
password
)
is
None
...
...
patch-tracking/patch_tracking/cli/patch_tracking_cli.py
浏览文件 @
42f4a9ee
...
...
@@ -193,6 +193,9 @@ def add(args):
"""
add tracking
"""
if
not
check_password_length
(
args
.
password
):
print
(
'PASSWORD: Password length must be between 6 and 32'
)
return
style1
=
bool
(
args
.
version_control
)
or
bool
(
args
.
repo
)
or
bool
(
args
.
branch
)
or
bool
(
args
.
scm_repo
)
or
bool
(
args
.
scm_branch
)
or
bool
(
args
.
enabled
)
...
...
@@ -235,6 +238,10 @@ def delete(args):
user
=
args
.
user
password
=
args
.
password
if
not
check_password_length
(
password
):
print
(
'PASSWORD: Password length must be between 6 and 32'
)
return
err
=
latin1_encode
(
user
)
if
err
:
print
(
"ERROR: user: only latin1 character set are allowed."
)
...
...
@@ -321,6 +328,15 @@ def dir_input_track(dir_path, args):
print
(
'error: dir path error. Params error in {}'
.
format
(
dir_path
))
def
check_password_length
(
password
):
"""
Password length must be between 6 and 32
"""
if
6
<=
len
(
password
)
<=
32
:
return
True
return
False
parser
=
argparse
.
ArgumentParser
(
prog
=
'patch_tracking_cli'
,
allow_abbrev
=
False
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录