Skip to content

Commit 1dda9f7

Browse files
[major] Dropping the boto3_refresh_session.ecs module (#78)
* [major] Deprecating ecs module Currently, automatic credential refresh is handled already by ECS / boto. The intended purpose of the ECS module was for local testing or to accommodate bespoke endpoints by modulating the constants in `ecs.py`. However, it is far easier for users to instead use `custom.py`. This makes sense. Users with complicated authentication flows are more likely to find value from the custom module. This also reduces the overall complexity of boto3-refresh-session, which is attractive for users. Hence, I have decided to drop the ECS module, as it appears superfluous when the custom module does what users want far better and simpler. * readme update
1 parent 9336b1e commit 1dda9f7

File tree

14 files changed

+12
-253
lines changed

14 files changed

+12
-253
lines changed

README.md

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,11 @@
9595
## 😛 Features
9696

9797
- Drop-in replacement for `boto3.session.Session`
98-
- Supports automatic credential refresh methods for various AWS services:
99-
- STS
100-
- ECS
101-
- Supports custom authentication methods for complicated authentication flows
98+
- Supports automatic credential refresh methods for STS
99+
- Supports custom authentication methods with automatic refresh for complicated authentication flows
102100
- Natively supports all parameters supported by `boto3.session.Session`
103101
- [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/)
104-
- Future releases will include support for IoT (coming soon), EC2, and SSO
102+
- Future releases will include support for IoT (coming soon)
105103

106104
## ⚠️ Important Updates
107105

@@ -113,6 +111,10 @@ Advanced users, however, particularly those using low-level objects such as `Bas
113111

114112
Please review [this PR](https://github.com/michaelthomasletts/boto3-refresh-session/pull/75) for additional details.
115113

114+
#### ✂️ v4.0.0
115+
116+
The `ecs` module has been dropped. For additional details and rationale, please review [this PR](https://github.com/michaelthomasletts/boto3-refresh-session/pull/78).
117+
116118
#### ☎️ Delayed Responses
117119

118120
I am currently grappling with a very serious medical condition. Accordingly, expect delayed responses to issues and requests until my health stabilizes.
@@ -146,7 +148,7 @@ pip install boto3-refresh-session
146148

147149
To use the `boto3.client` or `boto3.resource` interface, but with the benefits of `boto3-refresh-session`, you have a few options!
148150

149-
In the following examples, let's assume you want to use STS for retrieving temporary credentials for the sake of simplicity. Let's also focus specifically on `client`. Switching to `resource` follows the same exact idioms as below, except that `client` must be switched to `resource` in the pseudo-code, obviously. If you are not sure how to use `RefreshableSession` for STS (or ECS or custom auth flows) then check the usage instructions in the following sections!
151+
In the following examples, let's assume you want to use STS for retrieving temporary credentials for the sake of simplicity. Let's also focus specifically on `client`. Switching to `resource` follows the same exact idioms as below, except that `client` must be switched to `resource` in the pseudo-code, obviously. If you are not sure how to use `RefreshableSession` for STS (or custom auth flows) then check the usage instructions in the following sections!
150152

151153
##### `RefreshableSession.client` (Recommended)
152154

@@ -244,24 +246,6 @@ pip install boto3-refresh-session
244246

245247
</details>
246248

247-
<details>
248-
<summary><strong>ECS (click to expand)</strong></summary>
249-
250-
### ECS
251-
252-
You can use boto3-refresh-session in an ECS container to automatically refresh temporary security credentials. For additional information on the exact parameters that `RefreshableSession` takes for ECS, [check this documentation](https://github.com/michaelthomasletts/boto3-refresh-session/blob/main/boto3_refresh_session/methods/ecs.py).
253-
254-
```python
255-
session = RefreshableSession(
256-
method="ecs",
257-
region_name=region_name,
258-
profile_name=profile_name,
259-
...
260-
)
261-
```
262-
263-
</details>
264-
265249
<details>
266250
<summary><strong>Custom Authentication Flows (click to expand)</strong></summary>
267251

boto3_refresh_session/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from . import exceptions, session
44
from .exceptions import *
55
from .methods.custom import *
6-
from .methods.ecs import *
76
from .methods.sts import *
87
from .session import *
98

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
__all__ = []
22

33
# TODO: import iot submodules when finished
4-
from . import custom, ecs, sts
4+
from . import custom, sts
55
from .custom import CustomRefreshableSession
6-
from .ecs import ECSRefreshableSession
76
from .sts import STSRefreshableSession
87

98
# TODO: add iot submodules to __all__ when finished
109
__all__.extend(custom.__all__)
11-
__all__.extend(ecs.__all__)
1210
__all__.extend(sts.__all__)

boto3_refresh_session/methods/ecs.py

Lines changed: 0 additions & 115 deletions
This file was deleted.

boto3_refresh_session/session.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class RefreshableSession:
3737
--------
3838
boto3_refresh_session.methods.custom.CustomRefreshableSession
3939
boto3_refresh_session.methods.sts.STSRefreshableSession
40-
boto3_refresh_session.methods.ecs.ECSRefreshableSession
4140
"""
4241

4342
def __new__(
@@ -60,7 +59,7 @@ def get_available_methods(cls) -> list[str]:
6059
-------
6160
list[str]
6261
A list of all currently available credential refresh methods,
63-
e.g. 'sts', 'ecs', 'custom'.
62+
e.g. 'sts', 'custom'.
6463
"""
6564

6665
args = list(get_args(Method))

boto3_refresh_session/utils/typing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@
3838
#: Type alias for all currently available credential refresh methods.
3939
Method = Literal[
4040
"sts",
41-
"ecs",
4241
"custom",
4342
"__sentinel__",
4443
] # TODO: Add iot when implemented
4544

4645
#: Type alias for all refresh method names.
4746
RefreshMethod = Literal[
4847
"sts-assume-role",
49-
"ecs-container-metadata",
5048
"custom",
5149
] # TODO: Add iot-certificate and iot-cognito when iot implemented
5250

doc/modules/ecs.rst

Lines changed: 0 additions & 48 deletions
This file was deleted.

doc/modules/generated/boto3_refresh_session.methods.ecs.ECSRefreshableSession.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

doc/modules/index.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ boto3-refresh-session includes multiple modules, grouped into two categories:
1818
session
1919
custom
2020
sts
21-
ecs
2221

2322
Core interface
2423
--------------
@@ -28,7 +27,7 @@ The :class:`boto3_refresh_session.session.RefreshableSession` class provides a u
2827

2928
.. tip::
3029

31-
For most users, STS is sufficient — there’s no need to manually specify the ``method`` parameter unless using advanced strategies like ECS.
30+
For most users, STS is sufficient — there’s no need to manually specify the ``method`` parameter unless using advanced strategies like ``custom``.
3231
All users should, however, familiarize themselves with the documentation in the Refresh strategies in order to understand required and optional parameters and available methods.
3332

3433
- :ref:`session` — Factory interface for creating refreshable boto3 sessions
@@ -49,7 +48,6 @@ Each strategy supported by boto3-refresh-session is encapsulated in its own modu
4948

5049
- :ref:`custom` - Refresh strategy using a custom credential refresh strategy
5150
- :ref:`sts` — Refresh strategy using :class:`STS.Client`
52-
- :ref:`ecs` - Refresh strategy using AWS ECS container metadata
5351

5452
Exceptions and Warnings
5553
-----------------------

doc/modules/session.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Examples
2525

2626
.. seealso::
2727
:class:`boto3_refresh_session.methods.custom.CustomRefreshableSession`
28-
:class:`boto3_refresh_session.methods.ecs.ECSRefreshableSession`
2928
:class:`boto3_refresh_session.methods.sts.STSRefreshableSession`
3029

3130
Factory interface

0 commit comments

Comments
 (0)