privacy

package
v0.7.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Allow may be returned by rules to indicate that the policy
	// evaluation should terminate with allow decision.
	Allow = privacy.Allow

	// Deny may be returned by rules to indicate that the policy
	// evaluation should terminate with deny decision.
	Deny = privacy.Deny

	// Skip may be returned by rules to indicate that the policy
	// evaluation should continue to the next rule.
	Skip = privacy.Skip
)

Functions

func Allowf

func Allowf(format string, a ...any) error

Allowf returns a formatted wrapped Allow decision.

func DecisionContext

func DecisionContext(parent context.Context, decision error) context.Context

DecisionContext creates a new context from the given parent context with a policy decision attach to it.

func DecisionFromContext

func DecisionFromContext(ctx context.Context) (error, bool)

DecisionFromContext retrieves the policy decision from the context.

func Denyf

func Denyf(format string, a ...any) error

Denyf returns a formatted wrapped Deny decision.

func Skipf

func Skipf(format string, a ...any) error

Skipf returns a formatted wrapped Skip decision.

Types

type APITokenMutationRuleFunc added in v0.5.0

type APITokenMutationRuleFunc func(context.Context, *generated.APITokenMutation) error

The APITokenMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (APITokenMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type APITokenQueryRuleFunc added in v0.5.0

type APITokenQueryRuleFunc func(context.Context, *generated.APITokenQuery) error

The APITokenQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (APITokenQueryRuleFunc) EvalQuery added in v0.5.0

EvalQuery return f(ctx, q).

type ContactHistoryMutationRuleFunc added in v0.7.4

type ContactHistoryMutationRuleFunc func(context.Context, *generated.ContactHistoryMutation) error

The ContactHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (ContactHistoryMutationRuleFunc) EvalMutation added in v0.7.4

EvalMutation calls f(ctx, m).

type ContactHistoryQueryRuleFunc added in v0.7.4

type ContactHistoryQueryRuleFunc func(context.Context, *generated.ContactHistoryQuery) error

The ContactHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (ContactHistoryQueryRuleFunc) EvalQuery added in v0.7.4

EvalQuery return f(ctx, q).

type ContactMutationRuleFunc added in v0.7.4

type ContactMutationRuleFunc func(context.Context, *generated.ContactMutation) error

The ContactMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (ContactMutationRuleFunc) EvalMutation added in v0.7.4

EvalMutation calls f(ctx, m).

type ContactQueryRuleFunc added in v0.7.4

type ContactQueryRuleFunc func(context.Context, *generated.ContactQuery) error

The ContactQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (ContactQueryRuleFunc) EvalQuery added in v0.7.4

EvalQuery return f(ctx, q).

type DocumentDataHistoryMutationRuleFunc added in v0.4.5

type DocumentDataHistoryMutationRuleFunc func(context.Context, *generated.DocumentDataHistoryMutation) error

The DocumentDataHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (DocumentDataHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type DocumentDataHistoryQueryRuleFunc added in v0.4.5

type DocumentDataHistoryQueryRuleFunc func(context.Context, *generated.DocumentDataHistoryQuery) error

The DocumentDataHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (DocumentDataHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type DocumentDataMutationRuleFunc added in v0.4.4

type DocumentDataMutationRuleFunc func(context.Context, *generated.DocumentDataMutation) error

The DocumentDataMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (DocumentDataMutationRuleFunc) EvalMutation added in v0.4.4

EvalMutation calls f(ctx, m).

type DocumentDataQueryRuleFunc added in v0.4.4

type DocumentDataQueryRuleFunc func(context.Context, *generated.DocumentDataQuery) error

The DocumentDataQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (DocumentDataQueryRuleFunc) EvalQuery added in v0.4.4

EvalQuery return f(ctx, q).

type EmailVerificationTokenMutationRuleFunc added in v0.2.2

type EmailVerificationTokenMutationRuleFunc func(context.Context, *generated.EmailVerificationTokenMutation) error

The EmailVerificationTokenMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EmailVerificationTokenMutationRuleFunc) EvalMutation added in v0.2.2

EvalMutation calls f(ctx, m).

type EmailVerificationTokenQueryRuleFunc added in v0.2.2

type EmailVerificationTokenQueryRuleFunc func(context.Context, *generated.EmailVerificationTokenQuery) error

The EmailVerificationTokenQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EmailVerificationTokenQueryRuleFunc) EvalQuery added in v0.2.2

EvalQuery return f(ctx, q).

type EntitlementHistoryMutationRuleFunc added in v0.4.5

type EntitlementHistoryMutationRuleFunc func(context.Context, *generated.EntitlementHistoryMutation) error

The EntitlementHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntitlementHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type EntitlementHistoryQueryRuleFunc added in v0.4.5

type EntitlementHistoryQueryRuleFunc func(context.Context, *generated.EntitlementHistoryQuery) error

The EntitlementHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntitlementHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type EntitlementMutationRuleFunc

type EntitlementMutationRuleFunc func(context.Context, *generated.EntitlementMutation) error

The EntitlementMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntitlementMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type EntitlementPlanFeatureHistoryMutationRuleFunc added in v0.7.0

type EntitlementPlanFeatureHistoryMutationRuleFunc func(context.Context, *generated.EntitlementPlanFeatureHistoryMutation) error

The EntitlementPlanFeatureHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntitlementPlanFeatureHistoryMutationRuleFunc) EvalMutation added in v0.7.0

