Skip to content

Commit

Permalink
Added liquibase.secureParsing test
Browse files Browse the repository at this point in the history
  • Loading branch information
nvoxland committed Feb 4, 2022
1 parent 8d90124 commit 33d9d92
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -23,7 +23,7 @@ class XMLChangeLogSAXParserTest extends Specification {

def INSECURE_XML = """
<!DOCTYPE databaseChangeLog [
<!ENTITY insecure SYSTEM "https://localhost/insecure">
<!ENTITY insecure SYSTEM "file://invalid.txt">
]>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
Expand Down Expand Up @@ -83,7 +83,7 @@ class XMLChangeLogSAXParserTest extends Specification {

then:
def e = thrown(ChangeLogParseException)
e.message.contains("Failed to read external document 'insecure'")
e.message.contains("access is not allowed due to restriction set by the accessExternalDTD property")
}

def "allows liquibase.secureParsing=false to disable secure parsing"() {
Expand All @@ -97,7 +97,7 @@ class XMLChangeLogSAXParserTest extends Specification {

then:
def e = thrown(ChangeLogParseException)
e.message.contains("Connection refused")
e.message.contains("Error Reading Changelog File: invalid.txt")
}

}

0 comments on commit 33d9d92

Please sign in to comment.