Skip to content

Commit

Permalink
Merge pull request #59 from phil-hachey/master
Browse files Browse the repository at this point in the history
Updated Configuration to be a new-style class
  • Loading branch information
stevemac007 committed Feb 22, 2018
2 parents 4b05f45 + 569d690 commit dd583c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.eggs/
*.pyc
dist
build/
11 changes: 6 additions & 5 deletions aws_google_auth/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from . import amazon


class Configuration:
class Configuration(object):

def __init__(self, **kwargs):
self.options = {}
Expand Down Expand Up @@ -69,16 +69,17 @@ def ensure_config_files_exist(self):
# Will return a SAML cache, ONLY if it's valid. If invalid or not set, will
# return None. If the SAML cache isn't valid, we'll remove it from the
# in-memory object. On the next write(), it will be purged from disk.
def saml_cache_reader(self):
@property
def saml_cache(self):
if not amazon.Amazon.is_valid_saml_assertion(self.__saml_cache):
self.__saml_cache = None

return self.__saml_cache

def saml_cache_writer(self, value):
@saml_cache.setter
def saml_cache(self, value):
self.__saml_cache = value

saml_cache = property(saml_cache_reader, saml_cache_writer)

# Will raise exceptions if the configuration is invalid, otherwise returns
# None. Use this at any point to validate the configuration is in a good
# state. There are no checks here regarding SAML caching, as that's just a
Expand Down

0 comments on commit dd583c6

Please sign in to comment.