File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,7 @@ def github_user_login token
1414 user [ "login" ] || "error"
1515end
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
3123def 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
3728end
You can’t perform that action at this time.
0 commit comments