Make it possible to bypass /origin/files policy [RHELDST-22253] #711
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.
RHELDST-23443 started to enforce that content published under /origin/files must abide by the established naming scheme (e.g. checksum in path must match checksum of content).
Problem: content from legacy storage is still being migrated via exodus-gw, and some of that content fails to comply. We should permit migration of such content as-is.
As there is a use-case for bypassing these checks, but only for the user performing the migration, add a new role supporting this. If the calling user has e.g. "live-ignore-policy", they will be permitted to bypass this specific check in "live". This will be granted to the user performing the migration.
The relevant code was rewritten a bit and placed next to the other validation code so that it's cleaner to catch/ignore the exception when needed.