Module: Octokit::Client::Authorizations
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/authorizations.rb
Instance Method Summary collapse
-
#authorization(number) ⇒ Authorization
Get a single authorization for the authenticated user.
-
#authorizations ⇒ Array
List a users authorizations.
-
#create_authorization(options = {}) ⇒ Authorization
Create an authorization for the authenticated user.
-
#delete_authorization(number) ⇒ Status
Delete an authorization for the authenticated user.
-
#update_authorization(number, options = {}) ⇒ Authorization
Update an authorization for the authenticated user.
Instance Method Details
#authorization(number) ⇒ Authorization
Get a single authorization for the authenticated user.
You can only access your own tokens, and only through Basic Authentication.
31 32 33 |
# File 'lib/octokit/client/authorizations.rb', line 31 def (number) get("authorizations/#{number}") end |
#authorizations ⇒ Array
List a users authorizations
API for users to manage their own tokens. You can only access your own tokens, and only through Basic Authentication.
16 17 18 |
# File 'lib/octokit/client/authorizations.rb', line 16 def get('authorizations') end |
#create_authorization(options = {}) ⇒ Authorization
Create an authorization for the authenticated user.
You can create your own tokens, and only through Basic Authentication.
51 52 53 54 55 56 |
# File 'lib/octokit/client/authorizations.rb', line 51 def (={}) # Techincally we can omit scopes as GitHub has a default, however the # API will reject us if we send a POST request with an empty body. = {:scopes => ""}.merge() post('authorizations', ) end |
#delete_authorization(number) ⇒ Status
Delete an authorization for the authenticated user.
You can delete your own tokens, and only through Basic Authentication.
95 96 97 |
# File 'lib/octokit/client/authorizations.rb', line 95 def (number) delete("authorizations/#{number}", {}, 3, true, true) end |
#update_authorization(number, options = {}) ⇒ Authorization
Update an authorization for the authenticated user.
You can update your own tokens, but only through Basic Authentication.
76 77 78 79 80 81 |
# File 'lib/octokit/client/authorizations.rb', line 76 def (number, ={}) # Techincally we can omit scopes as GitHub has a default, however the # API will reject us if we send a POST request with an empty body. = {:scopes => ""}.merge() patch("authorizations/#{number}", ) end |