Documentation
¶
Overview ¶
Package relation provides a client for Ory Keto, an open-source authorization server. It simplifies the process of creating and managing relation tuples for access control.
Index ¶
- Constants
- Variables
- func AddUserResourceRole(ctx context.Context, userId, namespace, object string, setRole role) error
- func Check(ctx context.Context, namespace, object, relation string, ...) (bool, error)
- func CheckBySubjectId(ctx context.Context, namespace, object, relation string, subjectId string) (bool, error)
- func Close()
- func DeleteObjectId(ctx context.Context, namespace, objectId string) error
- func Initialize(opts ...Option)
- func NewTupleBuilder() tupleBuilder
- func QueryObjectBySubjectIdRelation(ctx context.Context, namespace, subjectId, relation string) (*queryObjectResp, error)
- func QueryObjectBySubjectSetRelation(ctx context.Context, ...) (*queryObjectResp, error)
- func QuerySubjectByObjectRelation(ctx context.Context, namespace, object, relation string) (*querySubjectResp, error)
- func ToStatus(err error) *status.Status
- func WriteTuple(ctx context.Context, tuples tupleBuilder) error
- type Option
Constants ¶
View Source
const ( RoleOwner = role("owner") RoleEditor = role("editor") RoleViewer = role("viewer") )
Variables ¶
View Source
var ( ErrWriteConnectNotInitialed = errors.New("write connect not initialed") ErrReadConnectNotInitialed = errors.New("read connect not initialed") ErrWriteFailed = errors.New("write failed") ErrReadFailed = errors.New("read failed") StatusRelationWriteConnectionFailed = status.New(codes.Aborted, "relation write connection failed") StatusRelationReadConnectionFailed = status.New(codes.Aborted, "relation read connection failed") StatusRelationWriteFailed = status.New(codes.Internal, "relation write failed") StatusRelationReadFailed = status.New(codes.Internal, "relation read failed") )
Functions ¶
func AddUserResourceRole ¶
func CheckBySubjectId ¶
func Initialize ¶
func Initialize(opts ...Option)
"keto.dev.orb.local:4467" "keto.dev.orb.local:4466"
func NewTupleBuilder ¶
func NewTupleBuilder() tupleBuilder
func WriteTuple ¶
Types ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.