ds

package
v0.32.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufToProto added in v0.0.7

func BufToProto(r io.Reader, msg proto.Message) error

BufToProto, unmarshal buffer to proto message instance.

func ProtoToBuf added in v0.0.7

func ProtoToBuf(w io.Writer, msg proto.Message) error

ProtoToBuf, marshal proto message to buffer.

func ProtoToInterface added in v0.30.0

func ProtoToInterface(msg proto.Message) (interface{}, error)

func RegisterCheck added in v0.30.0

func RegisterCheck(logger *zerolog.Logger, fnName string, dr resolvers.DirectoryResolver) (*rego.Function, rego.Builtin1)

RegisterCheck - ds.check

ds.check({
  "object_type": "",
  "object_id": "",
  "relation": "",
  "subject_type": ""
  "subject_id": "",
  "trace": false
})

func RegisterCheckPermission

func RegisterCheckPermission(logger *zerolog.Logger, fnName string, dr resolvers.DirectoryResolver) (*rego.Function, rego.Builtin1)

RegisterCheckPermission - ds.check_permission

ds.check_permission: {
	"object_id": "",
	"object_type": "",
	"permission": "",
	"subject_id": "",
	"subject_type": "",
	"trace": false
  }

func RegisterCheckRelation

func RegisterCheckRelation(logger *zerolog.Logger, fnName string, dr resolvers.DirectoryResolver) (*rego.Function, rego.Builtin1)

RegisterCheckRelation - ds.check_relation

ds.check_relation: {
	"object_id": "",
	"object_type": "",
	"relation": "",
	"subject_id": "",
	"subject_type": "",
	"trace": false
  }

func RegisterGraph

func RegisterGraph(logger *zerolog.Logger, fnName string, dr resolvers.DirectoryResolver) (*rego.Function, rego.Builtin1)

RegisterGraph - ds.graph

ds.graph({
    "object_type": "",
    "object_id": "",
    "relation": "",
    "subject_type": "",
    "subject_id": "",
    "subject_relation": "",
    "explain": false,
    "trace": false
}

func RegisterIdentity

func RegisterIdentity(logger *zerolog.Logger, fnName string, dr resolvers.DirectoryResolver) (*rego.Function, rego.Builtin1)

RegisterIdentity - ds.identity - get user id (key) for identity

ds.identity({
	"id": ""
})

func RegisterObject

func RegisterObject(logger *zerolog.Logger, fnName string, dr resolvers.DirectoryResolver) (*rego.Function, rego.Builtin1)

RegisterObject - ds.object

v3 (latest) request format:

ds.object({
	"object_type": "",
	"object_id": "",
	"with_relation": false
})

v2 request format:

ds.object({
	"type": "",
	"key": ""
})

func RegisterRelation

func RegisterRelation(logger *zerolog.Logger, fnName string, dr resolvers.DirectoryResolver) (*rego.Function, rego.Builtin1)

RegisterRelation - ds.relation

ds.relation: {
	"object_id": "",
	"object_type": "",
	"relation": "",
	"subject_id": "",
	"subject_relation": "",
	"subject_type": "",
	"with_objects": false
  }

func RegisterRelations added in v0.25.14

func RegisterRelations(logger *zerolog.Logger, fnName string, dr resolvers.DirectoryResolver) (*rego.Function, rego.Builtin1)

TODO : update v3 format

RegisterRelations - ds.relations({
	"ds.relations": {
		"object_type": "",
		"object_id": "",
		"relation": "",
		"subject_type": "",
		"subject_id": "",
		"subject_relation": "",
		"with_objects": false,
		"with_empty_subject_relation": false
	}
})

func RegisterUser

func RegisterUser(logger *zerolog.Logger, fnName string, dr resolvers.DirectoryResolver) (*rego.Function, rego.Builtin1)

RegisterUser - ds.user

ds.user({
	"id": ""
})

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL