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

enhancement: add mimetype to file extension rego function #6133

Merged
merged 5 commits into from
Jul 10, 2023

Conversation

fschade
Copy link
Contributor

@fschade fschade commented Apr 25, 2023

Description

add rego function to detect the resource extension by mimetype, at the same time this pr introduces a custom ocis namespace for the rego functions.

How Has This Been Tested?

  • local installation
  • unit tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented Apr 25, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@fschade
Copy link
Contributor Author

fschade commented Apr 25, 2023

i need to

add a changelog

✅ work on extension := extensions[_] which fails if multiple mimetypes are detected,

i do this later...

@micbar something else needed?

@fschade fschade marked this pull request as draft April 25, 2023 07:55
fschade added 2 commits July 10, 2023 12:22
add rego function to detect the resource extension by mimetype, at the same time this pr introduces a custom ocis namespace for the rego functions.
@micbar
Copy link
Contributor

micbar commented Jul 10, 2023

woot? Rebase gone wrong?

Signed-off-by: Christian Richter <[email protected]>
Signed-off-by: Christian Richter <[email protected]>
@fschade fschade force-pushed the policies-mimetype-detection branch from f514d10 to 7e4481b Compare July 10, 2023 10:25
@fschade
Copy link
Contributor Author

fschade commented Jul 10, 2023

woot? Rebase gone wrong?

gosh, you're fast, 🤣 give me a few second to breathe... fixed

TypeByExtension which is used to resolve extension by mimetype relies on MIME-info database which differs at my local env (macos <-> drone). This is fixed by using one of the builtinTypes for testing
@fschade fschade force-pushed the policies-mimetype-detection branch from 9c06470 to 9c86c32 Compare July 10, 2023 13:48
@fschade fschade marked this pull request as ready for review July 10, 2023 13:49
@fschade fschade requested review from kobergj and micbar July 10, 2023 13:49
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

40.0% 40.0% Coverage
0.0% 0.0% Duplication

@fschade fschade merged commit c09f824 into master Jul 10, 2023
@delete-merged-branch delete-merged-branch bot deleted the policies-mimetype-detection branch July 10, 2023 14:28
ownclouders pushed a commit that referenced this pull request Jul 10, 2023
* enhancement: add mimetype to file extension rego function

add rego function to detect the resource extension by mimetype, at the same time this pr introduces a custom ocis namespace for the rego functions.

* enhancement: add custom logPrinter to opa policies service

* fix: imports and test

TypeByExtension which is used to resolve extension by mimetype relies on MIME-info database which differs at my local env (macos <-> drone). This is fixed by using one of the builtinTypes for testing

---------

Signed-off-by: Christian Richter <[email protected]>
Co-authored-by: Christian Richter <[email protected]>
@micbar micbar mentioned this pull request Jul 24, 2023
68 tasks
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.

3 participants