!29 [sync] PR-28: 更新添加主机接口 username字段的校验规则

From: @openeuler-sync-bot 
Reviewed-by: @zhu-yuncheng 
Signed-off-by: @zhu-yuncheng
This commit is contained in:
openeuler-ci-bot 2023-05-09 06:14:37 +00:00 committed by Gitee
commit 92c5792f09
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From d990c0bf4e7d0c4391bfbf0c52b80f70ea71d272 Mon Sep 17 00:00:00 2001
From: rabbitali <shusheng.wen@outlook.com>
Date: Tue, 9 May 2023 11:08:58 +0800
Subject: [PATCH] update validate rules of username field
---
zeus/function/verify/host.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zeus/function/verify/host.py b/zeus/function/verify/host.py
index f955975..63fc330 100644
--- a/zeus/function/verify/host.py
+++ b/zeus/function/verify/host.py
@@ -29,7 +29,7 @@ class HostSchema(Schema):
required=True, validate=lambda s: len(s) > 0)
host_ip = fields.IP(required=True)
management = fields.Boolean(required=True)
- username = fields.String(required=True, validate=lambda s: len(s) > 0)
+ username = fields.String(required=True, validate=lambda s: 32 >= len(s) > 0)
password = fields.String(required=True, validate=lambda s: len(s) > 0)
agent_port = fields.Integer(required=True, validate=lambda s: 65535 >= s >= 0)
os_version = fields.String(required=True, validate=lambda s: len(s) > 0)
--
Gitee

View File

@ -1,6 +1,6 @@
Name: aops-zeus
Version: v1.2.0
Release: 3
Release: 4
Summary: A host and user manager service which is the foundation of aops.
License: MulanPSL2
URL: https://gitee.com/openeuler/%{name}
@ -8,6 +8,7 @@ Source0: %{name}-%{version}.tar.gz
Patch0001: 0001-fix-token-is-not-invalidated-after-being-refreshed.patch
Patch0002: 0002-update-args-validation-rules-and-update-add-host-by-batch.patch
Patch0003: 0003-add-gevent-config-item-for-uwsgi.patch
Patch0004: 0004-update-validate-rules-of-username-field.patch
BuildRequires: python3-setuptools
@ -45,6 +46,9 @@ A host and user manager service which is the foundation of aops.
%changelog
* Tue May 09 2023 wenxin<shusheng.wen@outlook.com> - v1.2.0-4
- update validate rules of username field
* Mon May 08 2023 wenixn<shusheng.wen@outlook.com> - v1.2.0-3
- add gevent config item for uwsgi