Skip to content

Commit bb727f6

Browse files
committed
Remove authorization info
That's not accessible without original user/pass.
1 parent cb56777 commit bb727f6

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/github.rb

+1-10
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@ def github_user_login token
1414
user["login"] || "error"
1515
end
1616

17-
def github_user_auth token
18-
# This call must use .netrc user/pass combination
19-
json = `curl -s https://api.github.com/authorizations` rescue "[]"
20-
all = JSON.parse json rescue []
21-
authz = all.select {|a| a["token"] =~ /#{token}/}.first || []
22-
"#{authz["note"]} (#{authz["scopes"].include?('repo') ? 'private repo access' : 'insufficient access'})"
23-
end
24-
25-
def github_user_orgs
17+
def github_user_orgs token
2618
json = `curl -H "Authorization: Bearer #{token}" -s https://api.github.com/user/orgs` rescue "[]"
2719
orgs = JSON.parse json rescue []
2820
orgs.map {|o| o["login"].downcase }.sort
@@ -31,7 +23,6 @@ def github_user_orgs
3123
def user_block token
3224
<<-USER
3325
Github User: #{login(token)}
34-
Authorization: #{github_user_auth(token)}
3526
Organizations: #{github_user_orgs(token).join(", ")}
3627
USER
3728
end

0 commit comments

Comments
 (0)