snapshot of https://github.com/cortezaproject/corteza.git (2024.9.x, 2026-09-18; blobs > 131072B omitted)
Some checks failed
SonarQube / SonarQube (push) Failing after 5m28s
E2e test on main branch push / server and client test (map[name:admin port:8080]) (push) Failing after 3m33s
Server and lib tests / Library test (js) (push) Failing after 1m36s
Server and lib tests / Library test (vue) (push) Successful in 2m24s
Server and lib tests / Web client test (admin) (push) Successful in 2m52s
Server and lib tests / Web client test (compose) (push) Successful in 3m23s
Server and lib tests / Web client test (discovery) (push) Successful in 2m49s
Server and lib tests / Web client test (one) (push) Successful in 2m52s
Server and lib tests / Web client test (privacy) (push) Successful in 2m44s
Server and lib tests / Web client test (reporter) (push) Successful in 2m56s
Server and lib tests / Web client test (workflow) (push) Successful in 3m0s
Server and lib tests / Server tests (push) Failing after 4m55s
E2e test on main branch push / notify-failure (push) Failing after 9s
Server and lib tests / Send matrix testing notification (push) Successful in 2s
Mark stale issues and pull requests / stale (push) Successful in 40s
Some checks failed
SonarQube / SonarQube (push) Failing after 5m28s
E2e test on main branch push / server and client test (map[name:admin port:8080]) (push) Failing after 3m33s
Server and lib tests / Library test (js) (push) Failing after 1m36s
Server and lib tests / Library test (vue) (push) Successful in 2m24s
Server and lib tests / Web client test (admin) (push) Successful in 2m52s
Server and lib tests / Web client test (compose) (push) Successful in 3m23s
Server and lib tests / Web client test (discovery) (push) Successful in 2m49s
Server and lib tests / Web client test (one) (push) Successful in 2m52s
Server and lib tests / Web client test (privacy) (push) Successful in 2m44s
Server and lib tests / Web client test (reporter) (push) Successful in 2m56s
Server and lib tests / Web client test (workflow) (push) Successful in 3m0s
Server and lib tests / Server tests (push) Failing after 4m55s
E2e test on main branch push / notify-failure (push) Failing after 9s
Server and lib tests / Send matrix testing notification (push) Successful in 2s
Mark stale issues and pull requests / stale (push) Successful in 40s
This commit is contained in:
389
server/app/resources.cue
Normal file
389
server/app/resources.cue
Normal file
@@ -0,0 +1,389 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"github.com/cortezaproject/corteza/server/codegen/schema"
|
||||
)
|
||||
|
||||
_allFeaturesDisabled: {
|
||||
labels: false
|
||||
paging: false
|
||||
sorting: false
|
||||
checkFn: false
|
||||
}
|
||||
|
||||
resources: { [key=_]: {"handle": key, "component": "system", "platform": "corteza" } & schema.#PkgResource } & {
|
||||
"rbac-rule": {
|
||||
package: {
|
||||
ident: "rbac"
|
||||
import: "github.com/cortezaproject/corteza/server/pkg/rbac"
|
||||
}
|
||||
|
||||
ident: "rule"
|
||||
identPlural: "rules"
|
||||
expIdent: "Rule"
|
||||
|
||||
features: _allFeaturesDisabled
|
||||
|
||||
|
||||
model: {
|
||||
ident: "rbac_rules"
|
||||
attributes: {
|
||||
role_id: {
|
||||
goType: "uint64",
|
||||
ident: "roleID",
|
||||
storeIdent: "rel_role"
|
||||
dal: { type: "Ref", refModelResType: "corteza::system:role" }
|
||||
}
|
||||
resource: {
|
||||
dal: { length: 512 }
|
||||
}
|
||||
operation: {
|
||||
dal: { length: 50 }
|
||||
}
|
||||
access: {
|
||||
goType: "types.Access"
|
||||
dal: { type: "Number", meta: { "rdbms:type": "integer" } }
|
||||
}
|
||||
}
|
||||
|
||||
indexes: {
|
||||
"primary": { attributes: [ "role_id", "resource", "operation" ] }
|
||||
}
|
||||
}
|
||||
|
||||
store: {
|
||||
ident: "rbacRule"
|
||||
|
||||
api: {
|
||||
functions: [
|
||||
{
|
||||
expIdent: "TransferRbacRules"
|
||||
args: [
|
||||
{ident: "src", goType: "uint64"},
|
||||
{ident: "dst", goType: "uint64"},
|
||||
]
|
||||
return: []
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"label": {
|
||||
package: {
|
||||
ident: "labels"
|
||||
import: "github.com/cortezaproject/corteza/server/pkg/label/types"
|
||||
}
|
||||
|
||||
ident: "label"
|
||||
identPlural: "labels"
|
||||
expIdent: "Label"
|
||||
|
||||
features: _allFeaturesDisabled
|
||||
|
||||
model: {
|
||||
attributes: {
|
||||
kind: {
|
||||
dal: { length: 64 }
|
||||
}
|
||||
resource_id: {
|
||||
goType: "uint64",
|
||||
ident: "resourceID",
|
||||
storeIdent: "rel_resource"
|
||||
dal: { type: "ID" }
|
||||
}
|
||||
name: {
|
||||
ignoreCase: true
|
||||
dal: { length: 512 }
|
||||
}
|
||||
value: {
|
||||
goType: "types.LabelValue"
|
||||
dal: { type: "JSON"}
|
||||
omitSetter: true
|
||||
omitGetter: true
|
||||
}
|
||||
}
|
||||
|
||||
indexes: {
|
||||
"primary": { attributes: ["kind", "resource_id", "name"] }
|
||||
"unique_kind_res_name": {
|
||||
fields: [
|
||||
{ attribute: "kind" },
|
||||
{ attribute: "resource_id" },
|
||||
{ attribute: "name", modifiers: [ "LOWERCASE" ] },
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
filter: {
|
||||
expIdent: "LabelFilter"
|
||||
struct: {
|
||||
kind: {}
|
||||
rel_resource: { goType: "[]uint64", ident: "resourceID" }
|
||||
limit: { goType: "uint" }
|
||||
}
|
||||
|
||||
byValue: ["kind" , "rel_resource", ]
|
||||
}
|
||||
|
||||
store: {
|
||||
api: {
|
||||
lookups: [
|
||||
{
|
||||
fields: ["kind", "resource_id", "name"]
|
||||
description: """
|
||||
searches for label by kind, resource ID and name
|
||||
"""
|
||||
},
|
||||
]
|
||||
|
||||
functions: [
|
||||
{
|
||||
expIdent: "DeleteExtraLabels"
|
||||
args: [
|
||||
{ident: "kind", goType: "string"},
|
||||
{ident: "resourceId", goType: "uint64"},
|
||||
{ident: "name", goType: "string", spread: true},
|
||||
]
|
||||
return: []
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"flag": {
|
||||
package: {
|
||||
ident: "flag"
|
||||
import: "github.com/cortezaproject/corteza/server/pkg/flag/types"
|
||||
}
|
||||
|
||||
ident: "flag"
|
||||
identPlural: "flags"
|
||||
expIdent: "Flag"
|
||||
|
||||
features: _allFeaturesDisabled
|
||||
|
||||
model: {
|
||||
attributes: {
|
||||
kind: {
|
||||
dal: { length: 64 }
|
||||
}
|
||||
resource_id: {
|
||||
goType: "uint64",
|
||||
ident: "resourceID",
|
||||
storeIdent: "rel_resource"
|
||||
dal: { type: "ID" }
|
||||
}
|
||||
owned_by: schema.AttributeUserRef
|
||||
name: {
|
||||
ignoreCase: true
|
||||
dal: { length: 512 }
|
||||
}
|
||||
active: {
|
||||
goType: "bool"
|
||||
dal: { type: "Boolean" }
|
||||
}
|
||||
}
|
||||
|
||||
indexes: {
|
||||
"primary": { attributes: ["kind", "resource_id", "owned_by", "name"] }
|
||||
"unique_kind_res_owner_name": {
|
||||
fields: [
|
||||
{ attribute: "kind" },
|
||||
{ attribute: "resource_id" },
|
||||
{ attribute: "owned_by" },
|
||||
{ attribute: "name", modifiers: [ "LOWERCASE" ] },
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
filter: {
|
||||
expIdent: "FlagFilter"
|
||||
struct: {
|
||||
kind: {}
|
||||
resource_id: { goType: "[]uint64",
|
||||
ident: "resourceID", storeIdent: "rel_resource" }
|
||||
owned_by: { goType: "[]uint64", ident: "ownedBy" }
|
||||
name: { goType: "[]string", ident: "name" }
|
||||
}
|
||||
|
||||
byValue: ["kind", "resource_id", "owned_by", "name", ]
|
||||
}
|
||||
|
||||
store: {
|
||||
api: {
|
||||
lookups: [
|
||||
{
|
||||
fields: ["kind", "resource_id", "owned_by", "name"]
|
||||
description: """
|
||||
searches for flag by kind, resource ID, owner and name
|
||||
"""
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"actionlog": {
|
||||
package: {
|
||||
ident: "actionlog"
|
||||
import: "github.com/cortezaproject/corteza/server/pkg/actionlog"
|
||||
}
|
||||
|
||||
ident: "action"
|
||||
identPlural: "action"
|
||||
expIdent: "Action"
|
||||
|
||||
features: {
|
||||
labels: false
|
||||
paging: false
|
||||
checkFn: false
|
||||
}
|
||||
|
||||
model: {
|
||||
ident: "actionlog"
|
||||
attributes: {
|
||||
id: schema.IdField
|
||||
timestamp: schema.SortableTimestampField & { storeIdent: "ts" }
|
||||
actor_ip_addr: {
|
||||
ident: "actorIPAddr"
|
||||
dal: { type: "Text", length: 64 }
|
||||
}
|
||||
actor_id: {
|
||||
goType: "uint64",
|
||||
ident: "actorID"
|
||||
dal: { type: "Ref", refModelResType: "corteza::system:user" }
|
||||
}
|
||||
request_origin: {
|
||||
dal: { type: "Text", length: 32 }
|
||||
}
|
||||
request_id: {
|
||||
ident: "requestID"
|
||||
dal: { type: "Text", length: 256 }
|
||||
}
|
||||
resource: {
|
||||
dal: { type: "Text", length: 512 }
|
||||
}
|
||||
action: {
|
||||
dal: { type: "Text", length: 64 }
|
||||
}
|
||||
error: {
|
||||
dal: {}
|
||||
}
|
||||
severity: {
|
||||
goType: "types.Severity"
|
||||
dal: { type: "Number", default: 0, meta: { "rdbms:type": "integer" } }
|
||||
}
|
||||
description: {
|
||||
dal: {}
|
||||
}
|
||||
meta: {
|
||||
goType: "types.Meta"
|
||||
dal: { type: "JSON", defaultEmptyObject: true }
|
||||
}
|
||||
}
|
||||
|
||||
indexes: {
|
||||
"primary": { attribute: "id" }
|
||||
"action": { attribute: "action"}
|
||||
"actor_id": { attribute: "actor_id"}
|
||||
"rel_resource": { attribute: "resource"}
|
||||
"ts": { attribute: "timestamp"}
|
||||
}
|
||||
}
|
||||
|
||||
filter: {
|
||||
expIdent: "Filter"
|
||||
struct: {
|
||||
from_timestamp: { goType: "*time.Time" }
|
||||
to_timestamp: { goType: "*time.Time" }
|
||||
before_action_id: { goType: "uint64", ident: "beforeActionID" }
|
||||
actor_id: { goType: "[]uint64", ident: "actorID" }
|
||||
origin: {}
|
||||
resource: {}
|
||||
action: {}
|
||||
limit: { goType: "uint" }
|
||||
}
|
||||
|
||||
byValue: ["action", "resource", "origin", "actor_id" ]
|
||||
}
|
||||
|
||||
store: {
|
||||
ident: "actionlog"
|
||||
|
||||
api: {
|
||||
lookups: [
|
||||
{
|
||||
fields: ["id"]
|
||||
description: """
|
||||
searches for action log by ID
|
||||
"""
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"resource-activity": {
|
||||
package: {
|
||||
ident: "discovery"
|
||||
import: "github.com/cortezaproject/corteza/server/discovery/types"
|
||||
}
|
||||
|
||||
ident: "resourceActivity"
|
||||
identPlural: "resourceActivities"
|
||||
expIdent: "ResourceActivity"
|
||||
expIdentPlural: "ResourceActivities"
|
||||
|
||||
features: _allFeaturesDisabled
|
||||
|
||||
model: {
|
||||
ident: "resource_activity_log"
|
||||
attributes: {
|
||||
id: schema.IdField
|
||||
timestamp: schema.SortableTimestampField & { storeIdent: "ts" }
|
||||
resource_type: {
|
||||
dal: {}
|
||||
}
|
||||
resource_action: {
|
||||
dal: {}
|
||||
}
|
||||
resource_id: {
|
||||
goType: "uint64",
|
||||
ident: "resourceID",
|
||||
storeIdent: "rel_resource"
|
||||
dal: { type: "ID" }
|
||||
}
|
||||
meta: {
|
||||
goType: "rawJson"
|
||||
dal: { type: "JSON", defaultEmptyObject: true }
|
||||
}
|
||||
}
|
||||
|
||||
indexes: {
|
||||
"primary": { attribute: "id" }
|
||||
"resource": { attribute: "resource_id" }
|
||||
}
|
||||
}
|
||||
|
||||
filter: {
|
||||
expIdent: "ResourceActivityFilter"
|
||||
struct: {
|
||||
from_timestamp: { goType: "*time.Time" }
|
||||
to_timestamp: { goType: "*time.Time" }
|
||||
}
|
||||
}
|
||||
|
||||
store: {
|
||||
ident: "resourceActivity"
|
||||
|
||||
api: {
|
||||
lookups: []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user