We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a4569c1 + 0023724 commit 3e94295Copy full SHA for 3e94295
api/ruby/2fa_checker.rb
@@ -0,0 +1,16 @@
1
+require 'octokit.rb'
2
+
3
+if ARGV.length != 1
4
+ $stderr.puts "Pass in the name of the organization you're interested in checking."
5
+ exit 1
6
+end
7
8
+# !!! DO NOT EVER USE HARD-CODED VALUES IN A REAL APP !!!
9
+# Instead, set and test environment variables, like below
10
+client = Octokit::Client.new(:access_token => ENV['MY_PERSONAL_TOKEN'])
11
12
+ORG = ARGV[0].to_s
13
14
+client.organization_members(ORG, { :filter => "2fa_disabled" }).each do |user|
15
+ puts "#{user[:login]} does not have 2FA enabled, and yet is a member of #{ORG}!"
16
0 commit comments