EvalMutation calls f(ctx, m).

type EntitlementPlanFeatureHistoryQueryRuleFunc added in v0.7.0

type EntitlementPlanFeatureHistoryQueryRuleFunc func(context.Context, *generated.EntitlementPlanFeatureHistoryQuery) error

The EntitlementPlanFeatureHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntitlementPlanFeatureHistoryQueryRuleFunc) EvalQuery added in v0.7.0

EvalQuery return f(ctx, q).

type EntitlementPlanFeatureMutationRuleFunc added in v0.7.0

type EntitlementPlanFeatureMutationRuleFunc func(context.Context, *generated.EntitlementPlanFeatureMutation) error

The EntitlementPlanFeatureMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntitlementPlanFeatureMutationRuleFunc) EvalMutation added in v0.7.0

EvalMutation calls f(ctx, m).

type EntitlementPlanFeatureQueryRuleFunc added in v0.7.0

type EntitlementPlanFeatureQueryRuleFunc func(context.Context, *generated.EntitlementPlanFeatureQuery) error

The EntitlementPlanFeatureQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntitlementPlanFeatureQueryRuleFunc) EvalQuery added in v0.7.0

EvalQuery return f(ctx, q).

type EntitlementPlanHistoryMutationRuleFunc added in v0.7.0

type EntitlementPlanHistoryMutationRuleFunc func(context.Context, *generated.EntitlementPlanHistoryMutation) error

The EntitlementPlanHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntitlementPlanHistoryMutationRuleFunc) EvalMutation added in v0.7.0

EvalMutation calls f(ctx, m).

type EntitlementPlanHistoryQueryRuleFunc added in v0.7.0

type EntitlementPlanHistoryQueryRuleFunc func(context.Context, *generated.EntitlementPlanHistoryQuery) error

The EntitlementPlanHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntitlementPlanHistoryQueryRuleFunc) EvalQuery added in v0.7.0

EvalQuery return f(ctx, q).

type EntitlementPlanMutationRuleFunc added in v0.7.0

type EntitlementPlanMutationRuleFunc func(context.Context, *generated.EntitlementPlanMutation) error

The EntitlementPlanMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntitlementPlanMutationRuleFunc) EvalMutation added in v0.7.0

EvalMutation calls f(ctx, m).

type EntitlementPlanQueryRuleFunc added in v0.7.0

type EntitlementPlanQueryRuleFunc func(context.Context, *generated.EntitlementPlanQuery) error

The EntitlementPlanQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntitlementPlanQueryRuleFunc) EvalQuery added in v0.7.0

EvalQuery return f(ctx, q).

type EntitlementQueryRuleFunc

type EntitlementQueryRuleFunc func(context.Context, *generated.EntitlementQuery) error

The EntitlementQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntitlementQueryRuleFunc) EvalQuery

EvalQuery return f(ctx, q).

type EntityHistoryMutationRuleFunc added in v0.7.4

type EntityHistoryMutationRuleFunc func(context.Context, *generated.EntityHistoryMutation) error

The EntityHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntityHistoryMutationRuleFunc) EvalMutation added in v0.7.4

EvalMutation calls f(ctx, m).

type EntityHistoryQueryRuleFunc added in v0.7.4

