summaryrefslogtreecommitdiff
path: root/bin/pgp-list-keyids
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pgp-list-keyids')
-rwxr-xr-xbin/pgp-list-keyids28
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/pgp-list-keyids b/bin/pgp-list-keyids
new file mode 100755
index 0000000..93bc292
--- /dev/null
+++ b/bin/pgp-list-keyids
@@ -0,0 +1,28 @@
+#!/usr/bin/env ruby
+# Usage: pgp-list-keyids
+cfg_groups = {
+ :trusted => [ "hackers", "bots" ],
+ :secondary => [ "trustedusers" ]
+}
+
+######################################################################
+require 'yaml'
+
+users = Dir.glob("users/*.yml").map{|f|YAML::load(open(f))}
+
+users.each do |user|
+ if user["groups"]
+ if ! (user["groups"] & cfg_groups[:trusted]).empty?
+ puts "trusted/#{user["username"]} #{user["pgp_keyid"]}"
+ elsif ! (user["groups"] & cfg_groups[:secondary]).empty?
+ puts "secondary/#{user["username"]} #{user["pgp_keyid"]}"
+ elsif user["pgp_keyid"]
+ puts "revoked/#{user["username"]} #{user["pgp_keyid"]}"
+ end
+ end
+ if user["pgp_revoked_keyids"]
+ user["pgp_revoked_keyids"].each do |keyid|
+ puts "revoked/#{user["username"]} #{keyid}"
+ end
+ end
+end