#[non_exhaustive]pub struct GitHubConfig {
pub host: String,
pub api_base: Url,
pub web_base: Url,
pub app_id: u64,
pub client_id: String,
pub app_slug: String,
pub jwt_issuer: JwtIssuer,
pub checkout_action: String,
pub actions_integration_id: Option<u64>,
pub request_timeout: Duration,
pub device_poll_unit: Duration,
pub bridge_checks: bool,
}Expand description
How to reach one GitHub (github.com or a GHES instance) as one App.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.host: StringForge host resources on this GitHub start with: github.com, or the
GHES host.
api_base: UrlREST API base: https://api.github.com, https://<ghes>/api/v3.
web_base: UrlWeb base, for install pages and the OAuth device flow:
https://github.com, https://<ghes>.
app_id: u64The App’s numeric id.
client_id: StringThe App’s client id (Iv1.… / Iv23…): the JWT issuer and the
device-flow client.
app_slug: StringThe App’s URL slug, for its install page.
jwt_issuer: JwtIssuerWhich identifier the App JWT is issued under.
checkout_action: Stringuses: reference for checkout in the generated workflow; must be
pinned to a 40-hex commit.
actions_integration_id: Option<u64>The GitHub Actions App’s id, which the required status check is pinned
to. None looks it up (GET /apps/github-actions) when first needed.
Pinning matters: an unpinned required check is satisfied by a status
anyone with write access posts under that name.
request_timeout: DurationPer-request timeout.
device_poll_unit: DurationOne second of device-flow polling interval, as the adapter waits it. Always one second outside tests.
bridge_checks: boolWhere no org required workflow is available (personal accounts, organisations without org rulesets), the bridge posts the check itself and the ruleset requires it from this App rather than from GitHub Actions (§9, “forged check runs”): a workflow on another branch can post a “Verify commit trust” run as the Actions App, but not as the community’s App. The plan then commits no workflow. Off by default, so a caller with no check poster keeps the Actions workflow; the bridge turns it on.
Implementations§
Source§impl GitHubConfig
impl GitHubConfig
Sourcepub fn github_com(
app_id: u64,
client_id: impl Into<String>,
app_slug: impl Into<String>,
) -> Self
pub fn github_com( app_id: u64, client_id: impl Into<String>, app_slug: impl Into<String>, ) -> Self
github.com.
Sourcepub fn enterprise(
host: &str,
app_id: u64,
client_id: impl Into<String>,
app_slug: impl Into<String>,
) -> Result<Self>
pub fn enterprise( host: &str, app_id: u64, client_id: impl Into<String>, app_slug: impl Into<String>, ) -> Result<Self>
A GitHub Enterprise Server instance at host.
Sourcepub fn with_endpoints(self, api_base: Url, web_base: Url) -> Self
pub fn with_endpoints(self, api_base: Url, web_base: Url) -> Self
Point the API and web bases elsewhere (a proxy, a test server). The host that resources must name is unchanged.
Sourcepub fn with_app_id_issuer(self) -> Self
pub fn with_app_id_issuer(self) -> Self
Issue App JWTs under the numeric App id instead of the client id.
Sourcepub fn with_actions_integration_id(self, id: u64) -> Self
pub fn with_actions_integration_id(self, id: u64) -> Self
Pin the Actions App id instead of looking it up.
Sourcepub fn with_bridge_checks(self) -> Self
pub fn with_bridge_checks(self) -> Self
Have the bridge post the check itself where there is no org required
workflow (see GitHubConfig::bridge_checks).