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 CampusMutationRuleFunc
- type CampusQueryRuleFunc
- type CarrierFacilityMutationRuleFunc
- type CarrierFacilityQueryRuleFunc
- type CarrierMutationRuleFunc
- type CarrierQueryRuleFunc
- type FacilityMutationRuleFunc
- type FacilityQueryRuleFunc
- type InternetExchangeMutationRuleFunc
- type InternetExchangeQueryRuleFunc
- type IxFacilityMutationRuleFunc
- type IxFacilityQueryRuleFunc
- type IxLanMutationRuleFunc
- type IxLanQueryRuleFunc
- type IxPrefixMutationRuleFunc
- type IxPrefixQueryRuleFunc
- type MutationPolicy
- type MutationRule
- type MutationRuleFunc
- type NetworkFacilityMutationRuleFunc
- type NetworkFacilityQueryRuleFunc
- type NetworkIxLanMutationRuleFunc
- type NetworkIxLanQueryRuleFunc
- type NetworkMutationRuleFunc
- type NetworkQueryRuleFunc
- type OrganizationMutationRuleFunc
- type OrganizationQueryRuleFunc
- type PocMutationRuleFunc
- type PocQueryRuleFunc
- type Policy
- type QueryMutationRule
- type QueryPolicy
- type QueryRule
- type QueryRuleFunc
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 CampusMutationRuleFunc ¶
type CampusMutationRuleFunc func(context.Context, *ent.CampusMutation) error
The CampusMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (CampusMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type CampusQueryRuleFunc ¶
type CampusQueryRuleFunc func(context.Context, *ent.CampusQuery) error
The CampusQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type CarrierFacilityMutationRuleFunc ¶
type CarrierFacilityMutationRuleFunc func(context.Context, *ent.CarrierFacilityMutation) error
The CarrierFacilityMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (CarrierFacilityMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type CarrierFacilityQueryRuleFunc ¶
type CarrierFacilityQueryRuleFunc func(context.Context, *ent.CarrierFacilityQuery) error
The CarrierFacilityQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type CarrierMutationRuleFunc ¶
type CarrierMutationRuleFunc func(context.Context, *ent.CarrierMutation) error
The CarrierMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (CarrierMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type CarrierQueryRuleFunc ¶
type CarrierQueryRuleFunc func(context.Context, *ent.CarrierQuery) error
The CarrierQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type FacilityMutationRuleFunc ¶
type FacilityMutationRuleFunc func(context.Context, *ent.FacilityMutation) error
The FacilityMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (FacilityMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type FacilityQueryRuleFunc ¶
type FacilityQueryRuleFunc func(context.Context, *ent.FacilityQuery) error
The FacilityQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type InternetExchangeMutationRuleFunc ¶
type InternetExchangeMutationRuleFunc func(context.Context, *ent.InternetExchangeMutation) error
The InternetExchangeMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (InternetExchangeMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type InternetExchangeQueryRuleFunc ¶
type InternetExchangeQueryRuleFunc func(context.Context, *ent.InternetExchangeQuery) error
The InternetExchangeQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type IxFacilityMutationRuleFunc ¶
type IxFacilityMutationRuleFunc func(context.Context, *ent.IxFacilityMutation) error
The IxFacilityMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (IxFacilityMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type IxFacilityQueryRuleFunc ¶
type IxFacilityQueryRuleFunc func(context.Context, *ent.IxFacilityQuery) error
The IxFacilityQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type IxLanMutationRuleFunc ¶
type IxLanMutationRuleFunc func(context.Context, *ent.IxLanMutation) error
The IxLanMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (IxLanMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type IxLanQueryRuleFunc ¶
type IxLanQueryRuleFunc func(context.Context, *ent.IxLanQuery) error
The IxLanQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type IxPrefixMutationRuleFunc ¶
type IxPrefixMutationRuleFunc func(context.Context, *ent.IxPrefixMutation) error
The IxPrefixMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (IxPrefixMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type IxPrefixQueryRuleFunc ¶
type IxPrefixQueryRuleFunc func(context.Context, *ent.IxPrefixQuery) error
The IxPrefixQueryRuleFunc 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 ent.Op) MutationRule
DenyMutationOperationRule returns a rule denying specified mutation operation.
func OnMutationOperation ¶
func OnMutationOperation(rule MutationRule, op ent.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 NetworkFacilityMutationRuleFunc ¶
type NetworkFacilityMutationRuleFunc func(context.Context, *ent.NetworkFacilityMutation) error
The NetworkFacilityMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (NetworkFacilityMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type NetworkFacilityQueryRuleFunc ¶
type NetworkFacilityQueryRuleFunc func(context.Context, *ent.NetworkFacilityQuery) error
The NetworkFacilityQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type NetworkIxLanMutationRuleFunc ¶
type NetworkIxLanMutationRuleFunc func(context.Context, *ent.NetworkIxLanMutation) error
The NetworkIxLanMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (NetworkIxLanMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type NetworkIxLanQueryRuleFunc ¶
type NetworkIxLanQueryRuleFunc func(context.Context, *ent.NetworkIxLanQuery) error
The NetworkIxLanQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type NetworkMutationRuleFunc ¶
type NetworkMutationRuleFunc func(context.Context, *ent.NetworkMutation) error
The NetworkMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (NetworkMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type NetworkQueryRuleFunc ¶
type NetworkQueryRuleFunc func(context.Context, *ent.NetworkQuery) error
The NetworkQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type OrganizationMutationRuleFunc ¶
type OrganizationMutationRuleFunc func(context.Context, *ent.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, *ent.OrganizationQuery) error
The OrganizationQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type PocMutationRuleFunc ¶
type PocMutationRuleFunc func(context.Context, *ent.PocMutation) error
The PocMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (PocMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type PocQueryRuleFunc ¶
The PocQueryRuleFunc 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.