package github-jsoo
Install
dune-project
Dependency
Authors
Maintainers
Sources
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.
t is the abstract type of a token.
val of_code :
client_id:string ->
client_secret:string ->
code:string ->
unit ->
t option Lwt.tof_code ~client_id ~client_secret ~code () is the t granted by a code from an OAuth web flow redirect.
val 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.tcreate ?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.
val get_all :
?otp:string ->
user:string ->
pass:string ->
unit ->
Github_t.auths authorization Response.t Monad.tget_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.
val get :
?otp:string ->
user:string ->
pass:string ->
id:int64 ->
unit ->
Github_t.auth option authorization Response.t Monad.tget ~user ~pass ~id () is the authorization with identifier id. See create for an explanation of how two-factor authentication is handled.
val delete :
?otp:string ->
user:string ->
pass:string ->
id:int64 ->
unit ->
unit authorization Response.t Monad.tdelete ~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.
of_auth auth is the OAuth application or personal token contained within auth.
of_string token_string is the abstract token value corresponding to the string token_string.