pub struct SiConfig {
pub login: String,
pub auth_url: String,
pub api_url: String,
}Expand description
Configuration for SiServer API integration.
This structure holds the necessary information for connecting to internal SiServer systems. Unlike other API integrations, SiServer requires separate authentication and API endpoints due to its sophisticated security architecture.
§Multi-Endpoint Architecture
SiServer uses different endpoints for different purposes:
- Authentication URL: LDAP authentication endpoint
- API URL: Main API endpoint for reports and data
- Separation Benefits: Enhanced security, load distribution, service isolation
§Security Considerations
- Passwords are never stored in configuration files
- Only username and endpoints are persisted
- Session tokens are cached separately with encryption
- Double base64 password encoding for transmission security
Fields§
§login: StringUsername for SiServer authentication.
This should be the corporate username used for LDAP authentication. Typically matches the username used for other company systems.
auth_url: StringURL for the SiServer authentication endpoint.
This endpoint handles LDAP authentication and token generation.
Example: https://auth.company.com
This is separate from the main API URL due to SiServer’s security architecture.
api_url: StringBase URL for the main SiServer API endpoints.
This endpoint handles report submission and data retrieval operations.
Example: https://api.company.com
All API operations (reports, calendar) use this base URL.
Implementations§
Source§impl SiConfig
impl SiConfig
Sourcepub fn module() -> ConfigModule
pub fn module() -> ConfigModule
Returns the configuration module metadata for SiServer.
Used by the configuration system to identify and manage SiServer-specific settings during interactive setup.
§Returns
A ConfigModule with SiServer identification information.
Sourcepub fn init(config: &Option<SiConfig>) -> Result<Self>
pub fn init(config: &Option<SiConfig>) -> Result<Self>
Runs an interactive configuration setup for SiServer integration.
Prompts the user for SiServer connection details including username and both authentication and API endpoints. Uses existing configuration values as defaults if available.
§Interactive Prompts
- Username: Corporate username for LDAP authentication
- Authentication URL: LDAP endpoint for token generation
- API URL: Main API endpoint for reports and data operations
All prompts show existing values as defaults if configuration already exists, making it easy to update specific values without re-entering everything.
§Configuration Validation
While this method doesn’t validate actual connectivity, it provides helpful prompts to guide users toward correct configuration values for their corporate SiServer deployment.
§Arguments
config- Existing SiServer configuration to use as defaults (if any)
§Returns
Result<Self>- New SiServer configuration with user input
§Errors
Returns an error if:
- Terminal input/output fails
- User cancels the configuration process
- Input validation fails
§Example
let existing_config = Some(SiConfig {
login: "olduser".to_string(),
auth_url: "https://old-auth.com".to_string(),
api_url: "https://old-api.com".to_string(),
});
let new_config = SiConfig::init(&existing_config)?;