boto3-refresh-session 1.3.19__tar.gz → 1.3.20__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.
@@ -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.20
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>
@@ -32,8 +32,8 @@
32
32
  <img src="https://img.shields.io/github/stars/michaelthomasletts/boto3-refresh-session?style=flat&logo=github&labelColor=555&color=FF0000&label=Stars" alt="Stars"/>
33
33
  </a>
34
34
 
35
- <a href="https://pypistats.org/packages/boto3-refresh-session">
36
- <img src="https://img.shields.io/badge/downloads-73.4K-red?logo=python&color=%23FF0000&label=Downloads" alt="Downloads"/>
35
+ <a href="https://pepy.tech/projects/boto3-refresh-session">
36
+ <img src="https://img.shields.io/badge/downloads-76.2K-red?logo=python&color=%23FF0000&label=Downloads" alt="Downloads"/>
37
37
  </a>
38
38
 
39
39
  <a href="https://michaelthomasletts.github.io/boto3-refresh-session/index.html">
@@ -70,7 +70,7 @@
70
70
  - [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/)
71
71
  - Future releases will include support for EC2, IoT, SSO, and OIDC
72
72
 
73
- ## Recognition, Adoption, and Testimonials
73
+ ## Recognition and Testimonials
74
74
 
75
75
  [Featured in TL;DR Sec.](https://tldrsec.com/p/tldr-sec-282)
76
76
 
@@ -88,77 +88,94 @@ A testimonial from a Cyber Security Engineer at a FAANG company:
88
88
  pip install boto3-refresh-session
89
89
  ```
90
90
 
91
- ## Usage (STS)
91
+ ## Usage
92
92
 
93
- 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.
93
+ <details>
94
+ <summary><strong>STS (click to expand)</strong></summary>
94
95
 
95
- ```python
96
- import boto3_refresh_session as brs
96
+ ### STS
97
97
 
98
- # you can pass all of the params normally associated with boto3.session.Session
99
- profile_name = "<your-profile-name>"
100
- region_name = "us-east-1"
101
- ...
98
+ 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.
102
99
 
103
- # as well as all of the params associated with STS.Client.assume_role
104
- assume_role_kwargs = {
105
- "RoleArn": "<your-role-arn>",
106
- "RoleSessionName": "<your-role-session-name>",
107
- "DurationSeconds": "<your-selection>",
108
- ...
109
- }
100
+ ```python
101
+ import boto3_refresh_session as brs
110
102
 
111
- # as well as all of the params associated with STS.Client, except for 'service_name'
112
- sts_client_kwargs = {
113
- "region_name": region_name,
114
- ...
115
- }
116
-
117
- # basic initialization of boto3.session.Session
118
- session = brs.RefreshableSession(
119
- assume_role_kwargs=assume_role_kwargs, # required
120
- sts_client_kwargs=sts_client_kwargs,
121
- region_name=region_name,
122
- profile_name=profile_name,
103
+ # you can pass all of the params normally associated with boto3.session.Session
104
+ profile_name = "<your-profile-name>"
105
+ region_name = "us-east-1"
123
106
  ...
124
- )
125
- ```
126
107
 
127
- ## Usage (ECS)
108
+ # as well as all of the params associated with STS.Client.assume_role
109
+ assume_role_kwargs = {
110
+ "RoleArn": "<your-role-arn>",
111
+ "RoleSessionName": "<your-role-session-name>",
112
+ "DurationSeconds": "<your-selection>",
113
+ ...
114
+ }
128
115
 
129
- You can use boto3-refresh-session in an ECS container to automatically refresh temporary security credentials.
116
+ # as well as all of the params associated with STS.Client, except for 'service_name'
117
+ sts_client_kwargs = {
118
+ "region_name": region_name,
119
+ ...
120
+ }
130
121
 
131
- ```python
132
- session = RefreshableSession(
133
- method="ecs",
134
- region_name=region_name,
135
- profile_name=profile_name,
136
- ...
137
- )
138
- ```
122
+ # basic initialization of boto3.session.Session
123
+ session = brs.RefreshableSession(
124
+ assume_role_kwargs=assume_role_kwargs, # required
125
+ sts_client_kwargs=sts_client_kwargs,
126
+ region_name=region_name,
127
+ profile_name=profile_name,
128
+ ...
129
+ )
130
+ ```
139
131
 
140
- ## Usage (Custom)
132
+ </details>
141
133
 
142
- 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.
134
+ <details>
135
+ <summary><strong>ECS (click to expand)</strong></summary>
143
136
 
144
- ```python
145
- # create (or import) your custom credential method
146
- def your_custom_credential_getter(...):
147
- ...
148
- return {
149
- "access_key": ...,
150
- "secret_key": ...,
151
- "token": ...,
152
- "expiry_time": ...,
153
- }
154
-
155
- # and pass it to RefreshableSession
156
- session = RefreshableSession(
157
- method="custom",
158
- custom_credentials_method=your_custom_credential_getter,
159
- custom_credentials_method_args=...,
160
- region_name=region_name,
137
+ ### ECS
138
+
139
+ You can use boto3-refresh-session in an ECS container to automatically refresh temporary security credentials.
140
+
141
+ ```python
142
+ session = RefreshableSession(
143
+ method="ecs",
144
+ region_name=region_name,
161
145
  profile_name=profile_name,
162
146
  ...
163
- )
164
- ```
147
+ )
148
+ ```
149
+
150
+ </details>
151
+
152
+ <details>
153
+ <summary><strong>Custom authentication flows (click to expand)</strong></summary>
154
+
155
+ ### Custom
156
+
157
+ 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
+
159
+ ```python
160
+ # create (or import) your custom credential method
161
+ def your_custom_credential_getter(...):
162
+ ...
163
+ return {
164
+ "access_key": ...,
165
+ "secret_key": ...,
166
+ "token": ...,
167
+ "expiry_time": ...,
168
+ }
169
+
170
+ # and pass it to RefreshableSession
171
+ session = RefreshableSession(
172
+ method="custom",
173
+ custom_credentials_method=your_custom_credential_getter,
174
+ custom_credentials_method_args=...,
175
+ region_name=region_name,
176
+ profile_name=profile_name,
177
+ ...
178
+ )
179
+ ```
180
+
181
+ </details>
@@ -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.20"
8
8
  __title__ = "boto3-refresh-session"
9
9
  __author__ = "Mike Letts"
10
10
  __maintainer__ = "Mike Letts"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "boto3-refresh-session"
3
- version = "1.3.19"
3
+ version = "1.3.20"
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"}