python-jira-plus 1.0.4__tar.gz → 1.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-jira-plus
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: Enhanced Python client for JIRA with better error handling, pagination, and metadata validation.
5
5
  Home-page: https://github.com/aviz92/python-jira-plus
6
6
  Author: Avi Zaguri
@@ -25,7 +25,9 @@ class JiraPlus:
25
25
  server_type: ServerType = ServerType.CLOUD,
26
26
  urllib3_log_level: int = logging.WARNING,
27
27
  jira_username: Optional[str] = None,
28
- jira_token: Optional[str] = None
28
+ jira_token: Optional[str] = None, # Use API token (not PAT)
29
+ verify_ssl: bool = True,
30
+ sso: bool = False
29
31
  ) -> None:
30
32
  self.logger = logging.getLogger()
31
33
  logging.getLogger("urllib3").setLevel(urllib3_log_level)
@@ -36,17 +38,26 @@ class JiraPlus:
36
38
 
37
39
  self.server_type = server_type
38
40
  self.server = f'https://{self.base_url}'
41
+ self.verify_ssl = verify_ssl
42
+ self.sso = sso
39
43
 
40
44
  self.jira_client = self.create_connection()
41
45
  self.check_client_connection()
42
46
 
43
47
  @retry(stop_max_attempt_number=3, wait_fixed=180000) # Retry 3 times with a 3-min (180000) delay between each attempt
44
- def create_connection(self) -> Optional[JIRA]:
45
- jira_client = JIRA(
46
- basic_auth=(self.jira_username, self.jira_token),
47
- options={'server': self.server},
48
- timeout=580
49
- )
48
+ def create_connection(self, timeout=580) -> Optional[JIRA]:
49
+ if self.server_type == ServerType.ON_PREMISE and not self.sso:
50
+ jira_client = JIRA(
51
+ token_auth=self.jira_token,
52
+ options={'server': self.server},
53
+ timeout=timeout
54
+ )
55
+ else:
56
+ jira_client = JIRA(
57
+ basic_auth=(self.jira_username, self.jira_token),
58
+ options={'server': self.server},
59
+ timeout=timeout
60
+ )
50
61
 
51
62
  if jira_client.projects():
52
63
  self.logger.info(f"Jira Connection Successful")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-jira-plus
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: Enhanced Python client for JIRA with better error handling, pagination, and metadata validation.
5
5
  Home-page: https://github.com/aviz92/python-jira-plus
6
6
  Author: Avi Zaguri
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- package_version = '1.0.4'
3
+ package_version = '1.0.5'
4
4
 
5
5
  package_name = 'python-jira-plus'
6
6
  package_description = 'Enhanced Python client for JIRA with better error handling, pagination, and metadata validation.'