class_docstr: Loads credentials that are housed on AWS SSM, or cached locally.
  
  Helper service to OutputDispatcher.
  
  OutputDispatcher implementations may require credentials to authenticate with an external
  gateway. All credentials for OutputDispatchers are to be stored in a single parameter in AWS SSM
  and are encrypted with AWS KMS. When alerts are dispatched via OutputDispatchers, these
  encrypted credentials are downloaded and cached locally on the filesystem. Then, AWS KMS is
  used to decrypt the credentials when in use.
  
  Public methods:
      load_credentials: Returns a dict of the credentials requested
      get_local_credentials_temp_dir(): Returns full path to a temporary directory where all
          encrypted credentials are cached.
class_docstr_tok: ["Loads","credentials","that","are","housed","on","AWS","SSM",",","or","cached","locally",".","Helper","service","to","OutputDispatcher",".","OutputDispatcher","implementations","may","require","credentials","to","authenticate","with","an","external","gateway",".","All","credentials","for","OutputDispatchers","are","to","be","stored","in","a","single","parameter","in","AWS","SSM","and","are","encrypted","with","AWS","KMS",".","When","alerts","are","dispatched","via","OutputDispatchers",",","these","encrypted","credentials","are","downloaded","and","cached","locally","on","the","filesystem",".","Then",",","AWS","KMS","is","used","to","decrypt","the","credentials","when","in","use",".","Public","methods",":","load_credentials",":","Returns","a","dict","of","the","credentials","requested","get_local_credentials_temp_dir","(",")",":","Returns","full","path","to","a","temporary","directory","where","all","encrypted","credentials","are","cached","."]
docstr: Loads credentials from the drivers.
  
  Args:
      descriptor (str): unique identifier used to look up these credentials
  
  Returns:
      dict: the loaded credential info needed for sending alerts to this service
      or None if nothing gets loaded
docstr_tok: ["Loads","credentials","from","the","drivers",".","Args",":","descriptor","(","str",")",":","unique","identifier","used","to","look","up","these","credentials","Returns",":","dict",":","the","loaded","credential","info","needed","for","sending","alerts","to","this","service","or","None","if","nothing","gets","loaded"]
code: def load_credentials(self, descriptor):
      """Loads credentials from the drivers.
  
      Args:
          descriptor (str): unique identifier used to look up these credentials
  
      Returns:
          dict: the loaded credential info needed for sending alerts to this service
          or None if nothing gets loaded
      """
      credentials = None
      for driver in self._drivers:
          if driver.has_credentials(descriptor):
              credentials = driver.load_credentials(descriptor)
              if credentials:
                  break
  
      if not credentials:
          LOGGER.error(
              "All drivers failed to retrieve credentials for [%s.%s]",
              self._service_name,
              descriptor,
          )
          return None
      if credentials.is_encrypted():
          decrypted_creds = credentials.get_data_kms_decrypted()
      else:
          decrypted_creds = credentials.data()
  
      creds_dict = json.loads(decrypted_creds)
  
      # Add any of the hard-coded default output props to this dict (ie: url)
      defaults = self._defaults
      if defaults:
          creds_dict.update(defaults)
  
      return creds_dict
  
imports: import json
  import os
  import shutil
  import tempfile
  from abc import abstractmethod
  from botocore.exceptions import ClientError
  from streamalert.shared.helpers.aws_api_client import AwsKms, AwsSsm
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 6 for calling the OutputCredentialsProvider obj's underlying member method code with example usage: obj.load_credentials(descriptor) and returns: creds_dict, None