Documentation ¶
Index ¶
- Variables
- func Allowf(format string, a ...any) error
- func DecisionContext(parent context.Context, decision error) context.Context
- func DecisionFromContext(ctx context.Context) (error, bool)
- func Denyf(format string, a ...any) error
- func Skipf(format string, a ...any) error
- type DocumentDataMutationRuleFunc
- type DocumentDataQueryRuleFunc
- type EmailVerificationTokenMutationRuleFunc
- type EmailVerificationTokenQueryRuleFunc
- type EntitlementMutationRuleFunc
- type EntitlementQueryRuleFunc
- type Filter
- type FilterFunc
- type GroupMembershipMutationRuleFunc
- type GroupMembershipQueryRuleFunc
- type GroupMutationRuleFunc
- type GroupQueryRuleFunc
- type GroupSettingMutationRuleFunc
- type GroupSettingQueryRuleFunc
- type IntegrationMutationRuleFunc
- type IntegrationQueryRuleFunc
- type InviteMutationRuleFunc
- type InviteQueryRuleFunc
- type MutationPolicy
- type MutationRule
- type MutationRuleFunc
- type OauthProviderMutationRuleFunc
- type OauthProviderQueryRuleFunc
- type OhAuthTooTokenMutationRuleFunc
- type OhAuthTooTokenQueryRuleFunc
- type OrgMembershipMutationRuleFunc
- type OrgMembershipQueryRuleFunc
- type OrganizationHistoryMutationRuleFunc
- type OrganizationHistoryQueryRuleFunc
- type OrganizationMutationRuleFunc
- type OrganizationQueryRuleFunc
- type OrganizationSettingHistoryMutationRuleFunc
- type OrganizationSettingHistoryQueryRuleFunc
- type OrganizationSettingMutationRuleFunc
- type OrganizationSettingQueryRuleFunc
- type PasswordResetTokenMutationRuleFunc
- type PasswordResetTokenQueryRuleFunc
- type PersonalAccessTokenMutationRuleFunc
- type PersonalAccessTokenQueryRuleFunc
- type Policy
- type QueryMutationRule
- type QueryPolicy
- type QueryRule
- type QueryRuleFunc
- type SubscriberMutationRuleFunc
- type SubscriberQueryRuleFunc
- type TFASettingMutationRuleFunc
- type TFASettingQueryRuleFunc
- type TemplateMutationRuleFunc
- type TemplateQueryRuleFunc
- type UserMutationRuleFunc
- type UserQueryRuleFunc
- type UserSettingMutationRuleFunc
- type UserSettingQueryRuleFunc
- type WebauthnMutationRuleFunc
- type WebauthnQueryRuleFunc
Constants ¶
This section is empty.
Variables ¶
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 DecisionContext ¶
DecisionContext creates a new context from the given parent context with a policy decision attach to it.
func DecisionFromContext ¶
DecisionFromContext retrieves the policy decision from the context.
Types ¶
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.
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
func (f EmailVerificationTokenMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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 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.
type Filter ¶
Filter is the interface that wraps the Where function for filtering nodes in queries and mutations.
type FilterFunc ¶
The FilterFunc type is an adapter that allows the use of ordinary functions as filters for query and mutation types.
func (FilterFunc) EvalMutation ¶
EvalMutation calls f(ctx, q) if the mutation implements the Filter interface, otherwise it is denied.
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
func (f GroupMembershipMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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.
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.
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.
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.
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 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 ¶
func (f OauthProviderMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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 ¶
func (f OhAuthTooTokenMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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
func (f OrgMembershipMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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
func (f OrganizationHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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.
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
func (f OrganizationSettingHistoryMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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 ¶
func (f OrganizationSettingMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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
func (f PasswordResetTokenMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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 ¶
func (f PersonalAccessTokenMutationRuleFunc) EvalMutation(ctx context.Context, m generated.Mutation) error
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.
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 ¶
QueryRule defines the interface deciding whether a query is allowed and optionally modify it.
type QueryRuleFunc ¶
QueryRuleFunc type is an adapter to allow the use of ordinary functions as query rules.
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.
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.
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.
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 ¶
The UserQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
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.
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.