boto3-refresh-session 2.0.6__tar.gz → 2.0.7__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.
Files changed (17) hide show
  1. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/PKG-INFO +1 -1
  2. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/__init__.py +1 -1
  3. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/methods/custom.py +3 -3
  4. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/methods/ecs.py +2 -2
  5. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/methods/sts.py +3 -2
  6. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/pyproject.toml +1 -1
  7. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/LICENSE +0 -0
  8. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/NOTICE +0 -0
  9. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/README.md +0 -0
  10. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/exceptions.py +0 -0
  11. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/methods/__init__.py +0 -0
  12. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/methods/iot/__init__.typed +0 -0
  13. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/methods/iot/certificate.typed +0 -0
  14. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/methods/iot/cognito.typed +0 -0
  15. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/methods/iot/core.typed +0 -0
  16. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/session.py +0 -0
  17. {boto3_refresh_session-2.0.6 → boto3_refresh_session-2.0.7}/boto3_refresh_session/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: boto3-refresh-session
3
- Version: 2.0.6
3
+ Version: 2.0.7
4
4
  Summary: A simple Python package for refreshing the temporary security credentials in a boto3.session.Session object automatically.
5
5
  License: MIT
6
6
  Keywords: boto3,botocore,aws,sts,ecs,credentials,token,refresh
@@ -4,7 +4,7 @@ from .methods.sts import STSRefreshableSession
4
4
  from .session import RefreshableSession
5
5
 
6
6
  __all__ = ["RefreshableSession"]
7
- __version__ = "2.0.6"
7
+ __version__ = "2.0.7"
8
8
  __title__ = "boto3-refresh-session"
9
9
  __author__ = "Mike Letts"
10
10
  __maintainer__ = "Mike Letts"
@@ -66,16 +66,16 @@ class CustomRefreshableSession(BaseRefreshableSession, registry_key="custom"):
66
66
  defer_refresh: bool | None = None,
67
67
  **kwargs,
68
68
  ):
69
- self.defer_refresh = defer_refresh is not False
70
- self.refresh_method: RefreshMethod = "custom"
71
69
  super().__init__(**kwargs)
72
-
70
+ self.defer_refresh: bool = defer_refresh is not False
71
+ self.refresh_method: RefreshMethod = "custom"
73
72
  self._custom_get_credentials = custom_credentials_method
74
73
  self._custom_get_credentials_args = (
75
74
  custom_credentials_method_args
76
75
  if custom_credentials_method_args is not None
77
76
  else {}
78
77
  )
78
+ self.__post_init__()
79
79
 
80
80
  def _get_credentials(self) -> TemporaryCredentials:
81
81
  credentials: TemporaryCredentials = self._custom_get_credentials(
@@ -35,13 +35,13 @@ class ECSRefreshableSession(BaseRefreshableSession, registry_key="ecs"):
35
35
  """
36
36
 
37
37
  def __init__(self, defer_refresh: bool | None = None, **kwargs):
38
+ super().__init__(**kwargs)
38
39
  self.defer_refresh: bool = defer_refresh is not False
39
40
  self.refresh_method: RefreshMethod = "ecs-container-metadata"
40
- super().__init__(**kwargs) # mounting refreshable credentials
41
-
42
41
  self._endpoint = self._resolve_endpoint()
43
42
  self._headers = self._build_headers()
44
43
  self._http = self._init_http_session()
44
+ self.__post_init__()
45
45
 
46
46
  def _resolve_endpoint(self) -> str:
47
47
  uri = os.environ.get(_ECS_CREDENTIALS_FULL_URI) or os.environ.get(
@@ -47,10 +47,9 @@ class STSRefreshableSession(BaseRefreshableSession, registry_key="sts"):
47
47
  sts_client_kwargs: STSClientParams | None = None,
48
48
  **kwargs,
49
49
  ):
50
+ super().__init__(**kwargs)
50
51
  self.defer_refresh: bool = defer_refresh is not False
51
52
  self.refresh_method: RefreshMethod = "sts-assume-role"
52
- super().__init__(**kwargs) # mounting refreshable credentials
53
-
54
53
  self.assume_role_kwargs = assume_role_kwargs
55
54
 
56
55
  if sts_client_kwargs is not None:
@@ -67,6 +66,8 @@ class STSRefreshableSession(BaseRefreshableSession, registry_key="sts"):
67
66
  else:
68
67
  self._sts_client = self.client(service_name="sts")
69
68
 
69
+ self.__post_init__()
70
+
70
71
  def _get_credentials(self) -> TemporaryCredentials:
71
72
  temporary_credentials = self._sts_client.assume_role(
72
73
  **self.assume_role_kwargs
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "boto3-refresh-session"
3
- version = "2.0.6"
3
+ version = "2.0.7"
4
4
  description = "A simple Python package for refreshing the temporary security credentials in a boto3.session.Session object automatically."
5
5
  authors = [
6
6
  {name = "Mike Letts",email = "lettsmt@gmail.com"}