Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Generate command doesn't properly handle relative profile imports #57

Closed
anweiss opened this issue Jan 20, 2019 · 3 comments
Closed

Generate command doesn't properly handle relative profile imports #57

anweiss opened this issue Jan 20, 2019 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@anweiss
Copy link
Contributor

anweiss commented Jan 20, 2019

When executing oscalkit generate and processing profile import's, relative paths are not being taken into account properly. We're incorrectly taking the path relative to the directory from which the oscalkit CLI is being run. However, we instead should be taking the path relative to the directory in which the profile is stored. The implementation of the following function looks to be the culprit:

https://github.com/docker/oscalkit/blob/d66e30b99ca1454f7dfd40ba5982bd7ed8be8ef2/generator/reader.go#L49

So for example, if I execute oscalkit generate -p /someDir/profile.xml and profile.xml has a relative import like ../catalog.xml, then the directory that needs to be searched is /someDir and not the directory in which the oscalkit generate command is being run.

This supports #18 and #12

@anweiss anweiss added the bug Something isn't working label Jan 20, 2019
@anweiss anweiss added this to the OSCAL 1.0 milestone Jan 20, 2019
@minhaj10p
Copy link
Contributor

@anweiss
issue addressed in #58 which is dependent upon #52

@minhaj10p
Copy link
Contributor

@anweiss We can close this issue once #66 gets merged.

@anweiss
Copy link
Contributor Author

anweiss commented Jan 25, 2019

awesome, thanks @minhaj10p

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants