diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-09-06 00:39:14 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-09-06 00:39:14 -0400 |
commit | ac4dcb64a8f6c07dfe50e9005dc4246f21ebf84e (patch) | |
tree | 8d9144bf1ab4c881f076ae2b7927516d764d89e0 /bin/pgp-list-keyids | |
parent | 4b70501e432eb5fd9ed04a4afbadafabd982e9fc (diff) |
Split hackers.yml into users/#{uid}.yml
Diffstat (limited to 'bin/pgp-list-keyids')
-rwxr-xr-x | bin/pgp-list-keyids | 28 |
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 |