Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sbws
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
juga
sbws
Commits
d99ee762
Commit
d99ee762
authored
7 years ago
by
Matt Traudt
Browse files
Options
Downloads
Patches
Plain Diff
Pull valid character lists out into constants
parent
b95f5dd4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbws/util/config.py
+8
-3
8 additions, 3 deletions
sbws/util/config.py
with
8 additions
and
3 deletions
sbws/util/config.py
+
8
−
3
View file @
d99ee762
...
...
@@ -3,6 +3,11 @@ import os
from
string
import
Template
from
sbws.globals
import
G_PKG_DIR
_ALPHANUM
=
'
abcdefghijklmnopqrstuvwxyz
'
_ALPHANUM
+=
_ALPHANUM
.
upper
()
_ALPHANUM
+=
'
0123456789
'
_HEX
=
'
0123456789ABCDEF
'
def
_read_config_file
(
conf
,
fname
,
log_fn
=
print
):
assert
os
.
path
.
isfile
(
fname
)
...
...
@@ -362,21 +367,21 @@ def _validate_host(section, key):
def
_validate_fingerprint
(
section
,
key
):
alphabet
=
'
0123456789ABCDEF
'
alphabet
=
_HEX
length
=
40
return
_validate_string
(
section
,
key
,
min_len
=
length
,
max_len
=
length
,
alphabet
=
alphabet
)
def
_validate_password
(
section
,
key
):
alphabet
=
'
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
'
alphabet
=
_ALPHANUM
length
=
64
return
_validate_string
(
section
,
key
,
min_len
=
length
,
max_len
=
length
,
alphabet
=
alphabet
)
def
_validate_nickname
(
section
,
key
):
alphabet
=
'
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
'
alphabet
=
_ALPHANUM
min_len
=
1
max_len
=
32
return
_validate_string
(
section
,
key
,
min_len
=
min_len
,
max_len
=
max_len
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment