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.
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/PKG-INFO +81 -64
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/README.md +80 -63
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/boto3_refresh_session/__init__.py +1 -1
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/pyproject.toml +1 -1
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/LICENSE +0 -0
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/NOTICE +0 -0
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/boto3_refresh_session/custom.py +0 -0
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/boto3_refresh_session/ecs.py +0 -0
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/boto3_refresh_session/exceptions.py +0 -0
- {boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/boto3_refresh_session/session.py +0 -0
- {boto3_refresh_session-1.3.19 → 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,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>
|
@@ -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://
|
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
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
|
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
|
91
|
+
## Usage
|
92
92
|
|
93
|
-
|
93
|
+
<details>
|
94
|
+
<summary><strong>STS (click to expand)</strong></summary>
|
94
95
|
|
95
|
-
|
96
|
-
import boto3_refresh_session as brs
|
96
|
+
### STS
|
97
97
|
|
98
|
-
|
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
|
-
|
104
|
-
|
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
|
-
#
|
112
|
-
|
113
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
132
|
-
session = RefreshableSession(
|
133
|
-
|
134
|
-
|
135
|
-
|
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
|
-
|
132
|
+
</details>
|
141
133
|
|
142
|
-
|
134
|
+
<details>
|
135
|
+
<summary><strong>ECS (click to expand)</strong></summary>
|
143
136
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
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>
|
@@ -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.19 → boto3_refresh_session-1.3.20}/boto3_refresh_session/custom.py
RENAMED
File without changes
|
File without changes
|
{boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/boto3_refresh_session/exceptions.py
RENAMED
File without changes
|
{boto3_refresh_session-1.3.19 → boto3_refresh_session-1.3.20}/boto3_refresh_session/session.py
RENAMED
File without changes
|
File without changes
|