pub struct PluginAuth {
pub provider: String,
pub id: String,
pub file_name: String,
pub label: String,
pub prefix: String,
pub proxy_url: String,
pub disabled: bool,
pub storage_json: Bytes,
pub metadata: Metadata,
pub attributes: StringMap,
pub next_refresh_after: GoTime,
}Expand description
Go coreauth.Auth as a plugin produces it.
Fields§
§provider: String§id: String§file_name: String§label: String§prefix: String§proxy_url: String§disabled: bool§storage_json: BytesThe plugin’s raw storage JSON (pluginTokenStorage.rawJSON).
metadata: MetadataHost-managed metadata; always carries type.
attributes: StringMap§next_refresh_after: GoTimeImplementations§
Source§impl PluginAuth
impl PluginAuth
Sourcepub fn from_auth_data(
data: AuthData,
path: &str,
file_name: &str,
auth_dir: &str,
) -> Option<Self>
pub fn from_auth_data( data: AuthData, path: &str, file_name: &str, auth_dir: &str, ) -> Option<Self>
Go pluginAuthDataToCoreAuth. None without a provider.
Sourcepub fn storage_payload(&self) -> Result<Bytes, String>
pub fn storage_payload(&self) -> Result<Bytes, String>
Go mergedStorageJSON (pluginTokenStorage.RawJSON / SaveTokenToFile): the raw
storage object, overlaid with metadata, type set, legacy keys normalized,
encoded with sorted keys.
Source§impl PluginAuth
impl PluginAuth
Sourcepub fn merge_existing(&mut self, existing: &Map<String, Value>)
pub fn merge_existing(&mut self, existing: &Map<String, Value>)
Go MergeExistingAuthMetadata: keys the auth does not set are taken from the
existing file’s JSON (token payload keys excepted), and its disabled unless
the auth sets one.
Sourcepub fn file_path(&self, base_dir: &str) -> Result<String, String>
pub fn file_path(&self, base_dir: &str) -> Result<String, String>
Go resolveAuthPath: the file Self::save_file writes.
Sourcepub fn save_file(self, base_dir: &str, create: bool) -> Result<String, String>
pub fn save_file(self, base_dir: &str, create: bool) -> Result<String, String>
Go FileTokenStore.Save for a plugin auth: the file under base_dir (or the
auth’s own path), written atomically with mode 0600 unless it already holds the
same JSON. Returns the path; without create (Go’s auth creation intent, which
logins carry and command-line plugins do not) a disabled auth whose file does not
exist is skipped with an empty path.
Source§impl PluginAuth
impl PluginAuth
Sourcepub fn view(&self) -> AuthView
pub fn view(&self) -> AuthView
The credential as the host reads it back: Go storageJSONFromAuth takes the
storage’s RawJSON, which is PluginAuth::storage_payload (empty on error).
Trait Implementations§
Source§impl Clone for PluginAuth
impl Clone for PluginAuth
Source§impl Debug for PluginAuth
impl Debug for PluginAuth
Source§impl Default for PluginAuth
impl Default for PluginAuth
Source§impl PartialEq for PluginAuth
impl PartialEq for PluginAuth
impl StructuralPartialEq for PluginAuth
Auto Trait Implementations§
impl !Freeze for PluginAuth
impl Forget for PluginAuth
impl Move for PluginAuth
impl RefUnwindSafe for PluginAuth
impl Send for PluginAuth
impl Sync for PluginAuth
impl Unpin for PluginAuth
impl UnsafeUnpin for PluginAuth
impl UnwindSafe for PluginAuth
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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