Skip to main content

GithubTransport

Struct GithubTransport 

Source
pub struct GithubTransport<R> { /* private fields */ }
Expand description

GitHub.com transport over an injectable gh api runner.

Implementations§

Source§

impl<R> GithubTransport<R>

Source

pub const fn new(runner: R, limits: TransportLimits) -> Self

Bind a runner to explicit bounded transport limits.

Source

pub fn into_runner(self) -> R

Recover the runner, including captured requests in test adapters.

Source

pub fn runner(&self) -> &R

Borrow the runner for adapter-specific inspection.

Source

pub fn dispatch_workflow( &self, client: &mut (impl GithubWorkflowDispatchHttpClient + ?Sized), request: &WorkflowDispatchRequest, ) -> Result<WorkflowDispatchReceipt, TransportError>

Dispatch one active registered workflow through a direct, no-redirect HTTPS adapter and parse the strict 2026-03-10 receipt.

§Errors

Requires HTTP 200, JSON content, an exact bounded response object, and a positive workflow run identifier. Response URLs are validated then discarded and never enter the returned receipt or diagnostics.

Source§

impl<R: GhSecretRunner> GithubTransport<R>

Source

pub fn set_environment_secret( &mut self, request: &EnvironmentSecretWriteRequest, value: &SecretBytes, ) -> Result<EnvironmentSecretWriteReceipt, TransportError>

Set one bounded GitHub Environment secret through fixed argv and stdin.

§Errors

Rejects values above GitHub’s 48 KiB limit before invoking the runner. Process failures are redacted and never include the secret value.

Source§

impl<R: GhRunner> GithubTransport<R>

Source

pub fn authenticate( &mut self, repository: &Repository, ) -> Result<AuthenticatedPrincipal, TransportError>

Prove the configured credential by API capability, then bind it to the exact repository when it is an installation token.

§Errors

Returns a redacted execution or response-validation failure. A user credential must satisfy GET /user. If that capability is rejected, the credential must satisfy the installation-only accessible repositories endpoint and list the exact target. Environment variable names are never used to infer token type.

Source

pub fn authenticated_user( &mut self, ) -> Result<AuthenticatedUser, TransportError>

Verify authentication through GET /user.

§Errors

Returns a redacted execution or response-validation failure.

Source

pub fn repository( &mut self, repository: &Repository, ) -> Result<RepositoryInfo, TransportError>

Fetch and locally bind repository metadata to the exact owner/name.

§Errors

Rejects malformed metadata and case-insensitive identity mismatches.

Source

pub fn actions_permissions( &mut self, repository: &Repository, ) -> Result<ActionsPermissions, TransportError>

Fetch the exact repository’s GitHub Actions enablement policy.

§Errors

Rejects unavailable or malformed repository policy metadata.

Source

pub fn workflow_registration( &mut self, repository: &Repository, workflow_path: &str, ) -> Result<WorkflowRegistration, TransportError>

Resolve one workflow file through GitHub’s registry and require an active registration at the exact repository-relative path.

§Errors

Rejects an invalid requested path, malformed metadata, path drift, or any state other than active.

Source

pub fn environment( &mut self, repository: &Repository, environment: &ProtectedEnvironment, ) -> Result<EnvironmentInfo, TransportError>

Fetch and bind one exact protected signing environment.

§Errors

Rejects malformed policy metadata or an environment identity mismatch.

Source

pub fn list_deployment_branch_policies( &mut self, repository: &Repository, environment: &ProtectedEnvironment, ) -> Result<Vec<DeploymentBranchPolicy>, TransportError>

List every custom deployment branch policy within the page bound.

§Errors

Rejects malformed or duplicate metadata and incomplete pagination.

Source

pub fn list_environment_secrets( &mut self, repository: &Repository, environment: &ProtectedEnvironment, ) -> Result<Vec<EnvironmentSecret>, TransportError>

List environment-secret names without reading any secret value.

§Errors

Rejects malformed or duplicate names and incomplete pagination.

Source

