boto3-refresh-session 0.0.20__tar.gz → 0.0.22__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {boto3_refresh_session-0.0.20 → boto3_refresh_session-0.0.22}/PKG-INFO +3 -3
- {boto3_refresh_session-0.0.20 → boto3_refresh_session-0.0.22}/README.md +2 -2
- {boto3_refresh_session-0.0.20 → boto3_refresh_session-0.0.22}/boto3_refresh_session/session.py +11 -17
- {boto3_refresh_session-0.0.20 → boto3_refresh_session-0.0.22}/pyproject.toml +1 -1
- {boto3_refresh_session-0.0.20 → boto3_refresh_session-0.0.22}/LICENSE +0 -0
- {boto3_refresh_session-0.0.20 → boto3_refresh_session-0.0.22}/boto3_refresh_session/__init__.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: boto3-refresh-session
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.22
|
4
4
|
Summary: A simple Python package for refreshing boto3 sessions automatically.
|
5
5
|
Home-page: https://github.com/michaelthomasletts/boto3-refresh-session
|
6
6
|
License: MIT
|
@@ -74,10 +74,10 @@ credentials. To learn more about how `boto3` searches for credentials on a
|
|
74
74
|
machine, check [this documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html).
|
75
75
|
|
76
76
|
```python
|
77
|
-
|
77
|
+
import boto3_refresh_session as brs
|
78
78
|
|
79
79
|
|
80
|
-
sess = AutoRefreshableSession(
|
80
|
+
sess = brs.AutoRefreshableSession(
|
81
81
|
region="<your-region>",
|
82
82
|
role_arn="<your-role-arn>",
|
83
83
|
session_name="<your-session-name>",
|
@@ -49,10 +49,10 @@ credentials. To learn more about how `boto3` searches for credentials on a
|
|
49
49
|
machine, check [this documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html).
|
50
50
|
|
51
51
|
```python
|
52
|
-
|
52
|
+
import boto3_refresh_session as brs
|
53
53
|
|
54
54
|
|
55
|
-
sess = AutoRefreshableSession(
|
55
|
+
sess = brs.AutoRefreshableSession(
|
56
56
|
region="<your-region>",
|
57
57
|
role_arn="<your-role-arn>",
|
58
58
|
session_name="<your-session-name>",
|
{boto3_refresh_session-0.0.20 → boto3_refresh_session-0.0.22}/boto3_refresh_session/session.py
RENAMED
@@ -1,12 +1,12 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
|
3
3
|
__doc__ = """
|
4
|
-
Helper method for generating an automatically refreshing
|
4
|
+
Helper method for generating an automatically refreshing :class:`boto3.session.Session`
|
5
5
|
object.
|
6
6
|
|
7
7
|
.. warning::
|
8
8
|
``AutoRefreshableSession`` was not tested for manually passing hard-coded
|
9
|
-
account credentials to the
|
9
|
+
account credentials to the :class:`boto3.session.Session` or ``boto3.client``
|
10
10
|
objects! There are optional ``session_kwargs`` and ``client_kwargs``
|
11
11
|
parameters available for passing hard-coded account credentials, which
|
12
12
|
should work; however, that cannot be guaranteed! In any case, the ``boto3``
|
@@ -29,14 +29,11 @@ from botocore.session import get_session
|
|
29
29
|
|
30
30
|
@define
|
31
31
|
class AutoRefreshableSession:
|
32
|
-
"""Returns a
|
32
|
+
"""Returns a :class:`boto3.session.Session` object which refreshes automatically, no extra
|
33
33
|
steps required.
|
34
34
|
|
35
35
|
This object is useful for long-running processes where temporary credentials
|
36
|
-
may expire
|
37
|
-
|
38
|
-
To use this class, you must have ``~/.aws/config`` or ``~/.aws/credentials``
|
39
|
-
configured on your machine.
|
36
|
+
may expire.
|
40
37
|
|
41
38
|
Parameters
|
42
39
|
----------
|
@@ -49,29 +46,26 @@ class AutoRefreshableSession:
|
|
49
46
|
ttl : int, optional
|
50
47
|
Number of seconds until temporary credentials expire, default 900.
|
51
48
|
session_kwargs : dict, optional
|
52
|
-
Optional keyword arguments for
|
49
|
+
Optional keyword arguments for :class:`boto3.session.Session`.
|
53
50
|
client_kwargs : dict, optional
|
54
|
-
Optional keyword arguments for ``boto3.
|
51
|
+
Optional keyword arguments for ``boto3.client``.
|
55
52
|
|
56
53
|
Attributes
|
57
54
|
----------
|
58
55
|
session
|
59
|
-
Returns a
|
56
|
+
Returns a :class:`boto3.session.Session` object with credentials which refresh
|
60
57
|
automatically.
|
61
58
|
|
62
59
|
Notes
|
63
60
|
-----
|
64
|
-
|
65
|
-
|
66
|
-
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html
|
67
|
-
|
68
|
-
This class assumes that ``~/.aws`` exists with ``/config`` or ``/credentials``!
|
61
|
+
Check the :ref:`authorization documentation <authorization>` for additional
|
62
|
+
information concerning how to authorize access to AWS.
|
69
63
|
|
70
64
|
Examples
|
71
65
|
--------
|
72
|
-
Here's how to initialize
|
66
|
+
Here's how to initialize this object:
|
73
67
|
|
74
|
-
>>> sess = AutoRefreshableSession(
|
68
|
+
>>> sess = brs.AutoRefreshableSession(
|
75
69
|
>>> region="us-east-1",
|
76
70
|
>>> role_arn="<your-arn>",
|
77
71
|
>>> session_name="test",
|
File without changes
|
{boto3_refresh_session-0.0.20 → boto3_refresh_session-0.0.22}/boto3_refresh_session/__init__.py
RENAMED
File without changes
|