pub struct GitHubSource { /* private fields */ }Expand description
GitHub source for fetching artifact attestations from GitHub’s API
Implementations§
Source§impl GitHubSource
impl GitHubSource
Sourcepub fn new(
owner: impl Into<String>,
repo: impl Into<String>,
token: Option<&str>,
) -> Result<Self>
pub fn new( owner: impl Into<String>, repo: impl Into<String>, token: Option<&str>, ) -> Result<Self>
Create a new GitHubSource targeting https://api.github.com.
Sourcepub fn with_base_url(
owner: impl Into<String>,
repo: impl Into<String>,
token: Option<&str>,
base_url: &str,
) -> Result<Self>
pub fn with_base_url( owner: impl Into<String>, repo: impl Into<String>, token: Option<&str>, base_url: &str, ) -> Result<Self>
Create a new GitHubSource targeting a custom API base URL (e.g. a
GitHub Enterprise Server instance such as
https://github.enterprise.com/api/v3).
Sourcepub fn with_client(
owner: impl Into<String>,
repo: impl Into<String>,
client: AttestationClient,
) -> Self
pub fn with_client( owner: impl Into<String>, repo: impl Into<String>, client: AttestationClient, ) -> Self
Create a new GitHubSource from an already-built AttestationClient,
allowing the caller to configure the HTTP client (base URL, token, etc.)
independently.
Sourcepub fn builder() -> GitHubSourceBuilder
pub fn builder() -> GitHubSourceBuilder
Start building a GitHubSource with a fluent builder.
Trait Implementations§
Source§impl AttestationSource for GitHubSource
impl AttestationSource for GitHubSource
Source§fn fetch_attestations<'life0, 'life1, 'async_trait>(
&'life0 self,
artifact: &'life1 ArtifactRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attestation>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_attestations<'life0, 'life1, 'async_trait>(
&'life0 self,
artifact: &'life1 ArtifactRef,
) -> Pin<Box<dyn Future<Output = Result<Vec<Attestation>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch attestations for an artifact from the configured GitHub API.
Note: this filters the GitHub API response to SLSA provenance v1
(https://slsa.dev/provenance/v1) because GitHubSource is intended
for SLSA verification via the generic verify_artifact + SlsaVerifier
flow. Callers who need the unfiltered attestation set (e.g. non-SLSA
bundles such as SPDX SBOMs) should use
crate::verify_github_attestation /
crate::verify_github_attestation_with_base_url, which send no
predicate filter, or drive AttestationClient directly.
Source§fn source_type(&self) -> &'static str
fn source_type(&self) -> &'static str
Auto Trait Implementations§
impl !RefUnwindSafe for GitHubSource
impl !UnwindSafe for GitHubSource
impl Freeze for GitHubSource
impl Send for GitHubSource
impl Sync for GitHubSource
impl Unpin for GitHubSource
impl UnsafeUnpin for GitHubSource
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more