module Octokit::Client::Authorizations

Overview

Methods for the Authorizations API

See Api:

Direct including types

Defined in:

octokit/client/authorizations.cr

Instance Method Summary

Instance Method Detail

def authorizations(number : Int32) : Authorization #

Get a single authorization for the authenticated user.

You can only access your own tokens, and only through Basic Authentication.

See Also:

Example:

@client = Octokit.client("watzon", "PASSWORD")
@client.authorization(999999)

[View source]
def authorizations(**options) : Connection::Paginator(Authorization) #

List the authenticated user's authorizations.

API for users to manage their own tokens. You can only access your own tokens, and only through Basic Authentication.

See Also:

Example:

@client = Octokit.client("watzon", "PASSWORD")
@client.authorizations

[View source]
def authorize_url(app_id = client_id, **options) : String #

Get the URL to authorize a user for an application via the web flow.

See Also:

Example:

@client.authorize_url("xxxx")

[View source]
def check_application_authorization(token, key = client_id) : Authorization #

Check if a token is valid.

See Also:

Example:

@client = Octokit.client(client_id: "abcdefg12345", client_secret: "secret")
@client.check_application_authorization("deadbeef1234567890deadbeef987654321")

[View source]
def create_authorization(*, client_id = nil, client_secret = nil, scopes = [] of String, note = nil, note_url = nil, idempotent = nil, fingerprint = nil) : Authorization #

Create an authorization for the authenticated user.

You can only access your own tokens, and only through Basic Authentication.

See Also:

Example:

@client = Octokit.client("watzon", "PASSWORD")
@client.create_authorization(idempotent: true, client_id: "xxxx", client_secret: "yyyy", scopes: ["user"])

[View source]
def delete_authorization(number : Int32) : Bool #

Delete an authorization for the authenticated user.

You can only access your own tokens, and only through Basic Authentication.

See Also:

Example:

@client = Octokit.client("watzon", "PASSWORD")
@client.delete_authorization(999999)

[View source]
def reset_application_authorization(token, key = client_id) : Authorization #

Reset a token.

See Also:

Example:

@client = Octokit.client(client_id: "abcdefg12345", client_secret: "secret")
@client.reset_application_authorization("deadbeef1234567890deadbeef987654321")

[View source]
def revoke_application_authorization(token, key = client_id) : Authorization #

Revoke a token.

See Also:

Example:

@client = Octokit.client(client_id: "abcdefg12345", client_secret: "secret")
@client.revoke_application_authorization("deadbeef1234567890deadbeef987654321")

[View source]
def scopes(token = @access_token, headers = nil) : Array(String) #

Check scopes for a token.

See Also:


[View source]
def update_authorization(number : Int32, **options) : Authorization #

Update an authorization for the authenticated user.

You can only access your own tokens, and only through Basic Authentication.

See Also:

Example:

@client = Octokit.client("watzon", "PASSWORD")
@client.update_authorization(999999, add_scopes: ["gist", "repo"], note: "Why not Zoidberg possibly?")

[View source]