dkauthz

package module
v0.0.0-...-a0e1403 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2016 License: MIT Imports: 9 Imported by: 3

README

REPOSITORY MOVED TO https://github.com/docker/go-plugins-helpers/tree/master/authz

Credits

Inspired by David's awesome dkvolume and adapted for the authZ api.

Docker authz extension api.

Go handler to create external authz extensions for Docker.

Usage

This library is designed to be integrated in your program.

  1. Implement the dkauthz.Plugin interface.
  2. Initialize a dkauthz.Handler with your implementation.
  3. Call either ServeTCP or ServeUnix from the dkauthz.Handler.
Example using TCP sockets:
  p := MyAuthZPlugin{}
  h := dkauthz.NewHandler(p)
  h.ServeTCP("test_plugin", ":8080")
Example using Unix sockets:
  p := MyAuthZPlugin{}
  h := dkauthz.NewHandler(p)
  h.ServeUnix("root", "test_plugin")

Full example plugins

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler forwards requests and responses between the docker daemon and the plugin.

func NewHandler

func NewHandler(plugin Plugin) *Handler

NewHandler initializes the request handler with a plugin implementation.

func (*Handler) ServeTCP

func (h *Handler) ServeTCP(pluginName, addr string) error

ServeTCP makes the handler to listen for request in a given TCP address. It also writes the spec file on the right directory for docker to read.

func (*Handler) ServeUnix

func (h *Handler) ServeUnix(systemGroup, addr string) error

ServeUnix makes the handler to listen for requests in a unix socket. It also creates the socket file on the right directory for docker to read.

type Plugin

type Plugin interface {
	AuthZReq(Request) Response
	AuthZRes(Request) Response
}

Plugin represent the interface a plugin must fulfill.

type Request

type Request authorization.Request

type Response

type Response authorization.Response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL