class_docstr: Driver for fetching credentials that are stored in memory in file-like objects.
class_docstr_tok: ["Driver","for","fetching","credentials","that","are","stored","in","memory","in","file-like","objects","."]
docstr: Saves the credentials into a temporary spool.
  
  Args:
      descriptor (str): Descriptor of the current Output
      credentials (Credentials): Credentials object that is intended to be saved
  
  Return:
      bool: True on success, False otherwise
docstr_tok: ["Saves","the","credentials","into","a","temporary","spool",".","Args",":","descriptor","(","str",")",":","Descriptor","of","the","current","Output","credentials","(","Credentials",")",":","Credentials","object","that","is","intended","to","be","saved","Return",":","bool",":","True","on","success",",","False","otherwise"]
code: def save_credentials(self, descriptor, credentials):
      """Saves the credentials into a temporary spool.
  
      Args:
          descriptor (str): Descriptor of the current Output
          credentials (Credentials): Credentials object that is intended to be saved
  
      Return:
          bool: True on success, False otherwise
      """
      # Always store unencrypted because it's in memory. Saves calls to KMS and it's safe
      # because other unrelated processes cannot read this memory (probably..)
      if not credentials.is_encrypted():
          LOGGER.error(
              "Error: Writing unencrypted credentials to disk is disallowed."
          )
          return False
  
      raw_creds = credentials.data()
      if not isinstance(raw_creds, bytes):
          raw_creds = raw_creds.encode()
  
      spool = tempfile.SpooledTemporaryFile()
      spool.write(raw_creds)
  
      key = self.get_spool_cache_key(descriptor)
      type(self).SERVICE_SPOOLS[key] = spool
  
      return True
  
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 4 for calling the SpooledTempfileDriver obj's underlying member method code with example usage: obj.save_credentials(descriptor, credentials) and returns: True, False