This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/comdev-people.git


The following commit(s) were added to refs/heads/main by this push:
     new 82db8fb  generate summary of key statuses
82db8fb is described below

commit 82db8fbafc87fa7f9f81430b4d219440fd85098d
Author: Sebb <[email protected]>
AuthorDate: Wed Jul 2 13:51:55 2025 +0100

    generate summary of key statuses
---
 .gitignore   |  1 +
 tools/pgp.py | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 44ba7f1..794b7b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@
 
 # /html/keys/committer/ - mostly generated files
 /html/keys/committer/index.html
+/html/keys/committer/keys.json
 /html/keys/committer/*.asc
 
 # /html/public/
diff --git a/tools/pgp.py b/tools/pgp.py
index 9ed2d02..4bdb452 100644
--- a/tools/pgp.py
+++ b/tools/pgp.py
@@ -141,7 +141,7 @@ for uid, entry in people['people'].items():
     badkeys[uid] = {}
     for key in entry.get('key_fingerprints', []):
         skey = re.sub("[^0-9a-fA-F]",'', key) # Why strip all invalid chars?
-        data = None
+        data = 'key not found in database'
         ok = False
         # INFRA-12042 use only full fingerprints
         # Note: 32 char keys are obsolete V3 ones which aren't available over 
HKP anyway
@@ -159,6 +159,7 @@ for uid, entry in people['people'].items():
                     newkeys = newkeys +1
                     ok, data = pgpfunc('--fingerprint', skey)
                     data = data.strip() # strip to match cached data
+                    # LATER? dbkeys[skey.upper()] = data.split("\n") # update 
the fps cache
                 else:
                     log.write("User: %s key %s - fetch failed: (%s) %s\n" % 
(uid, skey, str(ok), res))
             found = False
@@ -250,12 +251,19 @@ entrybad = """
       <td>%s</td>
     </tr>"""
 
+# Generate a summary for external use (e.g. Whimsy)
+summary = defaultdict(dict)
 for v in sorted(committers):
     if v in keys:
         for y in keys[v]:
             f.write(entryok % (v,v,v,v,(y.replace(' ','&nbsp;'))))
+            summary[v][y] = 'ok'
     for k, r in badkeys[v].items():
         f.write(entrybad % (v,v,v,k,r))
+        summary[v][k] = r
+
+with open(os.path.join(COMMITTER_KEYS, "keys.json"), 'w', encoding='utf-8') as 
s:
+    json.dump(summary, s, indent=2, sort_keys=True)
 
 f.write("""
   </tbody>

Reply via email to