/
audit.go
39 lines (31 loc) · 985 Bytes
/
audit.go
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
// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package audit // import "gopkg.in/juju/charmstore.v5/audit"
import (
"time"
"gopkg.in/juju/charm.v6"
)
// Operation represents the type of an entry.
type Operation string
const (
// OpSetPerm represents the setting of ACLs on an entity.
// Required fields: Entity, ACL
OpSetPerm Operation = "set-perm"
// OpPromulgate, OpUnpromulgate represent the promulgation on an entity.
// Required fields: Entity
OpPromulgate Operation = "promulgate"
OpUnpromulgate Operation = "unpromulgate"
)
// ACL represents an access control list.
type ACL struct {
Read []string `json:"read,omitempty"`
Write []string `json:"write,omitempty"`
}
// Entry represents an audit log entry.
type Entry struct {
Time time.Time `json:"time"`
User string `json:"user"`
Op Operation `json:"op"`
Entity *charm.URL `json:"entity,omitempty"`
ACL *ACL `json:"acl,omitempty"`
}