Skip to content

Patch security hole in spec_loader.py#32

Merged
jayrbolton merged 2 commits intodevelopfrom
spec_loader_edits
Sep 8, 2020
Merged

Patch security hole in spec_loader.py#32
jayrbolton merged 2 commits intodevelopfrom
spec_loader_edits

Conversation

@ialarmedalien
Copy link
Copy Markdown
Collaborator

  • patch security hole in spec_loader.py and add tests (closes Patch potential security hole in spec_loader.py #22)

  • add "get_view" method to spec_loader.py and add a view to the sample_spec_release test set

  • add sample_spec_release dir (expanded version of the test spec archive, spec.tar.gz)

  • add instructions for updating the test spec archive

  • I updated the README.md docs to reflect this change.

  • This is not a breaking API change

add sample_spec_release dir and instructions for updating the test spec archive
add "get_view" method to spec_loader.py and sample view to the test spec archive
Comment on lines +19 to +27
config = get_config()
cls.repo_path = config['spec_paths']['repo']
for key in config['spec_paths'].keys():
if cls.repo_path in config['spec_paths'][key]:
config['spec_paths'][key] = config['spec_paths'][key].replace(
cls.repo_path,
cls.test_spec_dir
)
cls.config = config
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit config settings to point to the sample_spec_release dir for the duration of this test.

)

# this matches a file in one of the other test data dirs => should throw an error
path_outside_spec_repo = '../../../../data/collections/test_node'
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prior to the fixes, this would retrieve a file. 😱

Comment on lines +147 to +150
{
'schema_type_names': ['view', 'views'],
'example': 'test_vertices',
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add in tests for retrieving views

Comment thread relation_engine_server/test/spec_release/README.md
Comment thread relation_engine_server/utils/spec_loader.py Outdated
Comment thread relation_engine_server/utils/spec_loader.py Outdated
Comment thread relation_engine_server/utils/spec_loader.py Outdated
Simplify code to reduce array of paths to a unique set
@jayrbolton jayrbolton merged commit 7a01065 into develop Sep 8, 2020
@jayrbolton jayrbolton deleted the spec_loader_edits branch September 8, 2020 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Patch potential security hole in spec_loader.py

2 participants