package github-jsoo

  1. Overview
  2. Docs
GitHub APIv3 JavaScript library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

github-data-4.4.1.tbz
sha256=2e8ea3e84c3a72fbe80ea27f400228f8f3eb82be398b07f8a189a77f39648461
sha512=71e97efa2bb2ddad4f5fa5fb2234c017338dc19f34ba849bc8787fd7eb010560a219b85f6ac017539f31ca7d785d5936c84892ead929c7ac29202dd8d3791d0d

doc/github-jsoo/Github/Token/index.html

Module Github.Token

The Token module manipulates authorization tokens. GitHub has two types of tokens: OAuth application tokens and "personal tokens".

Note: the OAuth Authorizations API has been deprecated by GitHub.

Sourcetype t

t is the abstract type of a token.

Sourceval of_code : client_id:string -> client_secret:string -> code:string -> unit -> t option Lwt.t

of_code ~client_id ~client_secret ~code () is the t granted by a code from an OAuth web flow redirect.

Sourceval create : ?scopes:Github_t.scope list -> ?note:string -> ?note_url:string -> ?client_id:string -> ?client_secret:string -> ?fingerprint:string -> ?otp:string -> user:string -> pass:string -> unit -> Github_t.auth authorization Response.t Monad.t

create ?otp ~user ~pass () is a new authorization with the provided fields. When a user has enabled two-factor authentication, the return value will be a Two_factor constructor with the one-time password delivery mode. Including a valid ?otp will yield a Result return value.

Sourceval get_all : ?otp:string -> user:string -> pass:string -> unit -> Github_t.auths authorization Response.t Monad.t

get_all ~user ~pass () are all of the authorizations that this user has made. See create for an explanation of how two-factor authentication is handled.

Sourceval get : ?otp:string -> user:string -> pass:string -> id:int64 -> unit -> Github_t.auth option authorization Response.t Monad.t

get ~user ~pass ~id () is the authorization with identifier id. See create for an explanation of how two-factor authentication is handled.

Sourceval delete : ?otp:string -> user:string -> pass:string -> id:int64 -> unit -> unit authorization Response.t Monad.t

delete ~user ~pass ~id () is Result () after the authorization with identifier id has been removed. See create for an explanation of how two-factor authentication is handled.

Sourceval of_auth : Github_t.auth -> t

of_auth auth is the OAuth application or personal token contained within auth.

Sourceval of_string : string -> t

of_string token_string is the abstract token value corresponding to the string token_string.

Sourceval to_string : t -> string

to_string token is the string serialization of token.