boto3-refresh-session 1.3.19__py3-none-any.whl → 1.3.21__py3-none-any.whl
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/__init__.py +1 -1
- boto3_refresh_session/ecs.py +1 -2
- {boto3_refresh_session-1.3.19.dist-info → boto3_refresh_session-1.3.21.dist-info}/METADATA +81 -64
- boto3_refresh_session-1.3.21.dist-info/RECORD +11 -0
- boto3_refresh_session-1.3.19.dist-info/RECORD +0 -11
- {boto3_refresh_session-1.3.19.dist-info → boto3_refresh_session-1.3.21.dist-info}/LICENSE +0 -0
- {boto3_refresh_session-1.3.19.dist-info → boto3_refresh_session-1.3.21.dist-info}/NOTICE +0 -0
- {boto3_refresh_session-1.3.19.dist-info → boto3_refresh_session-1.3.21.dist-info}/WHEEL +0 -0
boto3_refresh_session/ecs.py
CHANGED
@@ -96,8 +96,7 @@ class ECSRefreshableSession(BaseRefreshableSession, method="ecs"):
|
|
96
96
|
"expiry_time": credentials.get("Expiration"), # already ISO8601
|
97
97
|
}
|
98
98
|
|
99
|
-
|
100
|
-
def get_identity() -> dict[str, str]:
|
99
|
+
def get_identity(self) -> dict[str, str]:
|
101
100
|
"""Returns metadata about ECS.
|
102
101
|
|
103
102
|
Returns
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: boto3-refresh-session
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.21
|
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
|
@@ -56,8 +56,8 @@ Description-Content-Type: text/markdown
|
|
56
56
|
<img src="https://img.shields.io/github/stars/michaelthomasletts/boto3-refresh-session?style=flat&logo=github&labelColor=555&color=FF0000&label=Stars" alt="Stars"/>
|
57
57
|
</a>
|
58
58
|
|
59
|
-
<a href="https://
|
60
|
-
<img src="https://img.shields.io/badge/downloads-
|
59
|
+
<a href="https://pepy.tech/projects/boto3-refresh-session">
|
60
|
+
<img src="https://img.shields.io/badge/downloads-76.2K-red?logo=python&color=%23FF0000&label=Downloads" alt="Downloads"/>
|
61
61
|
</a>
|
62
62
|
|
63
63
|
<a href="https://michaelthomasletts.github.io/boto3-refresh-session/index.html">
|
@@ -94,7 +94,7 @@ Description-Content-Type: text/markdown
|
|
94
94
|
- [Tested](https://github.com/michaelthomasletts/boto3-refresh-session/tree/main/tests), [documented](https://michaelthomasletts.github.io/boto3-refresh-session/index.html), and [published to PyPI](https://pypi.org/project/boto3-refresh-session/)
|
95
95
|
- Future releases will include support for EC2, IoT, SSO, and OIDC
|
96
96
|
|
97
|
-
## Recognition
|
97
|
+
## Recognition and Testimonials
|
98
98
|
|
99
99
|
[Featured in TL;DR Sec.](https://tldrsec.com/p/tldr-sec-282)
|
100
100
|
|
@@ -112,77 +112,94 @@ A testimonial from a Cyber Security Engineer at a FAANG company:
|
|
112
112
|
pip install boto3-refresh-session
|
113
113
|
```
|
114
114
|
|
115
|
-
## Usage
|
115
|
+
## Usage
|
116
116
|
|
117
|
-
|
117
|
+
<details>
|
118
|
+
<summary><strong>STS (click to expand)</strong></summary>
|
118
119
|
|
119
|
-
|
120
|
-
import boto3_refresh_session as brs
|
120
|
+
### STS
|
121
121
|
|
122
|
-
|
123
|
-
profile_name = "<your-profile-name>"
|
124
|
-
region_name = "us-east-1"
|
125
|
-
...
|
122
|
+
Most users use AWS STS to assume an IAM role and return a set of temporary security credentials. boto3-refresh-session can be used to ensure those temporary credentials refresh automatically.
|
126
123
|
|
127
|
-
|
128
|
-
|
129
|
-
"RoleArn": "<your-role-arn>",
|
130
|
-
"RoleSessionName": "<your-role-session-name>",
|
131
|
-
"DurationSeconds": "<your-selection>",
|
132
|
-
...
|
133
|
-
}
|
124
|
+
```python
|
125
|
+
import boto3_refresh_session as brs
|
134
126
|
|
135
|
-
#
|
136
|
-
|
137
|
-
|
138
|
-
...
|
139
|
-
}
|
140
|
-
|
141
|
-
# basic initialization of boto3.session.Session
|
142
|
-
session = brs.RefreshableSession(
|
143
|
-
assume_role_kwargs=assume_role_kwargs, # required
|
144
|
-
sts_client_kwargs=sts_client_kwargs,
|
145
|
-
region_name=region_name,
|
146
|
-
profile_name=profile_name,
|
127
|
+
# you can pass all of the params normally associated with boto3.session.Session
|
128
|
+
profile_name = "<your-profile-name>"
|
129
|
+
region_name = "us-east-1"
|
147
130
|
...
|
148
|
-
)
|
149
|
-
```
|
150
131
|
|
151
|
-
|
132
|
+
# as well as all of the params associated with STS.Client.assume_role
|
133
|
+
assume_role_kwargs = {
|
134
|
+
"RoleArn": "<your-role-arn>",
|
135
|
+
"RoleSessionName": "<your-role-session-name>",
|
136
|
+
"DurationSeconds": "<your-selection>",
|
137
|
+
...
|
138
|
+
}
|
152
139
|
|
153
|
-
|
140
|
+
# as well as all of the params associated with STS.Client, except for 'service_name'
|
141
|
+
sts_client_kwargs = {
|
142
|
+
"region_name": region_name,
|
143
|
+
...
|
144
|
+
}
|
154
145
|
|
155
|
-
|
156
|
-
session = RefreshableSession(
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
146
|
+
# basic initialization of boto3.session.Session
|
147
|
+
session = brs.RefreshableSession(
|
148
|
+
assume_role_kwargs=assume_role_kwargs, # required
|
149
|
+
sts_client_kwargs=sts_client_kwargs,
|
150
|
+
region_name=region_name,
|
151
|
+
profile_name=profile_name,
|
152
|
+
...
|
153
|
+
)
|
154
|
+
```
|
163
155
|
|
164
|
-
|
156
|
+
</details>
|
165
157
|
|
166
|
-
|
158
|
+
<details>
|
159
|
+
<summary><strong>ECS (click to expand)</strong></summary>
|
167
160
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
"expiry_time": ...,
|
177
|
-
}
|
178
|
-
|
179
|
-
# and pass it to RefreshableSession
|
180
|
-
session = RefreshableSession(
|
181
|
-
method="custom",
|
182
|
-
custom_credentials_method=your_custom_credential_getter,
|
183
|
-
custom_credentials_method_args=...,
|
184
|
-
region_name=region_name,
|
161
|
+
### ECS
|
162
|
+
|
163
|
+
You can use boto3-refresh-session in an ECS container to automatically refresh temporary security credentials.
|
164
|
+
|
165
|
+
```python
|
166
|
+
session = RefreshableSession(
|
167
|
+
method="ecs",
|
168
|
+
region_name=region_name,
|
185
169
|
profile_name=profile_name,
|
186
170
|
...
|
187
|
-
)
|
188
|
-
```
|
171
|
+
)
|
172
|
+
```
|
173
|
+
|
174
|
+
</details>
|
175
|
+
|
176
|
+
<details>
|
177
|
+
<summary><strong>Custom authentication flows (click to expand)</strong></summary>
|
178
|
+
|
179
|
+
### Custom
|
180
|
+
|
181
|
+
If you have a highly sophisticated, novel, or idiosyncratic authentication flow not included in boto3-refresh-session then you will need to provide your own custom temporary credentials callable object. `RefreshableSession` accepts custom credentials callable objects, as shown below.
|
182
|
+
|
183
|
+
```python
|
184
|
+
# create (or import) your custom credential method
|
185
|
+
def your_custom_credential_getter(...):
|
186
|
+
...
|
187
|
+
return {
|
188
|
+
"access_key": ...,
|
189
|
+
"secret_key": ...,
|
190
|
+
"token": ...,
|
191
|
+
"expiry_time": ...,
|
192
|
+
}
|
193
|
+
|
194
|
+
# and pass it to RefreshableSession
|
195
|
+
session = RefreshableSession(
|
196
|
+
method="custom",
|
197
|
+
custom_credentials_method=your_custom_credential_getter,
|
198
|
+
custom_credentials_method_args=...,
|
199
|
+
region_name=region_name,
|
200
|
+
profile_name=profile_name,
|
201
|
+
...
|
202
|
+
)
|
203
|
+
```
|
204
|
+
|
205
|
+
</details>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
boto3_refresh_session/__init__.py,sha256=0o7J4SvkJmqil8uXC1XT9HaYbu_krjnCNO67nbSqln4,364
|
2
|
+
boto3_refresh_session/custom.py,sha256=wR7122COYuFkmVprORfz-mPRqH4XeTH8Uw8_2QUYWUg,3845
|
3
|
+
boto3_refresh_session/ecs.py,sha256=npuMlooixhB7qXYACsPDRx8A2xhFTrRgcAPFZK1P9i8,3727
|
4
|
+
boto3_refresh_session/exceptions.py,sha256=qcFzdIuK5PZirs77H_Kb64S9QFb6cn2OJtirjvaRLiY,972
|
5
|
+
boto3_refresh_session/session.py,sha256=TGI3-Zv52kGigw0f-mUNBkB2nqM632gCRZgY6KhZd-A,5564
|
6
|
+
boto3_refresh_session/sts.py,sha256=f9dtJMfs5bYWfZAcKuANAe0InjmNjZfKyqt5LpHFDxk,3202
|
7
|
+
boto3_refresh_session-1.3.21.dist-info/LICENSE,sha256=I3ZYTXAjbIly6bm6J-TvFTuuHwTKws4h89QaY5c5HiY,1067
|
8
|
+
boto3_refresh_session-1.3.21.dist-info/METADATA,sha256=eYbmLVd5gpuVgDsZUK_KK6ttgONKepRbiufDgEmJJGs,8201
|
9
|
+
boto3_refresh_session-1.3.21.dist-info/NOTICE,sha256=1s8r33qbl1z0YvPB942iWgvbkP94P_e8AnROr1qXXuw,939
|
10
|
+
boto3_refresh_session-1.3.21.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
11
|
+
boto3_refresh_session-1.3.21.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
boto3_refresh_session/__init__.py,sha256=k8kjkIoiC4p9sts12tV5miDsL2F9ZKNUDj4jYIQDWl0,364
|
2
|
-
boto3_refresh_session/custom.py,sha256=wR7122COYuFkmVprORfz-mPRqH4XeTH8Uw8_2QUYWUg,3845
|
3
|
-
boto3_refresh_session/ecs.py,sha256=Php_ETJ-4E99ka93nXwpDa7vS3El7UCxfX0ptb6ofA4,3741
|
4
|
-
boto3_refresh_session/exceptions.py,sha256=qcFzdIuK5PZirs77H_Kb64S9QFb6cn2OJtirjvaRLiY,972
|
5
|
-
boto3_refresh_session/session.py,sha256=TGI3-Zv52kGigw0f-mUNBkB2nqM632gCRZgY6KhZd-A,5564
|
6
|
-
boto3_refresh_session/sts.py,sha256=f9dtJMfs5bYWfZAcKuANAe0InjmNjZfKyqt5LpHFDxk,3202
|
7
|
-
boto3_refresh_session-1.3.19.dist-info/LICENSE,sha256=I3ZYTXAjbIly6bm6J-TvFTuuHwTKws4h89QaY5c5HiY,1067
|
8
|
-
boto3_refresh_session-1.3.19.dist-info/METADATA,sha256=20lIagyN4ZyQn8G-bRXge6z8PqDG1D2EnhRDAQgdfbU,7830
|
9
|
-
boto3_refresh_session-1.3.19.dist-info/NOTICE,sha256=1s8r33qbl1z0YvPB942iWgvbkP94P_e8AnROr1qXXuw,939
|
10
|
-
boto3_refresh_session-1.3.19.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
11
|
-
boto3_refresh_session-1.3.19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|