pub struct GithubTransport<R> { /* private fields */ }Expand description
GitHub.com transport over an injectable gh api runner.
Implementations§
Source§impl<R> GithubTransport<R>
impl<R> GithubTransport<R>
Sourcepub const fn new(runner: R, limits: TransportLimits) -> Self
pub const fn new(runner: R, limits: TransportLimits) -> Self
Bind a runner to explicit bounded transport limits.
Sourcepub fn into_runner(self) -> R
pub fn into_runner(self) -> R
Recover the runner, including captured requests in test adapters.
Sourcepub fn dispatch_workflow(
&self,
client: &mut (impl GithubWorkflowDispatchHttpClient + ?Sized),
request: &WorkflowDispatchRequest,
) -> Result<WorkflowDispatchReceipt, TransportError>
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>
impl<R: GhSecretRunner> GithubTransport<R>
Sourcepub fn set_environment_secret(
&mut self,
request: &EnvironmentSecretWriteRequest,
value: &SecretBytes,
) -> Result<EnvironmentSecretWriteReceipt, TransportError>
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>
impl<R: GhRunner> GithubTransport<R>
Sourcepub fn authenticate(
&mut self,
repository: &Repository,
) -> Result<AuthenticatedPrincipal, TransportError>
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.
Sourcepub fn authenticated_user(
&mut self,
) -> Result<AuthenticatedUser, TransportError>
pub fn authenticated_user( &mut self, ) -> Result<AuthenticatedUser, TransportError>
Verify authentication through GET /user.
§Errors
Returns a redacted execution or response-validation failure.
Sourcepub fn repository(
&mut self,
repository: &Repository,
) -> Result<RepositoryInfo, TransportError>
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.
Sourcepub fn actions_permissions(
&mut self,
repository: &Repository,
) -> Result<ActionsPermissions, TransportError>
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.
Sourcepub fn workflow_registration(
&mut self,
repository: &Repository,
workflow_path: &str,
) -> Result<WorkflowRegistration, TransportError>
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.
Sourcepub fn environment(
&mut self,
repository: &Repository,
environment: &ProtectedEnvironment,
) -> Result<EnvironmentInfo, TransportError>
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.
Sourcepub fn list_deployment_branch_policies(
&mut self,
repository: &Repository,
environment: &ProtectedEnvironment,
) -> Result<Vec<DeploymentBranchPolicy>, TransportError>
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.
Sourcepub fn list_environment_secrets(
&mut self,
repository: &Repository,
environment: &ProtectedEnvironment,
) -> Result<Vec<EnvironmentSecret>, TransportError>
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.
Sourcepub fn find_run(
&mut self,
repository: &Repository,
workflow_path: &str,
head_sha: &CommitSha,
branch: &BranchName,
event: RunEvent,
) -> Result<RunHandle, TransportError>
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.
Sourcepub fn find_workflow_dispatch_run(
&mut self,
request: &WorkflowDispatchRequest,
) -> Result<RunHandle, TransportError>
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.
Sourcepub fn run(
&mut self,
repository: &Repository,
handle: &RunHandle,
) -> Result<RunSnapshot, TransportError>
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.
Sourcepub fn run_by_id(
&mut self,
receipt: &WorkflowDispatchReceipt,
) -> Result<RunSnapshot, TransportError>
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.
Sourcepub fn wait_for_run(
&mut self,
repository: &Repository,
handle: &RunHandle,
policy: PollPolicy,
) -> Result<RunSnapshot, TransportError>
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.
Sourcepub fn wait_for_run_with(
&mut self,
repository: &Repository,
handle: &RunHandle,
policy: PollPolicy,
sleeper: &mut impl PollSleeper,
) -> Result<RunSnapshot, TransportError>
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.
Sourcepub fn cancel_run(
&mut self,
repository: &Repository,
run_id: RunId,
) -> Result<(), TransportError>
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.
Sourcepub fn list_artifacts(
&mut self,
repository: &Repository,
run_id: RunId,
) -> Result<Vec<ArtifactInfo>, TransportError>
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.
Sourcepub fn find_artifact(
&mut self,
repository: &Repository,
run_id: RunId,
expected_name: &ArtifactName,
) -> Result<ArtifactInfo, TransportError>
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.
Sourcepub fn download_artifact_zip(
&mut self,
repository: &Repository,
artifact: &ArtifactInfo,
target: &ArtifactDownloadTarget,
) -> Result<DownloadedArtifact, TransportError>
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>
impl<R: Clone> Clone for GithubTransport<R>
Source§impl<R: Debug> Debug for GithubTransport<R>
impl<R: Debug> Debug for GithubTransport<R>
impl<R: Eq> Eq for GithubTransport<R>
Source§impl<R: PartialEq> PartialEq for GithubTransport<R>
impl<R: PartialEq> PartialEq for GithubTransport<R>
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> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.