-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaliases.go
More file actions
74 lines (65 loc) · 2.62 KB
/
Copy pathaliases.go
File metadata and controls
74 lines (65 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// SPDX-License-Identifier: AGPL-3.0-or-later
package policy
import (
"github.com/pilot-protocol/policy/policylang"
)
// Re-exports of the pure policy lang (parser, validator, compiler,
// evaluator, types). Lives in internal/policy so cmd/pilotctl can call
// it without importing the L11 plugin package. plugins/policy keeps
// the daemon-side runner, runtime, peer-eviction logic, and L11
// Service shell.
// Document/version aliases.
type (
PolicyDocument = policylang.PolicyDocument
Rule = policylang.Rule
Action = policylang.Action
ActionType = policylang.ActionType
EventType = policylang.EventType
Directive = policylang.Directive
DirectiveType = policylang.DirectiveType
CompiledPolicy = policylang.CompiledPolicy
)
// Version is the policy schema version.
const Version = policylang.Version
// EventType constants.
const (
EventConnect = policylang.EventConnect
EventDial = policylang.EventDial
EventDatagram = policylang.EventDatagram
EventCycle = policylang.EventCycle
EventJoin = policylang.EventJoin
EventLeave = policylang.EventLeave
)
// ActionType constants.
const (
ActionAllow = policylang.ActionAllow
ActionDeny = policylang.ActionDeny
ActionTag = policylang.ActionTag
ActionEvict = policylang.ActionEvict
ActionEvictWhere = policylang.ActionEvictWhere
ActionPrune = policylang.ActionPrune
ActionFill = policylang.ActionFill
ActionPruneTrust = policylang.ActionPruneTrust
ActionFillTrust = policylang.ActionFillTrust
ActionWebhook = policylang.ActionWebhook
ActionLog = policylang.ActionLog
)
// DirectiveType constants.
const (
DirectiveAllow = policylang.DirectiveAllow
DirectiveDeny = policylang.DirectiveDeny
DirectiveTag = policylang.DirectiveTag
DirectiveEvict = policylang.DirectiveEvict
DirectiveEvictWhere = policylang.DirectiveEvictWhere
DirectivePrune = policylang.DirectivePrune
DirectiveFill = policylang.DirectiveFill
DirectivePruneTrust = policylang.DirectivePruneTrust
DirectiveFillTrust = policylang.DirectiveFillTrust
DirectiveWebhook = policylang.DirectiveWebhook
DirectiveLog = policylang.DirectiveLog
)
// Lang free-function re-exports. Functions can't be aliased — wrap.
func Parse(data []byte) (*PolicyDocument, error) { return policylang.Parse(data) }
func Validate(doc *PolicyDocument) error { return policylang.Validate(doc) }
func Compile(doc *PolicyDocument) (*CompiledPolicy, error) { return policylang.Compile(doc) }
func IsGateEvent(e EventType) bool { return policylang.IsGateEvent(e) }