boto3-refresh-session 1.3.18__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.
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/PKG-INFO +81 -68
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/README.md +80 -67
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/boto3_refresh_session/__init__.py +1 -1
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/pyproject.toml +1 -1
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/LICENSE +0 -0
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/NOTICE +0 -0
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/boto3_refresh_session/custom.py +0 -0
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/boto3_refresh_session/ecs.py +0 -0
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/boto3_refresh_session/exceptions.py +0 -0
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/boto3_refresh_session/session.py +0 -0
- {boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/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.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,14 +56,10 @@ 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
|
-
<a href="https://pypistats.org/packages/boto3-refresh-session">
|
64
|
-
<img src="https://img.shields.io/badge/downloads-18.1K-red?logo=python&color=%23FF0000&label=Downloads%20%28without%20mirrors%29" alt="Downloads without mirrors"/>
|
65
|
-
</a>
|
66
|
-
|
67
63
|
<a href="https://michaelthomasletts.github.io/boto3-refresh-session/index.html">
|
68
64
|
<img src="https://img.shields.io/badge/Official%20Documentation-📘-FF0000?style=flat&labelColor=555&logo=readthedocs" alt="Documentation Badge"/>
|
69
65
|
</a>
|
@@ -98,7 +94,7 @@ Description-Content-Type: text/markdown
|
|
98
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/)
|
99
95
|
- Future releases will include support for EC2, IoT, SSO, and OIDC
|
100
96
|
|
101
|
-
## Recognition
|
97
|
+
## Recognition and Testimonials
|
102
98
|
|
103
99
|
[Featured in TL;DR Sec.](https://tldrsec.com/p/tldr-sec-282)
|
104
100
|
|
@@ -116,77 +112,94 @@ A testimonial from a Cyber Security Engineer at a FAANG company:
|
|
116
112
|
pip install boto3-refresh-session
|
117
113
|
```
|
118
114
|
|
119
|
-
## Usage
|
115
|
+
## Usage
|
120
116
|
|
121
|
-
|
117
|
+
<details>
|
118
|
+
<summary><strong>STS (click to expand)</strong></summary>
|
122
119
|
|
123
|
-
|
124
|
-
import boto3_refresh_session as brs
|
120
|
+
### STS
|
125
121
|
|
126
|
-
|
127
|
-
profile_name = "<your-profile-name>"
|
128
|
-
region_name = "us-east-1"
|
129
|
-
...
|
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.
|
130
123
|
|
131
|
-
|
132
|
-
|
133
|
-
"RoleArn": "<your-role-arn>",
|
134
|
-
"RoleSessionName": "<your-role-session-name>",
|
135
|
-
"DurationSeconds": "<your-selection>",
|
136
|
-
...
|
137
|
-
}
|
124
|
+
```python
|
125
|
+
import boto3_refresh_session as brs
|
138
126
|
|
139
|
-
#
|
140
|
-
|
141
|
-
|
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"
|
142
130
|
...
|
143
|
-
}
|
144
|
-
|
145
|
-
# basic initialization of boto3.session.Session
|
146
|
-
session = brs.RefreshableSession(
|
147
|
-
assume_role_kwargs=assume_role_kwargs, # required
|
148
|
-
sts_client_kwargs=sts_client_kwargs,
|
149
|
-
region_name=region_name,
|
150
|
-
profile_name=profile_name,
|
151
|
-
...
|
152
|
-
)
|
153
|
-
```
|
154
131
|
|
155
|
-
|
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
|
+
}
|
156
139
|
|
157
|
-
|
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
|
+
}
|
158
145
|
|
159
|
-
|
160
|
-
session = RefreshableSession(
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
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
|
+
```
|
167
155
|
|
168
|
-
|
156
|
+
</details>
|
169
157
|
|
170
|
-
|
158
|
+
<details>
|
159
|
+
<summary><strong>ECS (click to expand)</strong></summary>
|
171
160
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
"expiry_time": ...,
|
181
|
-
}
|
182
|
-
|
183
|
-
# and pass it to RefreshableSession
|
184
|
-
session = RefreshableSession(
|
185
|
-
method="custom",
|
186
|
-
custom_credentials_method=your_custom_credential_getter,
|
187
|
-
custom_credentials_method_args=...,
|
188
|
-
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,
|
189
169
|
profile_name=profile_name,
|
190
170
|
...
|
191
|
-
)
|
192
|
-
```
|
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,14 +32,10 @@
|
|
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://
|
36
|
-
<img src="https://img.shields.io/badge/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
|
-
<a href="https://pypistats.org/packages/boto3-refresh-session">
|
40
|
-
<img src="https://img.shields.io/badge/downloads-18.1K-red?logo=python&color=%23FF0000&label=Downloads%20%28without%20mirrors%29" alt="Downloads without mirrors"/>
|
41
|
-
</a>
|
42
|
-
|
43
39
|
<a href="https://michaelthomasletts.github.io/boto3-refresh-session/index.html">
|
44
40
|
<img src="https://img.shields.io/badge/Official%20Documentation-📘-FF0000?style=flat&labelColor=555&logo=readthedocs" alt="Documentation Badge"/>
|
45
41
|
</a>
|
@@ -74,7 +70,7 @@
|
|
74
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/)
|
75
71
|
- Future releases will include support for EC2, IoT, SSO, and OIDC
|
76
72
|
|
77
|
-
## Recognition
|
73
|
+
## Recognition and Testimonials
|
78
74
|
|
79
75
|
[Featured in TL;DR Sec.](https://tldrsec.com/p/tldr-sec-282)
|
80
76
|
|
@@ -92,77 +88,94 @@ A testimonial from a Cyber Security Engineer at a FAANG company:
|
|
92
88
|
pip install boto3-refresh-session
|
93
89
|
```
|
94
90
|
|
95
|
-
## Usage
|
91
|
+
## Usage
|
96
92
|
|
97
|
-
|
93
|
+
<details>
|
94
|
+
<summary><strong>STS (click to expand)</strong></summary>
|
98
95
|
|
99
|
-
|
100
|
-
import boto3_refresh_session as brs
|
96
|
+
### STS
|
101
97
|
|
102
|
-
|
103
|
-
profile_name = "<your-profile-name>"
|
104
|
-
region_name = "us-east-1"
|
105
|
-
...
|
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.
|
106
99
|
|
107
|
-
|
108
|
-
|
109
|
-
"RoleArn": "<your-role-arn>",
|
110
|
-
"RoleSessionName": "<your-role-session-name>",
|
111
|
-
"DurationSeconds": "<your-selection>",
|
112
|
-
...
|
113
|
-
}
|
100
|
+
```python
|
101
|
+
import boto3_refresh_session as brs
|
114
102
|
|
115
|
-
#
|
116
|
-
|
117
|
-
|
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"
|
118
106
|
...
|
119
|
-
}
|
120
|
-
|
121
|
-
# basic initialization of boto3.session.Session
|
122
|
-
session = brs.RefreshableSession(
|
123
|
-
assume_role_kwargs=assume_role_kwargs, # required
|
124
|
-
sts_client_kwargs=sts_client_kwargs,
|
125
|
-
region_name=region_name,
|
126
|
-
profile_name=profile_name,
|
127
|
-
...
|
128
|
-
)
|
129
|
-
```
|
130
107
|
|
131
|
-
|
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
|
+
}
|
132
115
|
|
133
|
-
|
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
|
+
}
|
134
121
|
|
135
|
-
|
136
|
-
session = RefreshableSession(
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
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
|
+
```
|
143
131
|
|
144
|
-
|
132
|
+
</details>
|
145
133
|
|
146
|
-
|
134
|
+
<details>
|
135
|
+
<summary><strong>ECS (click to expand)</strong></summary>
|
147
136
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
"expiry_time": ...,
|
157
|
-
}
|
158
|
-
|
159
|
-
# and pass it to RefreshableSession
|
160
|
-
session = RefreshableSession(
|
161
|
-
method="custom",
|
162
|
-
custom_credentials_method=your_custom_credential_getter,
|
163
|
-
custom_credentials_method_args=...,
|
164
|
-
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,
|
165
145
|
profile_name=profile_name,
|
166
146
|
...
|
167
|
-
)
|
168
|
-
```
|
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>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "boto3-refresh-session"
|
3
|
-
version = "1.3.
|
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"}
|
File without changes
|
File without changes
|
{boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/boto3_refresh_session/custom.py
RENAMED
File without changes
|
File without changes
|
{boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/boto3_refresh_session/exceptions.py
RENAMED
File without changes
|
{boto3_refresh_session-1.3.18 → boto3_refresh_session-1.3.20}/boto3_refresh_session/session.py
RENAMED
File without changes
|
File without changes
|