class_docstr: Security configuration for a Dask cluster.
  
  Default values are loaded from Dask's configuration files, and can be
  overridden in the constructor.
  
  Parameters
  ----------
  require_encryption : bool, optional
      Whether TLS encryption is required for all connections.
  tls_ca_file : str, optional
      Path to a CA certificate file encoded in PEM format.
  tls_ciphers : str, optional
      An OpenSSL cipher string of allowed ciphers. If not provided, the
      system defaults will be used.
  tls_min_version : ssl.TLSVersion, optional
      The minimum TLS version to support. Defaults to TLS 1.2.
  tls_max_version : ssl.TLSVersion, optional
      The maximum TLS version to support. Defaults to the maximum version
      supported.
  tls_client_cert : str, optional
      Path to a certificate file for the client, encoded in PEM format.
  tls_client_key : str, optional
      Path to a key file for the client, encoded in PEM format.
      Alternatively, the key may be appended to the cert file, and this
      parameter be omitted.
  tls_scheduler_cert : str, optional
      Path to a certificate file for the scheduler, encoded in PEM format.
  tls_scheduler_key : str, optional
      Path to a key file for the scheduler, encoded in PEM format.
      Alternatively, the key may be appended to the cert file, and this
      parameter be omitted.
  tls_worker_cert : str, optional
      Path to a certificate file for a worker, encoded in PEM format.
  tls_worker_key : str, optional
      Path to a key file for a worker, encoded in PEM format.
      Alternatively, the key may be appended to the cert file, and this
      parameter be omitted.
  extra_conn_args : mapping, optional
      Mapping with keyword arguments to pass down to connections.
class_docstr_tok: ["Security","configuration","for","a","Dask","cluster",".","Default","values","are","loaded","from","Dask","'s","configuration","files",",","and","can","be","overridden","in","the","constructor",".","Parameters","--","--","--","--","--","require_encryption",":","bool",",","optional","Whether","TLS","encryption","is","required","for","all","connections",".","tls_ca_file",":","str",",","optional","Path","to","a","CA","certificate","file","encoded","in","PEM","format",".","tls_ciphers",":","str",",","optional","An","OpenSSL","cipher","string","of","allowed","ciphers",".","If","not","provided",",","the","system","defaults","will","be","used",".","tls_min_version",":","ssl.TLSVersion",",","optional","The","minimum","TLS","version","to","support",".","Defaults","to","TLS","1.2.","tls_max_version",":","ssl.TLSVersion",",","optional","The","maximum","TLS","version","to","support",".","Defaults","to","the","maximum","version","supported",".","tls_client_cert",":","str",",","optional","Path","to","a","certificate","file","for","the","client",",","encoded","in","PEM","format",".","tls_client_key",":","str",",","optional","Path","to","a","key","file","for","the","client",",","encoded","in","PEM","format",".","Alternatively",",","the","key","may","be","appended","to","the","cert","file",",","and","this","parameter","be","omitted",".","tls_scheduler_cert",":","str",",","optional","Path","to","a","certificate","file","for","the","scheduler",",","encoded","in","PEM","format",".","tls_scheduler_key",":","str",",","optional","Path","to","a","key","file","for","the","scheduler",",","encoded","in","PEM","format",".","Alternatively",",","the","key","may","be","appended","to","the","cert","file",",","and","this","parameter","be","omitted",".","tls_worker_cert",":","str",",","optional","Path","to","a","certificate","file","for","a","worker",",","encoded","in","PEM","format",".","tls_worker_key",":","str",",","optional","Path","to","a","key","file","for","a","worker",",","encoded","in","PEM","format",".","Alternatively",",","the","key","may","be","appended","to","the","cert","file",",","and","this","parameter","be","omitted",".","extra_conn_args",":","mapping",",","optional","Mapping","with","keyword","arguments","to","pass","down","to","connections","."]
docstr: Return the TLS configuration for the given role, as a flat dict.
docstr_tok: ["Return","the","TLS","configuration","for","the","given","role",",","as","a","flat","dict","."]
code: def get_tls_config_for_role(self, role):
      """
      Return the TLS configuration for the given role, as a flat dict.
      """
      if role not in {"client", "scheduler", "worker"}:
          raise ValueError(f"unknown role {role!r}")
      return {
          "ca_file": self.tls_ca_file,
          "ciphers": self.tls_ciphers,
          "cert": getattr(self, "tls_%s_cert" % role),
          "key": getattr(self, "tls_%s_key" % role),
      }
  
imports: from __future__ import annotations
  import datetime
  import os
  import ssl
  import sys
  import tempfile
  import warnings
  import dask
  from dask.widgets import get_template
label_desc: Use image node_id 8 for calling the Security obj's underlying member method code with example usage: obj.get_tls_config_for_role(role) and returns: dict