* 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 <crichter@owncloud.com> Co-authored-by: Christian Richter <crichter@owncloud.com>
17 lines
272 B
Go
17 lines
272 B
Go
package opa
|
|
|
|
import (
|
|
"github.com/open-policy-agent/opa/topdown/print"
|
|
|
|
"github.com/owncloud/ocis/v2/ocis-pkg/log"
|
|
)
|
|
|
|
type logPrinter struct {
|
|
logger log.Logger
|
|
}
|
|
|
|
func (lp logPrinter) Print(_ print.Context, msg string) error {
|
|
lp.logger.Info().Msg(msg)
|
|
return nil
|
|
}
|