Skip to content
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

feat: add inheritance view to ssp-generate and ssp-assemble #1441

Merged
merged 27 commits into from
Nov 9, 2023

Conversation

jpower432
Copy link
Member

@jpower432 jpower432 commented Aug 28, 2023

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Documentation (change which affects the documentation site)

Quality assurance (all should be covered).

  • My code follows the code style of this project.
  • Documentation for my change is up to date?
  • My PR meets testing requirements.
  • All new and existing tests passed.
  • All commits are signed-off.

Summary

Adds an inheritance view to the generated trestle markdown that allows exported provided and responsibility statements to from a leveraged SSP to be used.

Closes #1398
Closes #1393

  • Filter written controls in inheritance view by profile passed to ssp-generate
  • Ensure unimplemented statements are present after ssp-assemble

Assumptions/Constraints

  • This assumes that the control exists within the control implementation of the SSP and edits the existing implemented requirements. It will edit or add by-component assemblies with the information.
  • The responsibility uuid can only occur once in the satisfied array and the provided uuid can only occur once in the inherited array.
  • This assumes that if no leveraging components are mapped to a leveraged component that the authorization is not leveraged (i.e. the leveraged authorization section will not be present)

What this does not do

Requesting to iterate in follow on PRs

  • This does not does remove files in the markdown directory for provided or responsibility exported statements with changed uuids (i.e. does not delete exports no longer referenced)
  • This does not accept more than one leveraged ssp

Key links:

Before you merge

  • Ensure it is a 'squash commit' if not a release.
  • Ensure CI is currently passing
  • Check sonar. If you are working for a fork a maintainer will reach out, if required.

Alex Flom and others added 22 commits August 28, 2023 14:41
…component

Adds ExportInterface and ExportWriter classes
Adds Markdown generation to ssp-generate
Add MarkdownWriter for leveraged statements

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Alex Flom <alexander.flom@gmail.com>
…markdown

Adds InheritanceMarkdownReader for processing into a leveraging SSP context
Adds persistance for components and satisified statements during updates
Changes leveraging component from a single dictionary to a list

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Adds ExportReader class
Removes ExportInterface class
Adds a single ByComponentInterface class to interact with the model
in terms of inheritance

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>

Co-authored-by: Jennifer Power <barnabei.jennifer@gmail.com>
… inheritance

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
…ader

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
…ve regex

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
…aged_ssp

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
…eritance view

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Adds SSPInheritanceAPI class for interacting with leveraged auth
information

Adds trestle global tags to markdown to store SSP location info

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>

Co-authored-by: Alex Flom <alexander.flom@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
@jpower432
Copy link
Member Author

@AleJo2995 @vikas-agarwal76 Added you both as reviewers to get your thoughts on this approach. We added enough here to address the two linked issues and get to the point where we can complete additional testing, so the scope of this feature should not increase. Thanks in advance!

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
@degenaro
Copy link
Collaborator

degenaro commented Oct 17, 2023

Perhaps these pre-existed, but sonar says there are 3 code smells https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&sinceLeakPeriod=true&pullRequest=1441&id=compliance-trestle

Not essential that these get fixed, but it would be nice...

@@ -519,10 +563,18 @@ def _run(self, args: argparse.Namespace) -> int:
raise TrestleError('Original ssp has no system component.')
comp_dict[const.SSP_MAIN_COMP_NAME] = sys_comp

ssp_sys_imp_comps = ssp.system_implementation.components
Copy link
Member Author

@jpower432 jpower432 Oct 17, 2023

Choose a reason for hiding this comment

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

@vikas-agarwal76 Just wanted to call out this logic specifically. This is really the only change to ssp-assemble that was made that could affect the current workflow. Though it would only apply to a leveraging SSP. All other changes are processed conditionally when the leveraged-ssp flag is used (generate) or the inheritance markdown is present (assemble).

Copy link
Collaborator

@vikas-agarwal76 vikas-agarwal76 left a comment

Choose a reason for hiding this comment

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

Small changes.

tests/trestle/core/crm/exports_reader_test.py Outdated Show resolved Hide resolved
tests/trestle/core/crm/exports_writer_test.py Outdated Show resolved Hide resolved
trestle/core/commands/author/ssp.py Show resolved Hide resolved
trestle/core/commands/author/ssp.py Show resolved Hide resolved
trestle/core/crm/bycomp_interface.py Show resolved Hide resolved
trestle/core/crm/bycomp_interface.py Show resolved Hide resolved
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
@jpower432
Copy link
Member Author

jpower432 commented Oct 27, 2023

Perhaps these pre-existed, but sonar says there are 3 code smells https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&sinceLeakPeriod=true&pullRequest=1441&id=compliance-trestle

Not essential that these get fixed, but it would be nice...

@degenaro Working through these. I believe only one was pre-existing.

@jpower432
Copy link
Member Author

@vikas-agarwal76 Changes addressing your feedback added on this commit - a10ba54. Please let me know if there are any additional changes or feedback.

@jpower432 jpower432 marked this pull request as ready for review November 1, 2023 17:44
@jpower432 jpower432 changed the title feat: add inheritance view to ssp-generate and ssp-assemble [WIP] feat: add inheritance view to ssp-generate and ssp-assemble Nov 1, 2023
Copy link
Collaborator

@vikas-agarwal76 vikas-agarwal76 left a comment

Choose a reason for hiding this comment

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

LGTM

@jpower432
Copy link
Member Author

jpower432 commented Nov 7, 2023

Thanks @vikas-agarwal76. Just wanted to confirm with you, @AleJo2995, and @degenaro, are there any other actions that need to be taken before merge? Thanks in advance!

@jpower432 jpower432 merged commit 6cf498b into develop Nov 9, 2023
16 checks passed
@jpower432 jpower432 deleted the feat/add-inheritance-view branch November 9, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants