pub struct BridgeConfig {
pub hostname: String,
pub tunnel_id: String,
pub tunnel_secret: String,
pub account_id: String,
pub client_id: String,
pub client_secret: String,
pub domain: String,
pub subdomain: String,
pub auth_token: String,
pub cert_fingerprint: Option<String>,
pub service_token_issued_at: Option<i64>,
pub api_token: String,
}Expand description
Configuration for the ACP-Cloudflare bridge
Fields§
§hostname: String§tunnel_id: String§tunnel_secret: String§account_id: StringCloudflare account ID (needed to write cloudflared credentials file)
client_id: String§client_secret: String§domain: String§subdomain: String§auth_token: StringAuthentication token for WebSocket connections (generated on first run)
cert_fingerprint: Option<String>TLS certificate fingerprint (SHA256, hex encoded with colons)
service_token_issued_at: Option<i64>Unix timestamp (seconds) when the Cloudflare service token was last issued. Used to detect upcoming expiry (token duration: 1 year = 8760h).
api_token: StringCloudflare API token — stored so auto-rotation works without re-prompting. Stored with 0600 permissions alongside other secrets.
Implementations§
Source§impl BridgeConfig
impl BridgeConfig
Sourcepub fn config_path() -> PathBuf
pub fn config_path() -> PathBuf
Get the default configuration file path
Sourcepub fn config_dir() -> PathBuf
pub fn config_dir() -> PathBuf
Get the configuration directory path
Sourcepub fn generate_auth_token() -> String
pub fn generate_auth_token() -> String
Generate a random authentication token
Sourcepub fn ensure_auth_token(&mut self)
pub fn ensure_auth_token(&mut self)
Ensure auth_token is populated, generating one if needed
Sourcepub fn service_token_needs_rotation(&self) -> bool
pub fn service_token_needs_rotation(&self) -> bool
Returns true if the service token is expired or will expire within 30 days.
Sourcepub fn stamp_service_token_issued(&mut self)
pub fn stamp_service_token_issued(&mut self)
Record now as the service token issuance time.
Sourcepub fn to_connection_json(&self) -> Result<String>
pub fn to_connection_json(&self) -> Result<String>
Get connection info as JSON for QR code
Trait Implementations§
Source§impl Clone for BridgeConfig
impl Clone for BridgeConfig
Source§fn clone(&self) -> BridgeConfig
fn clone(&self) -> BridgeConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BridgeConfig
impl Debug for BridgeConfig
Source§impl<'de> Deserialize<'de> for BridgeConfig
impl<'de> Deserialize<'de> for BridgeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for BridgeConfig
impl RefUnwindSafe for BridgeConfig
impl Send for BridgeConfig
impl Sync for BridgeConfig
impl Unpin for BridgeConfig
impl UnsafeUnpin for BridgeConfig
impl UnwindSafe for BridgeConfig
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<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