oktaawscli/aws_auth.py
def write_sts_token(self, access_key_id, secret_access_key, session_token):
        """ Writes STS auth information to credentials file """
        if not os.path.exists(self.creds_dir):
            os.makedirs(self.creds_dir)
        config = RawConfigParser()

        if os.path.isfile(self.creds_file):
            config.read(self.creds_file)

        if not config.has_section(self.profile):
            config.add_section(self.profile)

        config.set(self.profile, 'aws_access_key_id', access_key_id)
        config.set(self.profile, 'aws_secret_access_key', secret_access_key)
        config.set(self.profile, 'aws_session_token', session_token)

        with open(self.creds_file, 'w+') as configfile:
            config.write(configfile)
        self.logger.info("Temporary credentials written to profile: %s" % self.profile)
        self.logger.info("Invoke using: aws --profile %s <service> <command>" % self.profile)
 Writes STS auth information to credentials file 
Writes STS auth information to credentials file
Writes STS auth information to credentials file
def write_sts_token(self, access_key_id, secret_access_key, session_token):
        if not os.path.exists(self.creds_dir):
            os.makedirs(self.creds_dir)
        config = RawConfigParser()
        if os.path.isfile(self.creds_file):
            config.read(self.creds_file)
        if not config.has_section(self.profile):
            config.add_section(self.profile)
        config.set(self.profile, 'aws_access_key_id', access_key_id)
        config.set(self.profile, 'aws_secret_access_key', secret_access_key)
        config.set(self.profile, 'aws_session_token', session_token)
        with open(self.creds_file, 'w+') as configfile:
            config.write(configfile)
        self.logger.info("Temporary credentials written to profile: %s" % self.profile)
        self.logger.info("Invoke using: aws --profile %s <service> <command>" % self.profile)
def write_sts_token ( self , access_key_id , secret_access_key , session_token ) : if not os . path . exists ( self . creds_dir ) : os . makedirs ( self . creds_dir ) config = RawConfigParser ( ) if os . path . isfile ( self . creds_file ) : config . read ( self . creds_file ) if not config . has_section ( self . profile ) : config . add_section ( self . profile ) config . set ( self . profile , 'aws_access_key_id' , access_key_id ) config . set ( self . profile , 'aws_secret_access_key' , secret_access_key ) config . set ( self . profile , 'aws_session_token' , session_token ) with open ( self . creds_file , 'w+' ) as configfile : config . write ( configfile ) self . logger . info ( "Temporary credentials written to profile: %s" % self . profile ) self . logger . info ( "Invoke using: aws --profile %s <service> <command>" % self . profile )
Writes STS auth information to credentials file
Writes STS auth information to credentials file
""" Writes STS auth information to credentials file """
self
access_key_id
secret_access_key
session_token