type EntityHistoryQueryRuleFunc func(context.Context, *generated.EntityHistoryQuery) error

The EntityHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntityHistoryQueryRuleFunc) EvalQuery added in v0.7.4

EvalQuery return f(ctx, q).

type EntityMutationRuleFunc added in v0.7.4

type EntityMutationRuleFunc func(context.Context, *generated.EntityMutation) error

The EntityMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntityMutationRuleFunc) EvalMutation added in v0.7.4

EvalMutation calls f(ctx, m).

type EntityQueryRuleFunc added in v0.7.4

type EntityQueryRuleFunc func(context.Context, *generated.EntityQuery) error

The EntityQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntityQueryRuleFunc) EvalQuery added in v0.7.4

EvalQuery return f(ctx, q).

type EntityTypeHistoryMutationRuleFunc added in v0.7.4

type EntityTypeHistoryMutationRuleFunc func(context.Context, *generated.EntityTypeHistoryMutation) error

The EntityTypeHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntityTypeHistoryMutationRuleFunc) EvalMutation added in v0.7.4

EvalMutation calls f(ctx, m).

type EntityTypeHistoryQueryRuleFunc added in v0.7.4

type EntityTypeHistoryQueryRuleFunc func(context.Context, *generated.EntityTypeHistoryQuery) error

The EntityTypeHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntityTypeHistoryQueryRuleFunc) EvalQuery added in v0.7.4

EvalQuery return f(ctx, q).

type EntityTypeMutationRuleFunc added in v0.7.4

type EntityTypeMutationRuleFunc func(context.Context, *generated.EntityTypeMutation) error

The EntityTypeMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EntityTypeMutationRuleFunc) EvalMutation added in v0.7.4

EvalMutation calls f(ctx, m).

type EntityTypeQueryRuleFunc added in v0.7.4

type EntityTypeQueryRuleFunc func(context.Context, *generated.EntityTypeQuery) error

The EntityTypeQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EntityTypeQueryRuleFunc) EvalQuery added in v0.7.4

EvalQuery return f(ctx, q).

type EventHistoryMutationRuleFunc added in v0.5.0

type EventHistoryMutationRuleFunc func(context.Context, *generated.EventHistoryMutation) error

The EventHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EventHistoryMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type EventHistoryQueryRuleFunc added in v0.5.0

type EventHistoryQueryRuleFunc func(context.Context, *generated.EventHistoryQuery) error

The EventHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EventHistoryQueryRuleFunc) EvalQuery added in v0.5.0

EvalQuery return f(ctx, q).

type EventMutationRuleFunc added in v0.5.0

type EventMutationRuleFunc func(context.Context, *generated.EventMutation) error

The EventMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (EventMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type EventQueryRuleFunc added in v0.5.0

type EventQueryRuleFunc func(context.Context, *generated.EventQuery) error

The EventQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (EventQueryRuleFunc) EvalQuery added in v0.5.0

func (f EventQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error

EvalQuery return f(ctx, q).

type FeatureHistoryMutationRuleFunc added in v0.5.0

type FeatureHistoryMutationRuleFunc func(context.Context, *generated.FeatureHistoryMutation) error

The FeatureHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (FeatureHistoryMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type FeatureHistoryQueryRuleFunc added in v0.5.0

type FeatureHistoryQueryRuleFunc func(context.Context, *generated.FeatureHistoryQuery) error

The FeatureHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (FeatureHistoryQueryRuleFunc) EvalQuery added in v0.5.0

EvalQuery return f(ctx, q).

type FeatureMutationRuleFunc added in v0.5.0

type FeatureMutationRuleFunc func(context.Context, *generated.FeatureMutation) error

The FeatureMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (FeatureMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type FeatureQueryRuleFunc added in v0.5.0

type FeatureQueryRuleFunc func(context.Context, *generated.FeatureQuery) error

The FeatureQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (FeatureQueryRuleFunc) EvalQuery added in v0.5.0

EvalQuery return f(ctx, q).

type FileHistoryMutationRuleFunc added in v0.5.0

type FileHistoryMutationRuleFunc func(context.Context, *generated.FileHistoryMutation) error

The FileHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (FileHistoryMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type FileHistoryQueryRuleFunc added in v0.5.0

type FileHistoryQueryRuleFunc func(context.Context, *generated.FileHistoryQuery) error

The FileHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (FileHistoryQueryRuleFunc) EvalQuery added in v0.5.0

EvalQuery return f(ctx, q).

type FileMutationRuleFunc added in v0.5.0

type FileMutationRuleFunc func(context.Context, *generated.FileMutation) error

The FileMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (FileMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type FileQueryRuleFunc added in v0.5.0

type FileQueryRuleFunc func(context.Context, *generated.FileQuery) error

The FileQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (FileQueryRuleFunc) EvalQuery added in v0.5.0

func (f FileQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error

EvalQuery return f(ctx, q).

type Filter

type Filter interface {
	// Where applies a filter on the executed query/mutation.
	Where(entql.P)
}

Filter is the interface that wraps the Where function for filtering nodes in queries and mutations.

type FilterFunc

type FilterFunc func(context.Context, Filter) error

The FilterFunc type is an adapter that allows the use of ordinary functions as filters for query and mutation types.

func (FilterFunc) EvalMutation

func (f FilterFunc) EvalMutation(ctx context.Context, m generated.Mutation) error

EvalMutation calls f(ctx, q) if the mutation implements the Filter interface, otherwise it is denied.

func (FilterFunc) EvalQuery

func (f FilterFunc) EvalQuery(ctx context.Context, q generated.Query) error

EvalQuery calls f(ctx, q) if the query implements the Filter interface, otherwise it is denied.

type GroupHistoryMutationRuleFunc added in v0.4.5

type GroupHistoryMutationRuleFunc func(context.Context, *generated.GroupHistoryMutation) error

The GroupHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (GroupHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type GroupHistoryQueryRuleFunc added in v0.4.5

type GroupHistoryQueryRuleFunc func(context.Context, *generated.GroupHistoryQuery) error

The GroupHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (GroupHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type GroupMembershipHistoryMutationRuleFunc added in v0.4.5

type GroupMembershipHistoryMutationRuleFunc func(context.Context, *generated.GroupMembershipHistoryMutation) error

The GroupMembershipHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (GroupMembershipHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type GroupMembershipHistoryQueryRuleFunc added in v0.4.5

type GroupMembershipHistoryQueryRuleFunc func(context.Context, *generated.GroupMembershipHistoryQuery) error

The GroupMembershipHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (GroupMembershipHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type GroupMembershipMutationRuleFunc added in v0.2.4

type GroupMembershipMutationRuleFunc func(context.Context, *generated.GroupMembershipMutation) error

The GroupMembershipMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (GroupMembershipMutationRuleFunc) EvalMutation added in v0.2.4

EvalMutation calls f(ctx, m).

type GroupMembershipQueryRuleFunc added in v0.2.4

type GroupMembershipQueryRuleFunc func(context.Context, *generated.GroupMembershipQuery) error

The GroupMembershipQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (GroupMembershipQueryRuleFunc) EvalQuery added in v0.2.4

EvalQuery return f(ctx, q).

type GroupMutationRuleFunc

type GroupMutationRuleFunc func(context.Context, *generated.GroupMutation) error

The GroupMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (GroupMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type GroupQueryRuleFunc

type GroupQueryRuleFunc func(context.Context, *generated.GroupQuery) error

The GroupQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (GroupQueryRuleFunc) EvalQuery

func (f GroupQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error

EvalQuery return f(ctx, q).

type GroupSettingHistoryMutationRuleFunc added in v0.4.5

type GroupSettingHistoryMutationRuleFunc func(context.Context, *generated.GroupSettingHistoryMutation) error

The GroupSettingHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (GroupSettingHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type GroupSettingHistoryQueryRuleFunc added in v0.4.5

type GroupSettingHistoryQueryRuleFunc func(context.Context, *generated.GroupSettingHistoryQuery) error

The GroupSettingHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (GroupSettingHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type GroupSettingMutationRuleFunc

type GroupSettingMutationRuleFunc func(context.Context, *generated.GroupSettingMutation) error

The GroupSettingMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (GroupSettingMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type GroupSettingQueryRuleFunc

type GroupSettingQueryRuleFunc func(context.Context, *generated.GroupSettingQuery) error

The GroupSettingQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (GroupSettingQueryRuleFunc) EvalQuery

EvalQuery return f(ctx, q).

type HushHistoryMutationRuleFunc added in v0.5.0

type HushHistoryMutationRuleFunc func(context.Context, *generated.HushHistoryMutation) error

The HushHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (HushHistoryMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type HushHistoryQueryRuleFunc added in v0.5.0

type HushHistoryQueryRuleFunc func(context.Context, *generated.HushHistoryQuery) error

The HushHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (HushHistoryQueryRuleFunc) EvalQuery added in v0.5.0

EvalQuery return f(ctx, q).

type HushMutationRuleFunc added in v0.5.0

type HushMutationRuleFunc func(context.Context, *generated.HushMutation) error

The HushMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (HushMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type HushQueryRuleFunc added in v0.5.0

type HushQueryRuleFunc func(context.Context, *generated.HushQuery) error

The HushQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (HushQueryRuleFunc) EvalQuery added in v0.5.0

func (f HushQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error

EvalQuery return f(ctx, q).

type IntegrationHistoryMutationRuleFunc added in v0.4.5

type IntegrationHistoryMutationRuleFunc func(context.Context, *generated.IntegrationHistoryMutation) error

The IntegrationHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (IntegrationHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type IntegrationHistoryQueryRuleFunc added in v0.4.5

type IntegrationHistoryQueryRuleFunc func(context.Context, *generated.IntegrationHistoryQuery) error

The IntegrationHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (IntegrationHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type IntegrationMutationRuleFunc

type IntegrationMutationRuleFunc func(context.Context, *generated.IntegrationMutation) error

The IntegrationMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (IntegrationMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type IntegrationQueryRuleFunc

type IntegrationQueryRuleFunc func(context.Context, *generated.IntegrationQuery) error

The IntegrationQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (IntegrationQueryRuleFunc) EvalQuery

EvalQuery return f(ctx, q).

type InviteMutationRuleFunc added in v0.2.6

type InviteMutationRuleFunc func(context.Context, *generated.InviteMutation) error

The InviteMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (InviteMutationRuleFunc) EvalMutation added in v0.2.6

EvalMutation calls f(ctx, m).

type InviteQueryRuleFunc added in v0.2.6

type InviteQueryRuleFunc func(context.Context, *generated.InviteQuery) error

The InviteQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (InviteQueryRuleFunc) EvalQuery added in v0.2.6

EvalQuery return f(ctx, q).

type MutationPolicy

type MutationPolicy = privacy.MutationPolicy

MutationPolicy combines multiple mutation rules into a single policy.

type MutationRule

type MutationRule = privacy.MutationRule

MutationRule defines the interface which decides whether a mutation is allowed and optionally modifies it.

func DenyMutationOperationRule

func DenyMutationOperationRule(op generated.Op) MutationRule

DenyMutationOperationRule returns a rule denying specified mutation operation.

func OnMutationOperation

func OnMutationOperation(rule MutationRule, op generated.Op) MutationRule

OnMutationOperation evaluates the given rule only on a given mutation operation.

type MutationRuleFunc

type MutationRuleFunc = privacy.MutationRuleFunc

MutationRuleFunc type is an adapter which allows the use of ordinary functions as mutation rules.

type NoteHistoryMutationRuleFunc added in v0.7.10

type NoteHistoryMutationRuleFunc func(context.Context, *generated.NoteHistoryMutation) error

The NoteHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (NoteHistoryMutationRuleFunc) EvalMutation added in v0.7.10

EvalMutation calls f(ctx, m).

type NoteHistoryQueryRuleFunc added in v0.7.10

type NoteHistoryQueryRuleFunc func(context.Context, *generated.NoteHistoryQuery) error

The NoteHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (NoteHistoryQueryRuleFunc) EvalQuery added in v0.7.10

EvalQuery return f(ctx, q).

type NoteMutationRuleFunc added in v0.7.10

type NoteMutationRuleFunc func(context.Context, *generated.NoteMutation) error

The NoteMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (NoteMutationRuleFunc) EvalMutation added in v0.7.10

EvalMutation calls f(ctx, m).

type NoteQueryRuleFunc added in v0.7.10

type NoteQueryRuleFunc func(context.Context, *generated.NoteQuery) error

The NoteQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (NoteQueryRuleFunc) EvalQuery added in v0.7.10

func (f NoteQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error

EvalQuery return f(ctx, q).

type OauthProviderHistoryMutationRuleFunc added in v0.4.5

type OauthProviderHistoryMutationRuleFunc func(context.Context, *generated.OauthProviderHistoryMutation) error

The OauthProviderHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (OauthProviderHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type OauthProviderHistoryQueryRuleFunc added in v0.4.5

type OauthProviderHistoryQueryRuleFunc func(context.Context, *generated.OauthProviderHistoryQuery) error

The OauthProviderHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (OauthProviderHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type OauthProviderMutationRuleFunc

type OauthProviderMutationRuleFunc func(context.Context, *generated.OauthProviderMutation) error

The OauthProviderMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (OauthProviderMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type OauthProviderQueryRuleFunc

type OauthProviderQueryRuleFunc func(context.Context, *generated.OauthProviderQuery) error

The OauthProviderQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (OauthProviderQueryRuleFunc) EvalQuery

EvalQuery return f(ctx, q).

type OhAuthTooTokenMutationRuleFunc

type OhAuthTooTokenMutationRuleFunc func(context.Context, *generated.OhAuthTooTokenMutation) error

The OhAuthTooTokenMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (OhAuthTooTokenMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type OhAuthTooTokenQueryRuleFunc

type OhAuthTooTokenQueryRuleFunc func(context.Context, *generated.OhAuthTooTokenQuery) error

The OhAuthTooTokenQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (OhAuthTooTokenQueryRuleFunc) EvalQuery

EvalQuery return f(ctx, q).

type OrgMembershipHistoryMutationRuleFunc added in v0.4.5

type OrgMembershipHistoryMutationRuleFunc func(context.Context, *generated.OrgMembershipHistoryMutation) error

The OrgMembershipHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (OrgMembershipHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type OrgMembershipHistoryQueryRuleFunc added in v0.4.5

type OrgMembershipHistoryQueryRuleFunc func(context.Context, *generated.OrgMembershipHistoryQuery) error

The OrgMembershipHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (OrgMembershipHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type OrgMembershipMutationRuleFunc added in v0.2.4

type OrgMembershipMutationRuleFunc func(context.Context, *generated.OrgMembershipMutation) error

The OrgMembershipMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (OrgMembershipMutationRuleFunc) EvalMutation added in v0.2.4

EvalMutation calls f(ctx, m).

type OrgMembershipQueryRuleFunc added in v0.2.4

type OrgMembershipQueryRuleFunc func(context.Context, *generated.OrgMembershipQuery) error

The OrgMembershipQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (OrgMembershipQueryRuleFunc) EvalQuery added in v0.2.4

EvalQuery return f(ctx, q).

type OrganizationHistoryMutationRuleFunc added in v0.4.3

type OrganizationHistoryMutationRuleFunc func(context.Context, *generated.OrganizationHistoryMutation) error

The OrganizationHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (OrganizationHistoryMutationRuleFunc) EvalMutation added in v0.4.3

EvalMutation calls f(ctx, m).

type OrganizationHistoryQueryRuleFunc added in v0.4.3

type OrganizationHistoryQueryRuleFunc func(context.Context, *generated.OrganizationHistoryQuery) error

The OrganizationHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (OrganizationHistoryQueryRuleFunc) EvalQuery added in v0.4.3

EvalQuery return f(ctx, q).

type OrganizationMutationRuleFunc

type OrganizationMutationRuleFunc func(context.Context, *generated.OrganizationMutation) error

The OrganizationMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (OrganizationMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type OrganizationQueryRuleFunc

type OrganizationQueryRuleFunc func(context.Context, *generated.OrganizationQuery) error

The OrganizationQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (OrganizationQueryRuleFunc) EvalQuery

EvalQuery return f(ctx, q).

type OrganizationSettingHistoryMutationRuleFunc added in v0.4.3

type OrganizationSettingHistoryMutationRuleFunc func(context.Context, *generated.OrganizationSettingHistoryMutation) error

The OrganizationSettingHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (OrganizationSettingHistoryMutationRuleFunc) EvalMutation added in v0.4.3

EvalMutation calls f(ctx, m).

type OrganizationSettingHistoryQueryRuleFunc added in v0.4.3

type OrganizationSettingHistoryQueryRuleFunc func(context.Context, *generated.OrganizationSettingHistoryQuery) error

The OrganizationSettingHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (OrganizationSettingHistoryQueryRuleFunc) EvalQuery added in v0.4.3

EvalQuery return f(ctx, q).

type OrganizationSettingMutationRuleFunc

type OrganizationSettingMutationRuleFunc func(context.Context, *generated.OrganizationSettingMutation) error

The OrganizationSettingMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (OrganizationSettingMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type OrganizationSettingQueryRuleFunc

type OrganizationSettingQueryRuleFunc func(context.Context, *generated.OrganizationSettingQuery) error

The OrganizationSettingQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (OrganizationSettingQueryRuleFunc) EvalQuery

EvalQuery return f(ctx, q).

type PasswordResetTokenMutationRuleFunc added in v0.2.3

type PasswordResetTokenMutationRuleFunc func(context.Context, *generated.PasswordResetTokenMutation) error

The PasswordResetTokenMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (PasswordResetTokenMutationRuleFunc) EvalMutation added in v0.2.3

EvalMutation calls f(ctx, m).

type PasswordResetTokenQueryRuleFunc added in v0.2.3

type PasswordResetTokenQueryRuleFunc func(context.Context, *generated.PasswordResetTokenQuery) error

The PasswordResetTokenQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (PasswordResetTokenQueryRuleFunc) EvalQuery added in v0.2.3

EvalQuery return f(ctx, q).

type PersonalAccessTokenMutationRuleFunc

type PersonalAccessTokenMutationRuleFunc func(context.Context, *generated.PersonalAccessTokenMutation) error

The PersonalAccessTokenMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (PersonalAccessTokenMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type PersonalAccessTokenQueryRuleFunc

type PersonalAccessTokenQueryRuleFunc func(context.Context, *generated.PersonalAccessTokenQuery) error

The PersonalAccessTokenQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (PersonalAccessTokenQueryRuleFunc) EvalQuery

EvalQuery return f(ctx, q).

type Policy

type Policy = privacy.Policy

Policy groups query and mutation policies.

type QueryMutationRule

type QueryMutationRule = privacy.QueryMutationRule

QueryMutationRule is an interface which groups query and mutation rules.

func AlwaysAllowRule

func AlwaysAllowRule() QueryMutationRule

AlwaysAllowRule returns a rule that returns an allow decision.

func AlwaysDenyRule

func AlwaysDenyRule() QueryMutationRule

AlwaysDenyRule returns a rule that returns a deny decision.

func ContextQueryMutationRule

func ContextQueryMutationRule(eval func(context.Context) error) QueryMutationRule

ContextQueryMutationRule creates a query/mutation rule from a context eval func.

type QueryPolicy

type QueryPolicy = privacy.QueryPolicy

QueryPolicy combines multiple query rules into a single policy.

type QueryRule

type QueryRule = privacy.QueryRule

QueryRule defines the interface deciding whether a query is allowed and optionally modify it.

type QueryRuleFunc

type QueryRuleFunc func(context.Context, generated.Query) error

QueryRuleFunc type is an adapter to allow the use of ordinary functions as query rules.

func (QueryRuleFunc) EvalQuery

func (f QueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error

Eval returns f(ctx, q).

type SubscriberMutationRuleFunc added in v0.3.6

type SubscriberMutationRuleFunc func(context.Context, *generated.SubscriberMutation) error

The SubscriberMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (SubscriberMutationRuleFunc) EvalMutation added in v0.3.6

EvalMutation calls f(ctx, m).

type SubscriberQueryRuleFunc added in v0.3.6

type SubscriberQueryRuleFunc func(context.Context, *generated.SubscriberQuery) error

The SubscriberQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (SubscriberQueryRuleFunc) EvalQuery added in v0.3.6

EvalQuery return f(ctx, q).

type TFASettingMutationRuleFunc added in v0.4.4

type TFASettingMutationRuleFunc func(context.Context, *generated.TFASettingMutation) error

The TFASettingMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (TFASettingMutationRuleFunc) EvalMutation added in v0.4.4

EvalMutation calls f(ctx, m).

type TFASettingQueryRuleFunc added in v0.4.4

type TFASettingQueryRuleFunc func(context.Context, *generated.TFASettingQuery) error

The TFASettingQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (TFASettingQueryRuleFunc) EvalQuery added in v0.4.4

EvalQuery return f(ctx, q).

type TemplateHistoryMutationRuleFunc added in v0.4.5

type TemplateHistoryMutationRuleFunc func(context.Context, *generated.TemplateHistoryMutation) error

The TemplateHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (TemplateHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type TemplateHistoryQueryRuleFunc added in v0.4.5

type TemplateHistoryQueryRuleFunc func(context.Context, *generated.TemplateHistoryQuery) error

The TemplateHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (TemplateHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type TemplateMutationRuleFunc added in v0.4.3

type TemplateMutationRuleFunc func(context.Context, *generated.TemplateMutation) error

The TemplateMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (TemplateMutationRuleFunc) EvalMutation added in v0.4.3

EvalMutation calls f(ctx, m).

type TemplateQueryRuleFunc added in v0.4.3

type TemplateQueryRuleFunc func(context.Context, *generated.TemplateQuery) error

The TemplateQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (TemplateQueryRuleFunc) EvalQuery added in v0.4.3

EvalQuery return f(ctx, q).

type UserHistoryMutationRuleFunc added in v0.4.5

type UserHistoryMutationRuleFunc func(context.Context, *generated.UserHistoryMutation) error

The UserHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (UserHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type UserHistoryQueryRuleFunc added in v0.4.5

type UserHistoryQueryRuleFunc func(context.Context, *generated.UserHistoryQuery) error

The UserHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (UserHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type UserMutationRuleFunc

type UserMutationRuleFunc func(context.Context, *generated.UserMutation) error

The UserMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (UserMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type UserQueryRuleFunc

type UserQueryRuleFunc func(context.Context, *generated.UserQuery) error

The UserQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (UserQueryRuleFunc) EvalQuery

func (f UserQueryRuleFunc) EvalQuery(ctx context.Context, q generated.Query) error

EvalQuery return f(ctx, q).

type UserSettingHistoryMutationRuleFunc added in v0.4.5

type UserSettingHistoryMutationRuleFunc func(context.Context, *generated.UserSettingHistoryMutation) error

The UserSettingHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (UserSettingHistoryMutationRuleFunc) EvalMutation added in v0.4.5

EvalMutation calls f(ctx, m).

type UserSettingHistoryQueryRuleFunc added in v0.4.5

type UserSettingHistoryQueryRuleFunc func(context.Context, *generated.UserSettingHistoryQuery) error

The UserSettingHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (UserSettingHistoryQueryRuleFunc) EvalQuery added in v0.4.5

EvalQuery return f(ctx, q).

type UserSettingMutationRuleFunc

type UserSettingMutationRuleFunc func(context.Context, *generated.UserSettingMutation) error

The UserSettingMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (UserSettingMutationRuleFunc) EvalMutation

EvalMutation calls f(ctx, m).

type UserSettingQueryRuleFunc

type UserSettingQueryRuleFunc func(context.Context, *generated.UserSettingQuery) error

The UserSettingQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (UserSettingQueryRuleFunc) EvalQuery

EvalQuery return f(ctx, q).

type WebauthnMutationRuleFunc added in v0.3.0

type WebauthnMutationRuleFunc func(context.Context, *generated.WebauthnMutation) error

The WebauthnMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (WebauthnMutationRuleFunc) EvalMutation added in v0.3.0

EvalMutation calls f(ctx, m).

type WebauthnQueryRuleFunc added in v0.3.0

type WebauthnQueryRuleFunc func(context.Context, *generated.WebauthnQuery) error

The WebauthnQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (WebauthnQueryRuleFunc) EvalQuery added in v0.3.0

EvalQuery return f(ctx, q).

type WebhookHistoryMutationRuleFunc added in v0.5.0

type WebhookHistoryMutationRuleFunc func(context.Context, *generated.WebhookHistoryMutation) error

The WebhookHistoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (WebhookHistoryMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type WebhookHistoryQueryRuleFunc added in v0.5.0

type WebhookHistoryQueryRuleFunc func(context.Context, *generated.WebhookHistoryQuery) error

The WebhookHistoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (WebhookHistoryQueryRuleFunc) EvalQuery added in v0.5.0

EvalQuery return f(ctx, q).

type WebhookMutationRuleFunc added in v0.5.0

type WebhookMutationRuleFunc func(context.Context, *generated.WebhookMutation) error

The WebhookMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.

func (WebhookMutationRuleFunc) EvalMutation added in v0.5.0

EvalMutation calls f(ctx, m).

type WebhookQueryRuleFunc added in v0.5.0

type WebhookQueryRuleFunc func(context.Context, *generated.WebhookQuery) error

The WebhookQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.

func (WebhookQueryRuleFunc) EvalQuery added in v0.5.0

EvalQuery return f(ctx, q).

Jump to

Keyboard shortcuts

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