Skip to content

Commit a4c045a

Browse files
added qanda
1 parent fd86514 commit a4c045a

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

doc/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:hidden:
99

1010
Raison d'Être <raison>
11+
Q&A <qanda>
1112
Installation <installation>
1213
Usage <usage>
1314
API Reference <reference/index>
@@ -20,7 +21,8 @@ boto3-refresh-session
2021
**Version:** |release|
2122

2223
**Useful Links:**
23-
:ref:`Raison d'Être <raison>` |
24+
:ref:`Raison d'Être <raison>` |
25+
:ref:`Q&A <qanda>` |
2426
:ref:`Installation <installation>` |
2527
:ref:`Usage <usage>` |
2628
:ref:`API Reference <reference>` |

doc/qanda.rst

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.. _qanda:
2+
3+
Q&A
4+
---
5+
6+
Answers to some common questions (and criticisms).
7+
8+
Doesn't boto3 already refresh temporary credentials?
9+
====================================================
10+
11+
**No.**
12+
13+
Botocore has methods for *manually* refreshing temporary credentials.
14+
Those methods are explicitly used in this package.
15+
However, those methods, as just mentioned, must be applied *manually*.
16+
There is no way of *automatically* refreshing temporary credentials.
17+
This can be frustrating in some situations.
18+
The boto3 developers have consistently decided not to introduce automatically refreshing temporary credentials.
19+
This is a conspicuously odd decision since `in aws-sdk-go-v2 <https://github.com/aws/aws-sdk-go-v2/blob/8e8487a51e9eb22a101c49cc61b98ca8990c1322/aws/credential_cache.go#L57>`_ allows it . . .
20+
BRS was released to address this shortcoming specifically.
21+
22+
Is this package really necessary?
23+
=================================
24+
25+
As mentioned above, it is possible to refresh temporary credentials *manually*, but not everyone feels like doing that.
26+
It is far easier to import an actively supported package which addresses that problem.
27+
28+
How are people using BRS?
29+
=========================
30+
31+
Below is a testimonial from a Cyber Security Engineer at a FAANG company who uses BRS:
32+
33+
*"Most of my work is on tooling related to AWS security, so I'm pretty choosy about boto3 credentials-adjacent code.
34+
I often opt to just write this sort of thing myself so I at least know that I can reason about it.
35+
But I found boto3-refresh-session to be very clean and intuitive . . .
36+
We're using the RefreshableSession class as part of a client cache construct . . .
37+
We're using AWS Lambda to perform lots of operations across several regions in hundreds of accounts, over and over again, all day every day.
38+
And it turns out that there's a surprising amount of overhead to creating boto3 clients (mostly deserializing service definition json),
39+
so we can run MUCH more efficiently if we keep a cache of clients, all equipped with automatically refreshing sessions."*
40+
41+
Why aren't many of the parameters for initializing :class:`boto3_refresh_session.session.RefreshableSession` included as attributes?
42+
====================================================================================================================================
43+
44+
Good question.
45+
46+
BRS was developed to be as simple and intuitive as possible.
47+
Parameters like ``defer_refresh`` and ``assume_role_kwargs``, et al are not part of ``boto3`` so add clutter.
48+
Functionally, those parameters are also only useful when initializing :class:`boto3_refresh_session.session.RefreshableSession`.
49+
Thus, it was decided *not* to include those parameters as attributes.
50+
51+
Can I submit a request to change BRS? I'd like a few things to be different.
52+
============================================================================
53+
54+
It depends.
55+
56+
If you want *additional* features, like a CLI tool, then there is a good chance that your request will be added.
57+
58+
*However*, if your requested changes are *highly idiosyncratic* or *redactive* -- that is, not generalizable to as many use cases as possible -- then it is suggested that you fork BRS, make your changes, and use those locally instead.
59+
The above user testimonial came from a team who lightly edited BRS in order to satisfy certain requirements that they intuitively understood did not apply to all users.
60+
Do what that team did.
61+
The MIT license for BRS makes changes and forks completely permissible.
62+
BRS has thousands of users.
63+
Breaking changes have massive implications.
64+
65+
Before submitting a request, ask yourself: *does my request behoove all users, or just me . . . ?*

doc/raison.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Usually, engineers deal with that problem one of two ways:
1313
- A similar approach as that used in this project -- that is, using methods available
1414
within ``botocore`` for refreshing temporary credentials automatically.
1515

16-
Speaking personally, variations of the code found herein exists in code bases at
16+
Speaking personally, variations of the code found in this package exists in code bases at
1717
nearly every company where I have worked. Sometimes, I turned that code into a module;
1818
other times, I wrote it from scratch. Clearly, that is inefficient.
1919

2020
I decided to finally turn that code into a proper Python package with unit testing,
2121
automatic documentation, and quality checks; the idea being that, henceforth, depending
2222
on my employer's open source policy, I may simply import this package instead of
23-
reproducing the code herein for the Nth time.
23+
reproducing this code for the Nth time.
2424

2525
If any of that sounds relatable, then ``boto3-refresh-session`` should help you.

0 commit comments

Comments
 (0)