# README
Docker authorization extension api.
Go handler to create external authorization extensions for Docker.
Usage
This library is designed to be integrated in your program.
- Implement the
authorization.Plugin
interface. - Initialize a
authorization.Handler
with your implementation. - Call either
ServeTCP
orServeUnix
from theauthorization.Handler
.
Example using TCP sockets:
p := MyAuthZPlugin{}
h := authorization.NewHandler(p)
h.ServeTCP("test_plugin", ":8080")
Example using Unix sockets:
p := MyAuthZPlugin{}
h := authorization.NewHandler(p)
u, _ := user.Lookup("root")
gid, _ := strconv.Atoi(u.Gid)
h.ServeUnix("test_plugin", gid)
Full example plugins
- https://github.com/projectatomic/docker-novolume-plugin
- https://github.com/cpdevws/img-authz-plugin
- https://github.com/casbin/casbin-authz-plugin
- https://github.com/kassisol/hbm
- https://github.com/leogr/docker-authz-plugin
License
MIT
# Functions
NewHandler initializes the request handler with a plugin implementation.
# Constants
AuthZApiImplements is the name of the interface all AuthZ plugins implement.
AuthZApiRequest is the url for daemon request authorization.
AuthZApiResponse is the url for daemon response authorization.
# Interfaces
Plugin represent the interface a plugin must fulfill.
# Type aliases
PeerCertificate is a wrapper around x509.Certificate which provides a sane encoding/decoding to/from PEM format and JSON.