1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-11-05 18:22:26 +08:00

add auth for jerryxiao

This commit is contained in:
JerryXiao 2020-05-19 10:51:44 +08:00
parent 5a7de19081
commit 96a138e8b9
Signed by: Jerry
GPG key ID: 9D9CE43650FF2BAA
18 changed files with 27 additions and 18 deletions

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH="PGP:186242204A2EC70438E9CE3B9D9CE43650FF2BAA"

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"en" "en"
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -14,4 +14,4 @@ BABEL=(
"en-2" "en-2"
"ja-0" "ja-0"
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"zh|en-1" "zh|en-1"
) )
AUTH="PGP:" AUTH=""

View file

@ -11,4 +11,4 @@ BABEL=(
"zh-N" "zh-N"
"en-2" "en-2"
) )
AUTH="PGP:D306BB628837043150CD1E42CA0957540FD996CD" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -14,4 +14,4 @@ BABEL=(
"es-1" "es-1"
"fr-1" "fr-1"
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -11,4 +11,4 @@ BABEL=(
"zh-N" "zh-N"
"en-2" "en-2"
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -10,4 +10,4 @@ CONTACT=(
BABEL=( BABEL=(
"" ""
) )
AUTH="PGP:" AUTH=""

View file

@ -77,7 +77,7 @@ def neoneo_get_people():
if not f.is_file(): if not f.is_file():
continue continue
fc = shell2dict(f.read_text()) fc = shell2dict(f.read_text())
present_keys = ('name', 'desc', 'contact', 'babel') present_keys = ('name', 'desc', 'contact', 'babel', 'auth')
assert f.name assert f.name
people[f.name] = {k: fc.get(k) for k in present_keys} people[f.name] = {k: fc.get(k) for k in present_keys}
nic_hdl = name2nichdl(f.name) nic_hdl = name2nichdl(f.name)
@ -86,6 +86,15 @@ def neoneo_get_people():
people[f.name]['nic_hdl'] = nic_hdl people[f.name]['nic_hdl'] = nic_hdl
for v in people[f.name].values(): for v in people[f.name].values():
assert v is not None assert v is not None
auth = people[f.name]['auth']
if auth:
method, data = auth.split(':')
assert method in ('PGP', 'SSH')
if method == 'PGP':
assert len(data) == 40 # invaild pgp fingerprint
elif method == 'SSH':
assert data.startswith('ssh-') # invalid ssh pubkey
people[f.name]['auth'] = f"{'pgp-fingerprint ' if method == 'PGP' else ''}{data.strip()}"
except Exception: except Exception:
print("[!] Error while processing file", f) print("[!] Error while processing file", f)
raise raise