pub fn find_run( &mut self, repository: &Repository, workflow_path: &str, head_sha: &CommitSha, branch: &BranchName, event: RunEvent, ) -> Result<RunHandle, TransportError>

Find exactly one workflow run by workflow path, head SHA, branch, and event.

§Errors

Rejects malformed pages, ambiguity, missing exact matches, and a full final page at the pagination bound.

Source

pub fn find_workflow_dispatch_run( &mut self, request: &WorkflowDispatchRequest, ) -> Result<RunHandle, TransportError>

Find exactly one workflow-dispatch run whose public title binds all four inputs.

§Errors

Rejects malformed pages, missing or ambiguous exact matches, correlation drift, and incomplete pagination.

Source

pub fn run( &mut self, repository: &Repository, handle: &RunHandle, ) -> Result<RunSnapshot, TransportError>

Fetch one run and re-check every immutable identity field locally.

§Errors

Rejects malformed metadata or any identity drift.

Source

pub fn run_by_id( &mut self, receipt: &WorkflowDispatchReceipt, ) -> Result<RunSnapshot, TransportError>

Fetch the run ID returned directly by workflow dispatch and re-check workflow ID/path, dispatch commit, temporary branch, and event locally.

§Errors

Rejects malformed run metadata or any immutable identity mismatch.

Source

pub fn wait_for_run( &mut self, repository: &Repository, handle: &RunHandle, policy: PollPolicy, ) -> Result<RunSnapshot, TransportError>

Poll a known run until completion using the standard thread sleeper.

§Errors

Returns when a request fails, identity changes, or the polling bound is exhausted.

Source

pub fn wait_for_run_with( &mut self, repository: &Repository, handle: &RunHandle, policy: PollPolicy, sleeper: &mut impl PollSleeper, ) -> Result<RunSnapshot, TransportError>

Poll with an injected sleeper for deterministic orchestration tests.

§Errors

Returns when a request fails, identity changes, or the polling bound is exhausted.

Source

pub fn cancel_run( &mut self, repository: &Repository, run_id: RunId, ) -> Result<(), TransportError>

Request cancellation of one exact numeric run.

§Errors

Returns a redacted API failure. A successful REST acceptance does not imply the asynchronous cancellation has completed.

Source

pub fn list_artifacts( &mut self, repository: &Repository, run_id: RunId, ) -> Result<Vec<ArtifactInfo>, TransportError>

List all artifacts for one run within the pagination bound.

§Errors

Rejects malformed metadata and a full final page at the configured pagination limit.

Source

pub fn find_artifact( &mut self, repository: &Repository, run_id: RunId, expected_name: &ArtifactName, ) -> Result<ArtifactInfo, TransportError>

Select exactly one non-expired artifact by exact name.

§Errors

Rejects missing, duplicate, expired, malformed, or oversized artifacts.

Source

pub fn download_artifact_zip( &mut self, repository: &Repository, artifact: &ArtifactInfo, target: &ArtifactDownloadTarget, ) -> Result<DownloadedArtifact, TransportError>

Download one exact artifact ZIP without extracting it.

The destination is created with no-clobber semantics, a strict private DACL on Windows, and mode 0600 on Unix. Both API metadata and actual stdout are independently bounded.

§Errors

Rejects expired/oversized metadata, oversized output, non-ZIP bytes, an existing destination, and redacted filesystem failures.

Trait Implementations§

Source§

impl<R: Clone> Clone for GithubTransport<R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: Debug> Debug for GithubTransport<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: Eq> Eq for GithubTransport<R>

Source§

impl<R: PartialEq> PartialEq for GithubTransport<R>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<R: PartialEq> StructuralPartialEq for GithubTransport<R>

Auto Trait Implementations§

§

impl<R> Freeze for GithubTransport<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for GithubTransport<R>
where R: RefUnwindSafe,

§

impl<R> Send for GithubTransport<R>
where R: Send,

§

impl<R> Sync for GithubTransport<R>
where R: Sync,

§

impl<R> Unpin for GithubTransport<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for GithubTransport<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for GithubTransport<R>
where R: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.