forked from twistlock/authz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.go
executable file
·22 lines (19 loc) · 1.13 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package core
import "github.com/docker/docker/pkg/authorization"
// Authorizer handles the authorization of docker requests and responses
type Authorizer interface {
// Init initialize the authorizer
Init() error // Init initialize the handler
AuthZReq(req *authorization.Request) *authorization.Response // AuthZReq handles the request from docker client
// to docker daemon
AuthZRes(req *authorization.Request) *authorization.Response // AuthZRes handles the response from docker daemon to docker client
}
// Auditor audits the request and response sent from/to docker daemon
type Auditor interface {
// AuditRequest audit the request sent from docker client and the associated authorization response
// Docker client -> authorization -> audit -> Docker daemon
AuditRequest(req *authorization.Request, pluginRes *authorization.Response) error
// AuditRequest audit the response sent from docker daemon and the associated authorization response
// Docker daemon -> authorization -> audit -> Docker client
AuditResponse(req *authorization.Request, pluginRes *authorization.Response) error
}