def FormatSecurityOptions(security_option, field, type_context, edge_config):
    sections = []
    if security_option.configure_for_untrusted_downstream:
        sections.append(Indent(4, 'This field should be configured in the presence of untrusted *downstreams*.'))
    if security_option.configure_for_untrusted_upstream:
        sections.append(Indent(4, 'This field should be configured in the presence of untrusted *upstreams*.'))
    if edge_config.note:
        sections.append(Indent(4, edge_config.note))
    example_dict = json_format.MessageToDict(edge_config.example)
    validate_fragment.ValidateFragment(field.type_name[1:], example_dict)
    field_name = type_context.name.split('.')[(- 1)]
    example = {field_name: example_dict}
    sections.append(((Indent(4, 'Example configuration for untrusted environments:\n\n') + Indent(4, '.. code-block:: yaml\n\n')) + '\n'.join(IndentLines(6, yaml.dump(example).split('\n')))))
    return ('.. attention::\n' + '\n\n'.join(sections))
def FormatSecurityOptions(security_option, field, type_context, edge_config):
    sections = []
    if security_option.configure_for_untrusted_downstream:
        sections.append(Indent(4, 'This field should be configured in the presence of untrusted *downstreams*.'))
    if security_option.configure_for_untrusted_upstream:
        sections.append(Indent(4, 'This field should be configured in the presence of untrusted *upstreams*.'))
    if edge_config.note:
        sections.append(Indent(4, edge_config.note))
    example_dict = json_format.MessageToDict(edge_config.example)
    validate_fragment.ValidateFragment(field.type_name[1:], example_dict)
    field_name = type_context.name.split('.')[(- 1)]
    example = {field_name: example_dict}
    sections.append(((Indent(4, 'Example configuration for untrusted environments:\n\n') + Indent(4, '.. code-block:: yaml\n\n')) + '\n'.join(IndentLines(6, yaml.dump(example).split('\n')))))
    return ('.. attention::\n' + '\n\n'.join(sections))