boto3-refresh-session 1.3.6__tar.gz → 1.3.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.
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/PKG-INFO +2 -2
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/README.md +1 -1
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/boto3_refresh_session/__init__.py +1 -1
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/boto3_refresh_session/custom.py +19 -7
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/pyproject.toml +1 -1
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/LICENSE +0 -0
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/NOTICE +0 -0
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/boto3_refresh_session/ecs.py +0 -0
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/boto3_refresh_session/exceptions.py +0 -0
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/boto3_refresh_session/session.py +0 -0
- {boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/boto3_refresh_session/sts.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: boto3-refresh-session
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.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
|
@@ -170,7 +170,7 @@ def your_custom_credential_getter(...):
|
|
170
170
|
session = RefreshableSession(
|
171
171
|
method="custom",
|
172
172
|
custom_credentials_method=your_custom_credential_getter,
|
173
|
-
|
173
|
+
custom_credentials_method_args=...,
|
174
174
|
region_name=region_name,
|
175
175
|
profile_name=profile_name,
|
176
176
|
...
|
@@ -147,7 +147,7 @@ def your_custom_credential_getter(...):
|
|
147
147
|
session = RefreshableSession(
|
148
148
|
method="custom",
|
149
149
|
custom_credentials_method=your_custom_credential_getter,
|
150
|
-
|
150
|
+
custom_credentials_method_args=...,
|
151
151
|
region_name=region_name,
|
152
152
|
profile_name=profile_name,
|
153
153
|
...
|
@@ -4,6 +4,7 @@ __all__ = ["CustomRefreshableSession"]
|
|
4
4
|
|
5
5
|
from typing import Any, Callable
|
6
6
|
|
7
|
+
from .exceptions import BRSError
|
7
8
|
from .session import BaseRefreshableSession
|
8
9
|
|
9
10
|
|
@@ -50,7 +51,7 @@ class CustomRefreshableSession(BaseRefreshableSession, method="custom"):
|
|
50
51
|
>>> sess = RefreshableSession(
|
51
52
|
>>> method='custom',
|
52
53
|
>>> custom_credentials_method=your_custom_credential_getter,
|
53
|
-
>>>
|
54
|
+
>>> custom_credentials_method_args=...,
|
54
55
|
>>> )
|
55
56
|
"""
|
56
57
|
|
@@ -77,11 +78,20 @@ class CustomRefreshableSession(BaseRefreshableSession, method="custom"):
|
|
77
78
|
)
|
78
79
|
|
79
80
|
def _get_credentials(self) -> dict[str, str]:
|
80
|
-
|
81
|
+
credentials = self._custom_get_credentials(
|
81
82
|
**self._custom_get_credentials_args
|
82
83
|
)
|
84
|
+
required_keys = {"access_key", "secret_key", "token", "expiry_time"}
|
83
85
|
|
84
|
-
|
86
|
+
if missing := required_keys - credentials.keys():
|
87
|
+
raise BRSError(
|
88
|
+
f"The dict returned by custom_credentials_method is missing these key-value pairs: "
|
89
|
+
f"{', '.join(repr(param) for param in missing)}. "
|
90
|
+
)
|
91
|
+
|
92
|
+
return credentials
|
93
|
+
|
94
|
+
def get_identity(self) -> dict[str, str]:
|
85
95
|
"""Returns metadata about the custom credential getter.
|
86
96
|
|
87
97
|
Returns
|
@@ -90,7 +100,9 @@ class CustomRefreshableSession(BaseRefreshableSession, method="custom"):
|
|
90
100
|
Dict containing information about the custom credential getter.
|
91
101
|
"""
|
92
102
|
|
93
|
-
|
94
|
-
|
95
|
-
"
|
96
|
-
|
103
|
+
source = getattr(
|
104
|
+
self._custom_get_credentials,
|
105
|
+
"__name__",
|
106
|
+
repr(self._custom_get_credentials),
|
107
|
+
)
|
108
|
+
return {"method": "custom", "source": repr(source)}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "boto3-refresh-session"
|
3
|
-
version = "1.3.
|
3
|
+
version = "1.3.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"}
|
File without changes
|
File without changes
|
File without changes
|
{boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/boto3_refresh_session/exceptions.py
RENAMED
File without changes
|
{boto3_refresh_session-1.3.6 → boto3_refresh_session-1.3.7}/boto3_refresh_session/session.py
RENAMED
File without changes
|
File without changes
|