SecretScanning

Struct SecretScanning 

Source
pub struct SecretScanning<'api, C: Client>
where AdapterError: From<<C as Client>::Err>,
{ /* private fields */ }

Implementations§

Source§

impl<'api, C: Client> SecretScanning<'api, C>
where AdapterError: From<<C as Client>::Err>,

Source

pub async fn create_push_protection_bypass_async( &self, owner: &str, repo: &str, body: PostSecretScanningCreatePushProtectionBypass, ) -> Result<SecretScanningPushProtectionBypass, AdapterError>


§Create a push protection bypass

Creates a bypass for a previously push protected secret.

The authenticated user must be the original author of the committed secret.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

GitHub API docs for create_push_protection_bypass


Source

pub fn create_push_protection_bypass( &self, owner: &str, repo: &str, body: PostSecretScanningCreatePushProtectionBypass, ) -> Result<SecretScanningPushProtectionBypass, AdapterError>


§Create a push protection bypass

Creates a bypass for a previously push protected secret.

The authenticated user must be the original author of the committed secret.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

GitHub API docs for create_push_protection_bypass


Source

pub async fn get_alert_async( &self, owner: &str, repo: &str, alert_number: AlertNumber, query_params: Option<impl Into<SecretScanningGetAlertParams>>, ) -> Result<SecretScanningAlert, AdapterError>


§Get a secret scanning alert

Gets a single secret scanning alert detected in an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for get_alert


Source

pub fn get_alert( &self, owner: &str, repo: &str, alert_number: AlertNumber, query_params: Option<impl Into<SecretScanningGetAlertParams>>, ) -> Result<SecretScanningAlert, AdapterError>


§Get a secret scanning alert

Gets a single secret scanning alert detected in an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for get_alert


Source

pub async fn get_scan_history_async( &self, owner: &str, repo: &str, ) -> Result<SecretScanningScanHistory, AdapterError>


§Get secret scanning scan history for a repository

Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for get_scan_history


Source

pub fn get_scan_history( &self, owner: &str, repo: &str, ) -> Result<SecretScanningScanHistory, AdapterError>


§Get secret scanning scan history for a repository

Lists the latest default incremental and backfill scans by type for a repository. Scans from Copilot Secret Scanning are not included.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for get_scan_history


Source

pub async fn list_alerts_for_enterprise_async( &self, enterprise: &str, query_params: Option<impl Into<SecretScanningListAlertsForEnterpriseParams<'api>>>, ) -> Result<Vec<OrganizationSecretScanningAlert>, AdapterError>


§List secret scanning alerts for an enterprise

Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.

Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a security manager.

The authenticated user must be a member of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope or security_events scope to use this endpoint.

GitHub API docs for list_alerts_for_enterprise


Source

pub fn list_alerts_for_enterprise( &self, enterprise: &str, query_params: Option<impl Into<SecretScanningListAlertsForEnterpriseParams<'api>>>, ) -> Result<Vec<OrganizationSecretScanningAlert>, AdapterError>


§List secret scanning alerts for an enterprise

Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.

Alerts are only returned for organizations in the enterprise for which the authenticated user is an organization owner or a security manager.

The authenticated user must be a member of the enterprise in order to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope or security_events scope to use this endpoint.

GitHub API docs for list_alerts_for_enterprise


Source

pub async fn list_alerts_for_org_async( &self, org: &str, query_params: Option<impl Into<SecretScanningListAlertsForOrgParams<'api>>>, ) -> Result<Vec<OrganizationSecretScanningAlert>, AdapterError>


§List secret scanning alerts for an organization

Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for list_alerts_for_org


Source

pub fn list_alerts_for_org( &self, org: &str, query_params: Option<impl Into<SecretScanningListAlertsForOrgParams<'api>>>, ) -> Result<Vec<OrganizationSecretScanningAlert>, AdapterError>


§List secret scanning alerts for an organization

Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for list_alerts_for_org


Source

pub async fn list_alerts_for_repo_async( &self, owner: &str, repo: &str, query_params: Option<impl Into<SecretScanningListAlertsForRepoParams<'api>>>, ) -> Result<Vec<SecretScanningAlert>, AdapterError>


§List secret scanning alerts for a repository

Lists secret scanning alerts for an eligible repository, from newest to oldest.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for list_alerts_for_repo


Source

pub fn list_alerts_for_repo( &self, owner: &str, repo: &str, query_params: Option<impl Into<SecretScanningListAlertsForRepoParams<'api>>>, ) -> Result<Vec<SecretScanningAlert>, AdapterError>


§List secret scanning alerts for a repository

Lists secret scanning alerts for an eligible repository, from newest to oldest.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for list_alerts_for_repo


Source

pub async fn list_locations_for_alert_async( &self, owner: &str, repo: &str, alert_number: AlertNumber, query_params: Option<impl Into<SecretScanningListLocationsForAlertParams>>, ) -> Result<Vec<SecretScanningLocation>, AdapterError>


§List locations for a secret scanning alert

Lists all locations for a given secret scanning alert for an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for list_locations_for_alert


Source

pub fn list_locations_for_alert( &self, owner: &str, repo: &str, alert_number: AlertNumber, query_params: Option<impl Into<SecretScanningListLocationsForAlertParams>>, ) -> Result<Vec<SecretScanningLocation>, AdapterError>


§List locations for a secret scanning alert

Lists all locations for a given secret scanning alert for an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for list_locations_for_alert


Source

pub async fn update_alert_async( &self, owner: &str, repo: &str, alert_number: AlertNumber, body: PatchSecretScanningUpdateAlert, ) -> Result<SecretScanningAlert, AdapterError>


§Update a secret scanning alert

Updates the status of a secret scanning alert in an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for update_alert


Source

pub fn update_alert( &self, owner: &str, repo: &str, alert_number: AlertNumber, body: PatchSecretScanningUpdateAlert, ) -> Result<SecretScanningAlert, AdapterError>


§Update a secret scanning alert

Updates the status of a secret scanning alert in an eligible repository.

The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo or security_events scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the public_repo scope instead.

GitHub API docs for update_alert


Auto Trait Implementations§

§

impl<'api, C> Freeze for SecretScanning<'api, C>

§

impl<'api, C> RefUnwindSafe for SecretScanning<'api, C>

§

impl<'api, C> Send for SecretScanning<'api, C>
where AdapterError: Sized, C: Sync,

§

impl<'api, C> Sync for SecretScanning<'api, C>
where AdapterError: Sized, C: Sync,

§

impl<'api, C> Unpin for SecretScanning<'api, C>

§

impl<'api, C> UnwindSafe for SecretScanning<'api, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.