pub struct SalesforceAuthConfig { /* private fields */ }Expand description
Configuration for the Salesforce Data Cloud token flow.
Configures how OAuth Access Tokens and DC JWTs are obtained:
login_url+client_id+auth_mode→ OAuth Access Token- OAuth Access Token +
dataspace→ DC JWT
§Example
use hyperdb_api_salesforce::{SalesforceAuthConfig, AuthMode};
let config = SalesforceAuthConfig::new(
"https://login.salesforce.com",
"3MVG9...", // Connected App Consumer Key
)?
.auth_mode(AuthMode::private_key("user@example.com", &private_key_pem)?)
.dataspace("default");Implementations§
Source§impl SalesforceAuthConfig
impl SalesforceAuthConfig
Sourcepub fn new(
login_url: impl AsRef<str>,
client_id: impl Into<String>,
) -> SalesforceAuthResult<Self>
pub fn new( login_url: impl AsRef<str>, client_id: impl Into<String>, ) -> SalesforceAuthResult<Self>
Creates a new configuration with the given login URL and client ID.
§Arguments
login_url- Salesforce login URL (e.g., “https://login.salesforce.com”)client_id- Connected App Consumer Key
§Known Login URLs
- Production:
https://login.salesforce.com - Sandbox:
https://test.salesforce.com - Custom domain:
https://mydomain.my.salesforce.com
§Errors
Returns SalesforceAuthError::Config if:
login_urlcannot be parsed as a URL (converted fromurl::ParseError).- The URL scheme is not
httporhttps. - The URL lacks a host component.
Sourcepub fn client_secret(self, secret: impl Into<String>) -> Self
pub fn client_secret(self, secret: impl Into<String>) -> Self
Sets the client secret (required for Password and RefreshToken modes).
Note: Client secret is NOT required for PrivateKey (JWT Bearer) mode.
Sourcepub fn timeout_secs(self, secs: u64) -> Self
pub fn timeout_secs(self, secs: u64) -> Self
Sets the HTTP request timeout in seconds (default: 30).
Sourcepub fn max_retries(self, retries: u32) -> Self
pub fn max_retries(self, retries: u32) -> Self
Sets the maximum number of retries for transient failures (default: 3).
Sourcepub fn dataspace_value(&self) -> Option<&str>
pub fn dataspace_value(&self) -> Option<&str>
Returns the dataspace, if set.
Trait Implementations§
Source§impl Clone for SalesforceAuthConfig
impl Clone for SalesforceAuthConfig
Source§fn clone(&self) -> SalesforceAuthConfig
fn clone(&self) -> SalesforceAuthConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SalesforceAuthConfig
impl RefUnwindSafe for SalesforceAuthConfig
impl Send for SalesforceAuthConfig
impl Sync for SalesforceAuthConfig
impl Unpin for SalesforceAuthConfig
impl UnsafeUnpin for SalesforceAuthConfig
impl UnwindSafe for SalesforceAuthConfig
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
Mutably borrows from an owned value. Read more