Struct roctogen::endpoints::oauth_authorizations::OauthAuthorizations [−][src]
pub struct OauthAuthorizations<'api> { /* fields omitted */ }
Implementations
impl<'api> OauthAuthorizations<'api>
[src]
impl<'api> OauthAuthorizations<'api>
[src]pub async fn create_authorization_async(
&self,
body: PostOauthAuthorizationsCreateAuthorization
) -> Result<Authorization, OauthAuthorizationsCreateAuthorizationError>
[src]
pub async fn create_authorization_async(
&self,
body: PostOauthAuthorizationsCreateAuthorization
) -> Result<Authorization, OauthAuthorizationsCreateAuthorizationError>
[src]Create a new authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.
Creates OAuth tokens using Basic Authentication. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app’s client ID and secret, found on your OAuth application’s settings page. If your OAuth application intends to create multiple tokens for one user, use fingerprint
to differentiate between them.
You can also create tokens on GitHub from the personal access tokens settings page. Read more about these tokens in the GitHub Help documentation.
Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in the GitHub Help documentation.
GitHub API docs for create_authorization
pub fn create_authorization(
&self,
body: PostOauthAuthorizationsCreateAuthorization
) -> Result<Authorization, OauthAuthorizationsCreateAuthorizationError>
[src]
pub fn create_authorization(
&self,
body: PostOauthAuthorizationsCreateAuthorization
) -> Result<Authorization, OauthAuthorizationsCreateAuthorizationError>
[src]Create a new authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.
Creates OAuth tokens using Basic Authentication. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app’s client ID and secret, found on your OAuth application’s settings page. If your OAuth application intends to create multiple tokens for one user, use fingerprint
to differentiate between them.
You can also create tokens on GitHub from the personal access tokens settings page. Read more about these tokens in the GitHub Help documentation.
Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in the GitHub Help documentation.
GitHub API docs for create_authorization
pub async fn delete_authorization_async(
&self,
authorization_id: i32
) -> Result<(), OauthAuthorizationsDeleteAuthorizationError>
[src]
pub async fn delete_authorization_async(
&self,
authorization_id: i32
) -> Result<(), OauthAuthorizationsDeleteAuthorizationError>
[src]Delete an authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
GitHub API docs for delete_authorization
pub fn delete_authorization(
&self,
authorization_id: i32
) -> Result<(), OauthAuthorizationsDeleteAuthorizationError>
[src]
pub fn delete_authorization(
&self,
authorization_id: i32
) -> Result<(), OauthAuthorizationsDeleteAuthorizationError>
[src]Delete an authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
GitHub API docs for delete_authorization
pub async fn delete_grant_async(
&self,
grant_id: i32
) -> Result<(), OauthAuthorizationsDeleteGrantError>
[src]
pub async fn delete_grant_async(
&self,
grant_id: i32
) -> Result<(), OauthAuthorizationsDeleteGrantError>
[src]Delete a grant
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Deleting an OAuth application’s grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on the application authorizations settings screen within GitHub.
GitHub API docs for delete_grant
pub fn delete_grant(
&self,
grant_id: i32
) -> Result<(), OauthAuthorizationsDeleteGrantError>
[src]
pub fn delete_grant(
&self,
grant_id: i32
) -> Result<(), OauthAuthorizationsDeleteGrantError>
[src]Delete a grant
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Deleting an OAuth application’s grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on the application authorizations settings screen within GitHub.
GitHub API docs for delete_grant
pub async fn get_authorization_async(
&self,
authorization_id: i32
) -> Result<Authorization, OauthAuthorizationsGetAuthorizationError>
[src]
pub async fn get_authorization_async(
&self,
authorization_id: i32
) -> Result<Authorization, OauthAuthorizationsGetAuthorizationError>
[src]Get a single authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
GitHub API docs for get_authorization
pub fn get_authorization(
&self,
authorization_id: i32
) -> Result<Authorization, OauthAuthorizationsGetAuthorizationError>
[src]
pub fn get_authorization(
&self,
authorization_id: i32
) -> Result<Authorization, OauthAuthorizationsGetAuthorizationError>
[src]Get a single authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
GitHub API docs for get_authorization
pub async fn get_grant_async(
&self,
grant_id: i32
) -> Result<ApplicationGrant, OauthAuthorizationsGetGrantError>
[src]
pub async fn get_grant_async(
&self,
grant_id: i32
) -> Result<ApplicationGrant, OauthAuthorizationsGetGrantError>
[src]Get a single grant
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
pub fn get_grant(
&self,
grant_id: i32
) -> Result<ApplicationGrant, OauthAuthorizationsGetGrantError>
[src]
pub fn get_grant(
&self,
grant_id: i32
) -> Result<ApplicationGrant, OauthAuthorizationsGetGrantError>
[src]Get a single grant
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
pub async fn get_or_create_authorization_for_app_async(
&self,
client_id: &str,
body: PutOauthAuthorizationsGetOrCreateAuthorizationForApp
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppError>
[src]
pub async fn get_or_create_authorization_for_app_async(
&self,
client_id: &str,
body: PutOauthAuthorizationsGetOrCreateAuthorizationForApp
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppError>
[src]Get-or-create an authorization for a specific app
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.
Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn’t already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.
If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
GitHub API docs for get_or_create_authorization_for_app
pub fn get_or_create_authorization_for_app(
&self,
client_id: &str,
body: PutOauthAuthorizationsGetOrCreateAuthorizationForApp
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppError>
[src]
pub fn get_or_create_authorization_for_app(
&self,
client_id: &str,
body: PutOauthAuthorizationsGetOrCreateAuthorizationForApp
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppError>
[src]Get-or-create an authorization for a specific app
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.
Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn’t already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.
If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
GitHub API docs for get_or_create_authorization_for_app
pub async fn get_or_create_authorization_for_app_and_fingerprint_async(
&self,
client_id: &str,
fingerprint: &str,
body: PutOauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError>
[src]
pub async fn get_or_create_authorization_for_app_and_fingerprint_async(
&self,
client_id: &str,
fingerprint: &str,
body: PutOauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError>
[src]Get-or-create an authorization for a specific app and fingerprint
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.
This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. fingerprint
is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.
If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
GitHub API docs for get_or_create_authorization_for_app_and_fingerprint
pub fn get_or_create_authorization_for_app_and_fingerprint(
&self,
client_id: &str,
fingerprint: &str,
body: PutOauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError>
[src]
pub fn get_or_create_authorization_for_app_and_fingerprint(
&self,
client_id: &str,
fingerprint: &str,
body: PutOauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError>
[src]Get-or-create an authorization for a specific app and fingerprint
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.
This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. fingerprint
is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.
If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
GitHub API docs for get_or_create_authorization_for_app_and_fingerprint
pub async fn list_authorizations_async(
&self,
query_params: Option<impl Into<OauthAuthorizationsListAuthorizationsParams<'api>>>
) -> Result<Vec<Authorization>, OauthAuthorizationsListAuthorizationsError>
[src]
pub async fn list_authorizations_async(
&self,
query_params: Option<impl Into<OauthAuthorizationsListAuthorizationsParams<'api>>>
) -> Result<Vec<Authorization>, OauthAuthorizationsListAuthorizationsError>
[src]List your authorizations
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
GitHub API docs for list_authorizations
pub fn list_authorizations(
&self,
query_params: Option<impl Into<OauthAuthorizationsListAuthorizationsParams<'api>>>
) -> Result<Vec<Authorization>, OauthAuthorizationsListAuthorizationsError>
[src]
pub fn list_authorizations(
&self,
query_params: Option<impl Into<OauthAuthorizationsListAuthorizationsParams<'api>>>
) -> Result<Vec<Authorization>, OauthAuthorizationsListAuthorizationsError>
[src]List your authorizations
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
GitHub API docs for list_authorizations
pub async fn list_grants_async(
&self,
query_params: Option<impl Into<OauthAuthorizationsListGrantsParams<'api>>>
) -> Result<Vec<ApplicationGrant>, OauthAuthorizationsListGrantsError>
[src]
pub async fn list_grants_async(
&self,
query_params: Option<impl Into<OauthAuthorizationsListGrantsParams<'api>>>
) -> Result<Vec<ApplicationGrant>, OauthAuthorizationsListGrantsError>
[src]List your grants
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the list your authorizations API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on the application authorizations settings screen within GitHub. The scopes
returned are the union of scopes authorized for the application. For example, if an application has one token with repo
scope and another token with user
scope, the grant will return ["repo", "user"]
.
GitHub API docs for list_grants
pub fn list_grants(
&self,
query_params: Option<impl Into<OauthAuthorizationsListGrantsParams<'api>>>
) -> Result<Vec<ApplicationGrant>, OauthAuthorizationsListGrantsError>
[src]
pub fn list_grants(
&self,
query_params: Option<impl Into<OauthAuthorizationsListGrantsParams<'api>>>
) -> Result<Vec<ApplicationGrant>, OauthAuthorizationsListGrantsError>
[src]List your grants
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the list your authorizations API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on the application authorizations settings screen within GitHub. The scopes
returned are the union of scopes authorized for the application. For example, if an application has one token with repo
scope and another token with user
scope, the grant will return ["repo", "user"]
.
GitHub API docs for list_grants
pub async fn update_authorization_async(
&self,
authorization_id: i32,
body: PatchOauthAuthorizationsUpdateAuthorization
) -> Result<Authorization, OauthAuthorizationsUpdateAuthorizationError>
[src]
pub async fn update_authorization_async(
&self,
authorization_id: i32,
body: PatchOauthAuthorizationsUpdateAuthorization
) -> Result<Authorization, OauthAuthorizationsUpdateAuthorizationError>
[src]Update an existing authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
You can only send one of these scope keys at a time.
GitHub API docs for update_authorization
pub fn update_authorization(
&self,
authorization_id: i32,
body: PatchOauthAuthorizationsUpdateAuthorization
) -> Result<Authorization, OauthAuthorizationsUpdateAuthorizationError>
[src]
pub fn update_authorization(
&self,
authorization_id: i32,
body: PatchOauthAuthorizationsUpdateAuthorization
) -> Result<Authorization, OauthAuthorizationsUpdateAuthorizationError>
[src]Update an existing authorization
Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.
If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”
You can only send one of these scope keys at a time.
GitHub API docs for update_authorization