-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[s7Ob7Zm7] Test that all load and import procedures respect security #360
Conversation
b2fcc27
to
b8ca6f4
Compare
8f4b542
to
f8bf9b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good :) I know the card specified import and load, but how hard would it be to do this style for all our export as well? then we would be super tested :D
Just a few comments otherwise!
public static void setUp() throws IOException { | ||
TestUtil.registerProcedure(db, | ||
ImportJson.class, Xml.class, ImportCsv.class, ExportGraphML.class, | ||
LoadJson.class, Xml.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Xml.class is here twice ^^
|
||
@Test | ||
public void testIllegalFSAccessWithDifferentApocConfs() { | ||
setFileApocConfigs(true, true, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a comment be added to explain which each boolean is setting so the test is easier to read as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also would help explain why not all permutations are listed here, I can't directly see why we aren't also testing:
false, false, true
true, false, true
true, true, false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I don't remember why I didn't test all permutations 😅... Anyway I've now added them all.
|
||
@Test | ||
public void testImportFileDisabled() { | ||
setFileApocConfigs(false, false, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can a comment be added to explain which each boolean is setting so the test is easier to read as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
@BeforeClass | ||
public static void setUp() throws IOException { | ||
TestUtil.registerProcedure(db, | ||
ImportJson.class, Xml.class, ImportCsv.class, ExportGraphML.class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not want arrow procedures here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange that the load graphml prcocedure is in the ExportGraphML class, maybe add a comment here as I was about to comment asking why an export procedure class was loaded into an import test 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sorry, I thought I also added arrow, added.
And added a comment as well
afd8d11
to
e6a545b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for this :D Nice work!
e6a545b
to
a074d54
Compare
…360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one
…360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one
…360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one
…360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one
…360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one
…360) (#377) * [s7Ob7Zm7] Test that all load and import procedures respect security (#360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one * [s7Ob7Zm7] changed tests * [s7Ob7Zm7] Update ImportAndLoadCoreSecurityTest.java * [s7Ob7Zm7] reduce logs * [s7Ob7Zm7] reduce logs in export tests
…eo4j/apoc#360) (neo4j/apoc#377) * [s7Ob7Zm7] Test that all load and import procedures respect security (#360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one * [s7Ob7Zm7] changed tests * [s7Ob7Zm7] Update ImportAndLoadCoreSecurityTest.java * [s7Ob7Zm7] reduce logs * [s7Ob7Zm7] reduce logs in export tests
…eo4j/apoc#360) (neo4j/apoc#377) * [s7Ob7Zm7] Test that all load and import procedures respect security (#360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one * [s7Ob7Zm7] changed tests * [s7Ob7Zm7] Update ImportAndLoadCoreSecurityTest.java * [s7Ob7Zm7] reduce logs * [s7Ob7Zm7] reduce logs in export tests
…eo4j/apoc#360) (neo4j/apoc#377) * [s7Ob7Zm7] Test that all load and import procedures respect security (#360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one * [s7Ob7Zm7] changed tests * [s7Ob7Zm7] Update ImportAndLoadCoreSecurityTest.java * [s7Ob7Zm7] reduce logs * [s7Ob7Zm7] reduce logs in export tests
…eo4j/apoc#360) (neo4j/apoc#377) * [s7Ob7Zm7] Test that all load and import procedures respect security (#360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one * [s7Ob7Zm7] changed tests * [s7Ob7Zm7] Update ImportAndLoadCoreSecurityTest.java * [s7Ob7Zm7] reduce logs * [s7Ob7Zm7] reduce logs in export tests
…eo4j/apoc#360) (neo4j/apoc#377) (#3617) * [s7Ob7Zm7] Test that all load and import procedures respect security (neo4j/apoc#360) (neo4j/apoc#377) * [s7Ob7Zm7] Test that all load and import procedures respect security (#360) * [s7Ob7Zm7] Test that all load and import procedures respect security * [3QAbWQds] changed ExportCoreSecurityTest consistent with LoadImport one * [s7Ob7Zm7] changed tests * [s7Ob7Zm7] Update ImportAndLoadCoreSecurityTest.java * [s7Ob7Zm7] reduce logs * [s7Ob7Zm7] reduce logs in export tests * [s7Ob7Zm7] 4.x changes
ImportAndLoadCoreSecurityTest.java
with all test config, for bothload.*
andimport.*
procedures, since they share the same behaviors with the configsinternal.dbms.cypher_ip_blocklist
,apoc.import.file.enabled
,apoc.import.file.use_neo4j_config
andapoc.import.file.allow_read_from_filesystem
LoadCoreSecurityTest
, as it has been replaced byImportAndLoadSecurityTest
createTempFolder()
to create a temp folder without having to useDatabaseManagementService
and ClassRuleTemporaryFolder
SensitivePathGenerator.etcPasswd()
as it didn't seem to work locally if the project located in a subfolder