和顺 / 衡律 返回所属 Agent
16.4

合规资料与规则引擎

原能力

管理合规资料和具名规则,逐项输出通过、失败或未知及实际依据。(合同附件 R7 16.4)

首选项目

Open Policy Agent(Apache-2.0)。 Open Policy Agent

匹配范围

规则求值和资料目录承载具时点的合规条目。

源码

Open Policy Agent · func (pq PreparedEvalQuery) Eval(

v1/rego/rego.go · 608–621 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
func (pq PreparedEvalQuery) Eval(ctx context.Context, options ...EvalOption) (ResultSet, error) {
	ectx, finish, err := pq.newEvalContext(ctx, options)
	if err != nil {
		return nil, err
	}
	defer finish(ctx)

	ectx.compiledQuery = pq.r.compiledQueries[evalQueryType]

	return pq.r.eval(ctx, ectx)
}

// PreparedPartialQuery holds the prepared Rego state that has been pre-processed
// for partial evaluations.
  • // Copyright 2017 The OPA Authors. All rights reserved.

CKAN · def package_create(

ckan/logic/action/package.py · 39–52 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
def package_create(context: Context, data_dict: DataDict) -> ActionResult.PackageCreate:  # noqa: C901
    """Create a new package.

    You must be authorized to create new packages. If you specify any groups
    for the new package, you must also be authorized to edit these groups.

    Plugins may change the parameters of this function depending on the value
    of the ``type`` parameter, see the
    :py:class:`~ckan.plugins.interfaces.IDatasetForm` plugin interface.

    :param name: the name of the new package, must be between 2 and 100
        characters long and contain only lowercase alphanumeric characters,
        ``-`` and ``_``, e.g. ``'warandpeace'``
    :type name: string

实现与验收要点

法域政策、原证明、规则变更与合规专业确认。