boto3-refresh-session 5.1.4__py3-none-any.whl → 5.1.5__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-5.1.4.dist-info → boto3_refresh_session-5.1.5.dist-info}/METADATA +31 -14
- {boto3_refresh_session-5.1.4.dist-info → boto3_refresh_session-5.1.5.dist-info}/RECORD +6 -6
- {boto3_refresh_session-5.1.4.dist-info → boto3_refresh_session-5.1.5.dist-info}/LICENSE +0 -0
- {boto3_refresh_session-5.1.4.dist-info → boto3_refresh_session-5.1.5.dist-info}/NOTICE +0 -0
- {boto3_refresh_session-5.1.4.dist-info → boto3_refresh_session-5.1.5.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: boto3-refresh-session
|
3
|
-
Version: 5.1.
|
3
|
+
Version: 5.1.5
|
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,credentials,token,refresh,iot,x509,mqtt
|
@@ -152,6 +152,23 @@ pip install boto3-refresh-session
|
|
152
152
|
|
153
153
|
## 📝 Usage
|
154
154
|
|
155
|
+
<details>
|
156
|
+
<summary><strong>Core Concepts (click to expand)</strong></summary>
|
157
|
+
|
158
|
+
### Core Concepts
|
159
|
+
|
160
|
+
1. `RefreshableSession` is the intended interface for using `boto3-refresh-session`. Whether you're using this package to refresh temporary credentials returned by STS, the IoT credential provider (which is really just STS, but I digress), or some custom authentication or credential provider, `RefreshableSession` is where you *ought to* be working when using `boto3-refresh-session`.
|
161
|
+
|
162
|
+
2. *You can use all of the same keyword parameters normally associated with `boto3.session.Session`!* For instance, suppose you want to pass `region_name` to `RefreshableSession` as a parameter, whereby it's passed to `boto3.session.Session`. That's perfectly fine! Just pass it like you normally would when initializing `boto3.session.Session`. These keyword parameters are *completely optional*, though. If you're confused, the main idea to remember is this: if initializing `boto3.session.Session` *requires* a particular keyword parameter then pass it to `RefreshableSession`; if not, don't worry about it.
|
163
|
+
|
164
|
+
3. To tell `RefreshableSession` which AWS service you're working with for authentication and credential retrieval purposes (STS vs. IoT vs. some custom credential provider), you'll need to pass a `method` parameter to `RefreshableSession`. Since the `service_name` namespace is already occupied by `boto3.sesssion.Session`, [`boto3-refresh-session` uses `method` instead of "service" so as to avoid confusion](https://github.com/michaelthomasletts/boto3-refresh-session/blob/04acb2adb34e505c4dc95711f6b2f97748a2a489/boto3_refresh_session/utils/typing.py#L40). If you're using `RefreshableSession` for STS, however, then `method` is set to `"sts"` by default. You don't need to pass the `method` keyword argument in that case.
|
165
|
+
|
166
|
+
4. Using `RefreshableSession` for STS, IoT, or custom flows requires different keyword parameters that are unique to those particular methods. For instance, `STSRefreshableSession`, which is the engine for STS in `boto3-refresh-session`, requires `assume_role_kwargs` and optionally allows `sts_client_kwargs` whereas `CustomRefreshableSession` and `IoTX509RefreshableSession` do not. To familiarize yourself with the keyword parameters for each method, check the documentation for each of those engines [in the Refresh Strategies section here](https://michaelthomasletts.com/boto3-refresh-session/modules/index.html).
|
167
|
+
|
168
|
+
5. Irrespective of whatever `method` you pass as a keyword parameter, `RefreshableSession` accepts a keyword parameter named `defer_refresh`. Basically, this boolean tells `boto3-refresh-session` either to refresh credentials *the moment they expire* or to *wait until credentials are explicitly needed*. If you are working in a low-latency environment then `defer_refresh = False` might be helpful. For most users, however, `defer_refresh = True` is most desirable. For that reason, `defer_refresh = True` is the default value. Most users, therefore, should not concern themselves too much with this feature.
|
169
|
+
|
170
|
+
</details>
|
171
|
+
|
155
172
|
<details>
|
156
173
|
<summary><strong>Clients and Resources (click to expand)</strong></summary>
|
157
174
|
|
@@ -228,12 +245,12 @@ pip install boto3-refresh-session
|
|
228
245
|
```python
|
229
246
|
import boto3_refresh_session as brs
|
230
247
|
|
231
|
-
# you can pass all of the params normally associated with boto3.session.Session
|
248
|
+
# OPTIONAL - you can pass all of the params normally associated with boto3.session.Session
|
232
249
|
profile_name = "<your-profile-name>"
|
233
250
|
region_name = "us-east-1"
|
234
251
|
...
|
235
252
|
|
236
|
-
# as well as all of the params associated with STS.Client.assume_role
|
253
|
+
# REQUIRED - as well as all of the params associated with STS.Client.assume_role
|
237
254
|
assume_role_kwargs = {
|
238
255
|
"RoleArn": "<your-role-arn>",
|
239
256
|
"RoleSessionName": "<your-role-session-name>",
|
@@ -241,7 +258,7 @@ pip install boto3-refresh-session
|
|
241
258
|
...
|
242
259
|
}
|
243
260
|
|
244
|
-
# as well as all of the params associated with STS.Client, except for 'service_name'
|
261
|
+
# OPTIONAL - as well as all of the params associated with STS.Client, except for 'service_name'
|
245
262
|
sts_client_kwargs = {
|
246
263
|
"region_name": region_name,
|
247
264
|
...
|
@@ -250,10 +267,10 @@ pip install boto3-refresh-session
|
|
250
267
|
# basic initialization of boto3.session.Session
|
251
268
|
session = brs.RefreshableSession(
|
252
269
|
assume_role_kwargs=assume_role_kwargs, # required
|
253
|
-
sts_client_kwargs=sts_client_kwargs,
|
254
|
-
region_name=region_name,
|
255
|
-
profile_name=profile_name,
|
256
|
-
...
|
270
|
+
sts_client_kwargs=sts_client_kwargs, # optional
|
271
|
+
region_name=region_name, # optional
|
272
|
+
profile_name=profile_name, # optional
|
273
|
+
... # misc. params for boto3.session.Session
|
257
274
|
)
|
258
275
|
```
|
259
276
|
|
@@ -279,12 +296,12 @@ pip install boto3-refresh-session
|
|
279
296
|
|
280
297
|
# and pass it to RefreshableSession
|
281
298
|
session = RefreshableSession(
|
282
|
-
method="custom",
|
283
|
-
custom_credentials_method=your_custom_credential_getter,
|
284
|
-
custom_credentials_method_args=...,
|
285
|
-
region_name=region_name,
|
286
|
-
profile_name=profile_name,
|
287
|
-
...
|
299
|
+
method="custom", # required
|
300
|
+
custom_credentials_method=your_custom_credential_getter, # required
|
301
|
+
custom_credentials_method_args=..., # optional
|
302
|
+
region_name=region_name, # optional
|
303
|
+
profile_name=profile_name, # optional
|
304
|
+
... # misc. params for boto3.session.Session
|
288
305
|
)
|
289
306
|
```
|
290
307
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
boto3_refresh_session/__init__.py,sha256=
|
1
|
+
boto3_refresh_session/__init__.py,sha256=f-YL5G2PRbTNdOXoy3iUclak-1i1OhADS-iq3UGLEi4,415
|
2
2
|
boto3_refresh_session/exceptions.py,sha256=QS5_xy3hNrfkdT_wKPZWH8WqSbFYCKPcK8DomGYIvcU,1218
|
3
3
|
boto3_refresh_session/methods/__init__.py,sha256=FpwWixSVpy_6pUe1u4fXmjO-_fDH--qTk_xrMnBCHxU,193
|
4
4
|
boto3_refresh_session/methods/custom.py,sha256=MLdUMU9s6NQoJWBKQ5Fsxeyxb_Xrm9V59pVX22M8fyI,4178
|
@@ -10,8 +10,8 @@ boto3_refresh_session/session.py,sha256=UM_dWHSo0Wn8gLN99zg36SRVb-Yy_to1wk8UgZEu
|
|
10
10
|
boto3_refresh_session/utils/__init__.py,sha256=6F2ErbgBT2ZmZwFF3OzvQEd1Vh4XM3kaL6YGMTrcrkQ,156
|
11
11
|
boto3_refresh_session/utils/internal.py,sha256=HbuIzT0pC8QS4pgNj3M7POGaW-OEz2l3ESfYI1Qouuo,7072
|
12
12
|
boto3_refresh_session/utils/typing.py,sha256=YbnVYPe-ZEr79THp78u74PzF6LOIxpf91yGsvBmhEBM,3532
|
13
|
-
boto3_refresh_session-5.1.
|
14
|
-
boto3_refresh_session-5.1.
|
15
|
-
boto3_refresh_session-5.1.
|
16
|
-
boto3_refresh_session-5.1.
|
17
|
-
boto3_refresh_session-5.1.
|
13
|
+
boto3_refresh_session-5.1.5.dist-info/LICENSE,sha256=I3ZYTXAjbIly6bm6J-TvFTuuHwTKws4h89QaY5c5HiY,1067
|
14
|
+
boto3_refresh_session-5.1.5.dist-info/METADATA,sha256=oJ4dQ_Gz-PYneAJdzmKg7q3Xd0_LjoGV0E5AkT9dukw,18607
|
15
|
+
boto3_refresh_session-5.1.5.dist-info/NOTICE,sha256=1s8r33qbl1z0YvPB942iWgvbkP94P_e8AnROr1qXXuw,939
|
16
|
+
boto3_refresh_session-5.1.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
17
|
+
boto3_refresh_session-5.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|