pub struct JiraConfig {
pub login: String,
pub api_url: String,
}Expand description
Configuration for Jira API integration.
This structure holds the necessary information for connecting to Jira instances, including both cloud and server/data center deployments. The configuration is designed to be serializable for storage in configuration files.
§Security Notes
- Passwords are never stored in configuration files
- Only usernames and API endpoints are persisted
- Session tokens are cached separately with encryption
- Configuration files should have restricted permissions
§Supported Jira Instances
- Atlassian Cloud: Uses
https://company.atlassian.netformat - Server/Data Center: Uses custom domain like
https://jira.company.com - Local Development: Can use
http://localhost:8080for testing
Fields§
§login: StringJira username for authentication.
This should be the actual username, not an email address, unless your Jira instance is configured to use email addresses as usernames. Check with your Jira administrator if unsure.
For Atlassian Cloud instances, this is typically the email address used to register the account.
api_url: StringBase URL of the Jira instance.
Examples:
- Atlassian Cloud:
https://company.atlassian.net - Server/Data Center:
https://jira.company.com - Local development:
http://localhost:8080
Do not include the /rest/api/ path as it will be added automatically.
The URL should point to the root of your Jira installation.
Implementations§
Source§impl JiraConfig
impl JiraConfig
Sourcepub fn module() -> ConfigModule
pub fn module() -> ConfigModule
Returns the configuration module metadata for Jira.
Used by the configuration system to identify and manage Jira-specific settings during interactive setup. This provides the human-readable name and internal key for the module.
§Returns
A ConfigModule with Jira identification information.
Sourcepub fn init(config: &Option<Self>) -> Result<Self>
pub fn init(config: &Option<Self>) -> Result<Self>
Runs an interactive configuration setup for Jira integration.
Prompts the user for Jira instance URL and username, using existing configuration values as defaults if available. This method provides a user-friendly way to configure Jira integration during initial setup or reconfiguration.
§Interactive Prompts
- Username: Prompts for Jira username (or email for cloud instances)
- API URL: Prompts for Jira instance URL with validation hints
Both prompts will show existing values as defaults if configuration already exists, making it easy to update only specific values without re-entering everything.
§Configuration Validation
While this method doesn’t validate the actual connection to Jira, it provides helpful prompts and examples to guide users toward correct configuration values.
§Arguments
config- Existing Jira configuration to use as defaults (if any)
§Returns
Result<Self>- New Jira 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(JiraConfig {
login: "olduser".to_string(),
api_url: "https://old-jira.com".to_string(),
});
let new_config = JiraConfig::init(&existing_config)?;Trait Implementations§
Source§impl Clone for JiraConfig
impl Clone for JiraConfig
Source§fn clone(&self) -> JiraConfig
fn clone(&self) -> JiraConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more