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.
@@ -4,7 +4,7 @@ from .session import RefreshableSession
4
4
  from .sts import STSRefreshableSession
5
5
 
6
6
  __all__ = ["RefreshableSession"]
7
- __version__ = "1.3.19"
7
+ __version__ = "1.3.21"
8
8
  __title__ = "boto3-refresh-session"
9
9
  __author__ = "Mike Letts"
10
10
  __maintainer__ = "Mike Letts"
@@ -96,8 +96,7 @@ class ECSRefreshableSession(BaseRefreshableSession, method="ecs"):
96
96
  "expiry_time": credentials.get("Expiration"), # already ISO8601
97
97
  }
98
98
 
99
- @staticmethod
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.19
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://pypistats.org/packages/boto3-refresh-session">
60
- <img src="https://img.shields.io/badge/downloads-73.4K-red?logo=python&color=%23FF0000&label=Downloads" alt="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, Adoption, and Testimonials
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 (STS)
115
+ ## Usage
116
116
 
117
- 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.
117
+ <details>
118
+ <summary><strong>STS (click to expand)</strong></summary>
118
119
 
119
- ```python
120
- import boto3_refresh_session as brs
120
+ ### STS
121
121
 
122
- # you can pass all of the params normally associated with boto3.session.Session
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
- # as well as all of the params associated with STS.Client.assume_role
128
- assume_role_kwargs = {
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
- # as well as all of the params associated with STS.Client, except for 'service_name'
136
- sts_client_kwargs = {
137
- "region_name": region_name,
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
- ## Usage (ECS)
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
- You can use boto3-refresh-session in an ECS container to automatically refresh temporary security credentials.
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
- ```python
156
- session = RefreshableSession(
157
- method="ecs",
158
- region_name=region_name,
159
- profile_name=profile_name,
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
- ## Usage (Custom)
156
+ </details>
165
157
 
166
- 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.
158
+ <details>
159
+ <summary><strong>ECS (click to expand)</strong></summary>
167
160
 
168
- ```python
169
- # create (or import) your custom credential method
170
- def your_custom_credential_getter(...):
171
- ...
172
- return {
173
- "access_key": ...,
174
- "secret_key": ...,
175
- "token": ...,
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,,