(c, config)
Set auth related configuration from YAML config file.

    As an example, this function should update the following TLJH auth
    configuration:

    ```yaml
    auth:
      type: oauthenticator.github.GitHubOAuthenticator
      GitHubOAuthenticator:
        client_id: "..."
        client_secret: "..."
        oauth_callback_url: "..."
      ArbitraryClass:
        arbitrary_key: "..."
        arbitrary_key_with_none_value:
    ```

    by applying the following configuration:

    ```python
    c.JupyterHub.authenticator_class = "oauthenticator.github.GitHubOAuthenticator"
    c.GitHubOAuthenticator.client_id = "..."
    c.GitHubOAuthenticator.client_secret = "..."
    c.GitHubOAuthenticator.oauth_callback_url = "..."
    c.ArbitraryClass.arbitrary_key = "..."
    ```

    Note that "auth.type" and "auth.ArbitraryClass.arbitrary_key_with_none_value"
    are treated a bit differently. auth.type will always map to
    c.JupyterHub.authenticator_class and any configured value being None won't
    be set.
Set auth related configuration from YAML config file.
Set auth related configuration from YAML config file .
def update_auth(c, config):
    """
    Set auth related configuration from YAML config file.

    As an example, this function should update the following TLJH auth
    configuration:

    ```yaml
    auth:
      type: oauthenticator.github.GitHubOAuthenticator
      GitHubOAuthenticator:
        client_id: "..."
        client_secret: "..."
        oauth_callback_url: "..."
      ArbitraryClass:
        arbitrary_key: "..."
        arbitrary_key_with_none_value:
    ```

    by applying the following configuration:

    ```python
    c.JupyterHub.authenticator_class = "oauthenticator.github.GitHubOAuthenticator"
    c.GitHubOAuthenticator.client_id = "..."
    c.GitHubOAuthenticator.client_secret = "..."
    c.GitHubOAuthenticator.oauth_callback_url = "..."
    c.ArbitraryClass.arbitrary_key = "..."
    ```

    Note that "auth.type" and "auth.ArbitraryClass.arbitrary_key_with_none_value"
    are treated a bit differently. auth.type will always map to
    c.JupyterHub.authenticator_class and any configured value being None won't
    be set.
    """
    tljh_auth_config = config["auth"]

    c.JupyterHub.authenticator_class = tljh_auth_config["type"]

    for auth_key, auth_value in tljh_auth_config.items():
        if not (auth_key[0] == auth_key[0].upper() and isinstance(auth_value, dict)):
            if auth_key == "type":
                continue
            raise ValueError(
                f"Error: auth.{auth_key} was ignored, it didn't look like a valid configuration"
            )
        class_name = auth_key
        class_config_to_set = auth_value
        class_config = c[class_name]
        for config_name, config_value in class_config_to_set.items():
            set_if_not_none(class_config, config_name, config_value)
def update_auth ( c , config ) : tljh_auth_config = config [ "auth" ] c . JupyterHub . authenticator_class = tljh_auth_config [ "type" ] for auth_key , auth_value in tljh_auth_config . items ( ) : if not ( auth_key [ 0 ] == auth_key [ 0 ] . upper ( ) and isinstance ( auth_value , dict ) ) : if auth_key == "type" : continue raise ValueError ( f"Error: auth.{auth_key} was ignored, it didn't look like a valid configuration" ) class_name = auth_key class_config_to_set = auth_value class_config = c [ class_name ] for config_name , config_value in class_config_to_set . items ( ) : set_if_not_none ( class_config , config_name , config_value )