package github
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8b742638d926ad4c469ed3d7ed85f811fcf38a42bebd9e57d2a036d3ca2bf8f9
md5=111940cd797b1a4c621be2a8077e706f
doc/github/Github_core/Make/Token/index.html
Module Make.Token
Source
The Token
module manipulates authorization tokens. GitHub has two types of tokens: OAuth application tokens and "personal tokens".
t
is the abstract type of a token.
val 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.
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.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.
val 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.
val 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.
val 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.
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
.