Skip to content

BRS is preparing for the addition of new refresh methods!

Compare
Choose a tag to compare
@michaelthomasletts michaelthomasletts released this 10 Jun 01:58
· 134 commits to main since this release

A user recently asked if I have any intention of adding SSO as a possible refresh method to boto3-refresh-session.

That question made me realize that boto3-refresh-session was not in a great condition to accept multiple refresh methods. The RefreshableSession object was exclusive to STS. I realized that RefreshableSession needed to be generalized and that new objects needed to be created per refresh method. Crucially, I realized that those updates would need to be non-invasive so as not to disrupt existing users who are, it's safe to say, happy to be using STS. I also realized that those updates needed to be designed in such a way that, in the future, I can focus less on architecture and more on researching the best way to package a refresh pattern for a particular AWS service and deliver that update to users ASAP.

To that end, I released the following updates this evening:

  • A BaseRefreshableSession object was added into session.py
    • This puts all boto3 Session relevant logic in one single place
  • An sts module containing an STSRefreshableSession object
    • This is a pattern that I plan to continue: as new refresh methods are introduced to BRS, they will be placed in a separate module -- named after the AWS service that they are related to
  • RefreshableSession was refactored to initialize STSRefreshableSession (and any future object that is introduced) using a non-invasive "method" argument
  • Added two helper methods to aide users: get_identity and get_available_methods. The former is intuitive. The latter lists all refresh methods available in STS -- for anyone too hurried to check the documentation

I plan on introducing IoT to BRS soon using this project for inspiration.

As for SSO -- honestly, that one will require a little more thought and care.

To everyone who starred this project, reached out to me, mentioned or featured it in your work, or simply uses BRS -- thank you!