<s> """<STR_LIT>""" <EOL> from os import path <EOL> from cloudcafe . cloudkeep . barbican . secrets . behaviors import SecretsBehaviors <EOL> from cloudcafe . cloudkeep . common . responses import CloudkeepResponse <EOL> class ClientLibSecretsBehaviors ( SecretsBehaviors ) : <EOL> def __init__ ( self , cl_client , barb_client , config ) : <EOL> super ( ClientLibSecretsBehaviors , self ) . __init__ ( client = barb_client , <EOL> config = config ) <EOL> self . barb_client = barb_client <EOL> self . cl_client = cl_client <EOL> self . config = config <EOL> def create_and_check_secret ( self , name = None , expiration = None , <EOL> algorithm = None , bit_length = None , <EOL> mode = None , payload = None , <EOL> payload_content_type = None ) : <EOL> secret = self . create_secret_overriding_cfg ( <EOL> name = name , expiration = expiration , algorithm = algorithm , <EOL> bit_length = bit_length , mode = mode , <EOL> payload = payload , payload_content_type = payload_content_type ) <EOL> secret_id = path . split ( secret ) [ - <NUM_LIT:1> ] <EOL> resp = self . barb_client . get_secret ( secret_id ) <EOL> behavior_response = CloudkeepResponse ( entity = secret , <EOL> get_resp = resp ) <EOL> return behavior_response <EOL> def create_secret ( self , name = None , expiration = None , algorithm = None , <EOL> bit_length = None , mode = None , payload = None , <EOL> payload_content_type = None , <EOL> payload_content_encoding = None ) : <EOL> secret = self . cl_client . create_secret ( <EOL> name = name , <EOL> expiration = expiration , <EOL> algorithm = algorithm , <EOL> bit_length = bit_length , <EOL> mode = mode , <EOL> payload = payload , <EOL> payload_content_type = payload_content_type , <EOL> payload_content_encoding = payload_content_encoding ) <EOL> self . created_secrets . append ( secret ) <EOL> return secret <EOL> def delete_secret ( self , secret_ref ) : <EOL> self . remove_from_created_secrets ( secret_id = secret_ref ) <EOL> resp = self . cl_client . delete_secret ( href = secret_ref ) <EOL> return resp <EOL> def delete_all_created_secrets ( self ) : <EOL> for secret_id in self . created_secrets : <EOL> self . delete_secret ( secret_ref = secret_id ) <EOL> self . created_secrets = [ ] </s>
