Interface ContentSecurityPolicyConfig


  • public interface ContentSecurityPolicyConfig
    Allows manipulating directives for ContentSecurityPolicy header in TeamCity See https://content-security-policy.com/ for some help
    Since:
    2019.1
    Author:
    kir
    • Field Detail

      • DIRECTIVE_NAMES

        static final java.util.Set<java.lang.String> DIRECTIVE_NAMES
    • Method Detail

      • addUnprotectedPath

        void addUnprotectedPath​(java.lang.String path)
        Parameters:
        path - start of the path which will be allowed to loaded in external iframes, allows embedding TeamCity pages into other sites.
      • addDirectiveItems

        void addDirectiveItems​(java.lang.String directiveName,
                               java.lang.String... values)
        Parameters:
        directiveName - related CSP directive, must be one of DIRECTIVE_NAMES
        values - include quotes when needed, like "'self'"
        Throws:
        java.lang.IllegalArgumentException - when directiveName is not valid
      • removeDirectiveItems

        void removeDirectiveItems​(java.lang.String directiveName,
                                  java.lang.String... values)
        The method allows to remove directives added via addDirectiveItems(String, String...)
        Parameters:
        directiveName - related CSP directive, must be one of DIRECTIVE_NAMES
        values - include quotes when needed, like "'self'"