Fix SBOM team permission handling #1499
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This change allows users with team-scoped permissions to use fossa sbom analyze --team when they are members of the specified team, matching the behavior of fossa analyze --team.
Currently, users with None permissions but Team Admin status are unable to upload SBOM projects to their team.
Acceptance criteria
fossa sbom analyze --team [team-name]
for any team of which they are a member.Testing plan
I spent time investigating how to write tests for this example and unfortunately found that while we do test preflight checks, we aren't able to test at this level of integration. For example, we have tests for
AnalyzeChecks
which SBOM analysis uses, however, the issue was that the team argument was omitted.AnalyzeChecks
is properly tested, however ,I believe that writing a test to prevent this scenario would require a higher-level integration test over thesbom analyze
workflow. I am open to ideas here!Risks
Very low risk. This only impacts pre-flight checks. The worst thing that can happen is that people have to wait ~20 seconds to see an API call fail.
References
ANE-2241: Implement SBOM team analyze preflight check errors
Checklist
docs/
.docs/README.ms
and gave consideration to how discoverable or not my documentation is.Changelog.md
. If this PR did not mark a release, I added my changes into an## Unreleased
section at the top..fossa.yml
orfossa-deps.{json.yml}
, I updateddocs/references/files/*.schema.json
AND I have updated example files used byfossa init
command. You may also need to update these if you have added/removed new dependency type (e.g.pip
) or analysis target type (e.g.poetry
).docs/references/subcommands/<subcommand>.md
.