accounts

package
v0.0.0-...-fa720cf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MethodMap = map[string]Operation{
	"/gripql.Query/Traversal":    Query,
	"/gripql.Query/GetVertex":    Read,
	"/gripql.Query/GetEdge":      Read,
	"/gripql.Query/GetTimestamp": Read,
	"/gripql.Query/GetSchema":    Read,
	"/gripql.Query/GetMapping":   Read,
	"/gripql.Query/ListGraphs":   Read,
	"/gripql.Query/ListIndices":  Read,
	"/gripql.Query/ListLabels":   Read,

	"/gripql.Job/Submit":     Exec,
	"/gripql.Job/ListJobs":   Read,
	"/gripql.Job/SearchJobs": Read,
	"/gripql.Job/DeleteJob":  Write,
	"/gripql.Job/GetJob":     Read,
	"/gripql.Job/ViewJob":    Read,
	"/gripql.Job/ResumeJob":  Exec,

	"/gripql.Edit/AddVertex":    Write,
	"/gripql.Edit/AddEdge":      Write,
	"/gripql.Edit/BulkAdd":      Write,
	"/gripql.Edit/AddGraph":     Write,
	"/gripql.Edit/DeleteGraph":  Write,
	"/gripql.Edit/DeleteVertex": Write,
	"/gripql.Edit/DeleteEdge":   Write,
	"/gripql.Edit/AddIndex":     Write,
	"/gripql.Edit/AddSchema":    Write,
	"/gripql.Edit/AddMapping":   Write,
	"/gripql.Edit/SampleSchema": Write,

	"/gripql.Configure/StartPlugin": Admin,
	"/gripql.Configure/ListPlugin":  Admin,
	"/gripql.Configure/ListDrivers": Admin,
}

Functions

This section is empty.

Types

type Access

type Access interface {
	Enforce(user string, graph string, operation Operation) error
}

type AccessConfig

type AccessConfig struct {
	Null   *NullAccess
	Casbin *CasbinAccess
}

type AuthConfig

type AuthConfig struct {
	Basic *BasicAuth
	Proxy *ProxyAuth
}

type Authenticate

type Authenticate interface {
	Validate(md MetaData) (string, error)
}

type BasicAuth

type BasicAuth []BasicCredential

func (BasicAuth) Validate

func (ba BasicAuth) Validate(md MetaData) (string, error)

type BasicCredential

type BasicCredential struct {
	User     string
	Password string
}

BasicCredential describes a username and password for use with Funnel's basic auth.

type BulkWriteFilter

type BulkWriteFilter struct {
	SS     grpc.ServerStream
	User   string
	Access Access
}

func (*BulkWriteFilter) Context

func (bw *BulkWriteFilter) Context() context.Context

func (*BulkWriteFilter) RecvMsg

func (bw *BulkWriteFilter) RecvMsg(m interface{}) error

func (*BulkWriteFilter) SendHeader

func (bw *BulkWriteFilter) SendHeader(m metadata.MD) error

func (*BulkWriteFilter) SendMsg

func (bw *BulkWriteFilter) SendMsg(m interface{}) error

func (*BulkWriteFilter) SetHeader

func (bw *BulkWriteFilter) SetHeader(m metadata.MD) error

func (*BulkWriteFilter) SetTrailer

func (bw *BulkWriteFilter) SetTrailer(m metadata.MD)

type CasbinAccess

type CasbinAccess struct {
	Model  string
	Policy string
	// contains filtered or unexported fields
}

func (*CasbinAccess) Enforce

func (ce *CasbinAccess) Enforce(user string, graph string, operation Operation) error

type Config

type Config struct {
	Auth   *AuthConfig
	Access *AccessConfig
	// contains filtered or unexported fields
}

func (*Config) StreamInterceptor

func (c *Config) StreamInterceptor() grpc.StreamServerInterceptor

func (*Config) UnaryInterceptor

func (c *Config) UnaryInterceptor() grpc.UnaryServerInterceptor

type MetaData

type MetaData map[string][]string

type NullAccess

type NullAccess struct{}

func (NullAccess) Enforce

func (be NullAccess) Enforce(user string, graph string, operation Operation) error

type NullAuth

type NullAuth struct{}

func (NullAuth) Validate

func (na NullAuth) Validate(md MetaData) (string, error)

type Operation

type Operation string
const (
	Query       Operation = "query"
	Write       Operation = "write"
	Read        Operation = "read"
	Exec        Operation = "exec"
	Admin       Operation = "admin"
	QueryRepeat Operation = "query_repeat"
)

type ProxyAuth

type ProxyAuth struct {
	Field string
}

func (ProxyAuth) Validate

func (ba ProxyAuth) Validate(md MetaData) (string, error)

type StreamOutWrapper

type StreamOutWrapper[X any] struct {
	Request X
	SS      grpc.ServerStream
}

func NewStreamOutWrapper

func NewStreamOutWrapper[X any](inSS grpc.ServerStream) (*StreamOutWrapper[X], error)

func (*StreamOutWrapper[X]) Context

func (bw *StreamOutWrapper[X]) Context() context.Context

func (*StreamOutWrapper[X]) RecvMsg

func (bw *StreamOutWrapper[X]) RecvMsg(m interface{}) error

func (*StreamOutWrapper[X]) SendHeader

func (bw *StreamOutWrapper[X]) SendHeader(m metadata.MD) error

func (*StreamOutWrapper[X]) SendMsg

func (bw *StreamOutWrapper[X]) SendMsg(m interface{}) error

func (*StreamOutWrapper[X]) SetHeader

func (bw *StreamOutWrapper[X]) SetHeader(m metadata.MD) error

func (*StreamOutWrapper[X]) SetTrailer

func (bw *StreamOutWrapper[X]) SetTrailer(m metadata.MD)

Jump to

Keyboard shortcuts

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