module

Octokit::Client::Authorizations

Instance methods

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("monalisa", "PASSWORD")
@client.authorization(999999)
Source
authorizations

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("monalisa", "PASSWORD")
@client.authorizations
Source
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")
Source
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")
Source
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("monalisa", "PASSWORD")
@client.create_authorization(idempotent: true, client_id: "xxxx", client_secret: "yyyy", scopes: ["user"])
Source
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("monalisa", "PASSWORD")
@client.delete_authorization(999999)
Source
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")
Source
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")
Source
scopes(token = @access_token, headers = nil) : Array(String)

Check scopes for a token.

See Also:

Source
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("monalisa", "PASSWORD")
@client.update_authorization(999999, add_scopes: ["gist", "repo"], note: "Why not Zoidberg possibly?")
Source