pub struct AppIdentity {
pub name: &'static str,
pub bundle_id: &'static str,
pub log_prefix: &'static str,
pub token_env: &'static str,
pub token_global: &'static str,
pub embedded_global: &'static str,
pub spa_base: &'static str,
pub spa_frame_src: Option<&'static str>,
}Expand description
Who the shell is serving: the names an app shows, logs under and hands to its SPA.
The SPA reads the two globals at startup, so they are part of the app’s
contract with its own web build and must never change for an app that has
shipped (Ledgeline’s are __LEDGELINE_TOKEN__ and
__LEDGELINE_EMBEDDED__). The shell embeds them in scripts after checking
nothing, so they must be plain JavaScript identifiers.
Fields§
§name: &'static strThe product name: the window title, the macOS app menu, About.
bundle_id: &'static strThe macOS bundle identifier (CFBundleIdentifier).
log_prefix: &'static strThe prefix of every line the shell writes to stderr (ledgeline: …).
token_env: &'static strThe environment variable a caller-chosen access token is read from.
token_global: &'static strThe window global the access token is handed to the SPA in.
embedded_global: &'static strThe window global that tells the SPA it is served embedded.
spa_base: &'static strThe path the app’s SPA is served under, with a leading and a trailing
slash: / when the SPA is the whole origin (Ledgeline), /app/ when
other content shares it (the invoicer, beside MBR’s pages).
The desktop window shows only documents under it
([gui::build_webview]), and only they are handed the token
(security::token_init_script). security::in_spa is the test.
spa_frame_src: Option<&'static str>The sources of a frame-src directive added to the SPA shell’s CSP
(security::shell_csp), or None for none: then default-src 'self' governs the shell’s frames, as it does for Ledgeline, which
frames nothing.
The invoicer’s note and invoice frames need https: here: WebKit
checks a frame’s navigation against the parent’s frame-src before
the desktop window’s navigation handler sees it, so without it an
https link clicked in a frame dies silently instead of reaching
[gui::build_webview]’s handler, which keeps the frame on our origin
and opens the link in the browser. (mailto: does not belong here:
WebKit refuses it from a sandboxed frame whatever the CSP says, so it
goes through security::HANDOFF_PATH.) A static source list, with
no ;.
Trait Implementations§
Source§impl Clone for AppIdentity
impl Clone for AppIdentity
impl Copy for AppIdentity
Source§impl Debug for AppIdentity
impl Debug for AppIdentity
impl Eq for AppIdentity
Source§impl PartialEq for AppIdentity
impl PartialEq for AppIdentity
impl StructuralPartialEq for AppIdentity
Auto Trait Implementations§
impl Forget for AppIdentity
impl Freeze for AppIdentity
impl Move for AppIdentity
impl RefUnwindSafe for AppIdentity
impl Send for AppIdentity
impl Sync for AppIdentity
impl Unpin for AppIdentity
impl UnsafeUnpin for AppIdentity
impl UnwindSafe for AppIdentity
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.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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