Browse code

Rename authz to authorization for greater clarity

Signed-off-by: Tibor Vass <tibor@docker.com>

Tibor Vass authored on 2016/01/13 09:38:18
Showing 11 changed files
... ...
@@ -169,8 +169,8 @@ func (s *Server) handleWithGlobalMiddlewares(handler httputils.APIFunc) httputil
169 169
 		middlewares = append(middlewares, debugRequestMiddleware)
170 170
 	}
171 171
 
172
-	if len(s.cfg.AuthZPluginNames) > 0 {
173
-		s.authZPlugins = authorization.NewPlugins(s.cfg.AuthZPluginNames)
172
+	if len(s.cfg.AuthorizationPluginNames) > 0 {
173
+		s.authZPlugins = authorization.NewPlugins(s.cfg.AuthorizationPluginNames)
174 174
 		middlewares = append(middlewares, s.authorizationMiddleware)
175 175
 	}
176 176
 
... ...
@@ -30,14 +30,14 @@ const versionMatcher = "/v{version:[0-9.]+}"
30 30
 
31 31
 // Config provides the configuration for the API server
32 32
 type Config struct {
33
-	Logging          bool
34
-	EnableCors       bool
35
-	CorsHeaders      string
36
-	AuthZPluginNames []string
37
-	Version          string
38
-	SocketGroup      string
39
-	TLSConfig        *tls.Config
40
-	Addrs            []Addr
33
+	Logging                  bool
34
+	EnableCors               bool
35
+	CorsHeaders              string
36
+	AuthorizationPluginNames []string
37
+	Version                  string
38
+	SocketGroup              string
39
+	TLSConfig                *tls.Config
40
+	Addrs                    []Addr
41 41
 }
42 42
 
43 43
 // Server contains instance details for the server
... ...
@@ -685,7 +685,7 @@ _docker_daemon() {
685 685
 	local options_with_args="
686 686
 		$global_options_with_args
687 687
 		--api-cors-header
688
-		--authz-plugin
688
+		--authorization-plugin
689 689
 		--bip
690 690
 		--bridge -b
691 691
 		--cgroup-parent
... ...
@@ -717,7 +717,7 @@ _docker_daemon() {
717 717
 	"
718 718
 
719 719
 	case "$prev" in
720
-		--authz-plugin)
720
+		--authorization-plugin)
721 721
 			__docker_complete_plugins Authorization
722 722
 			return
723 723
 			;;
... ...
@@ -590,7 +590,7 @@ __docker_subcommand() {
590 590
             _arguments $(__docker_arguments) \
591 591
                 $opts_help \
592 592
                 "($help)--api-cors-header=[Set CORS headers in the remote API]:CORS headers: " \
593
-                "($help)*--authz-plugin=[Set authorization plugins to load]" \
593
+                "($help)*--authorization-plugin=[Set authorization plugins to load]" \
594 594
                 "($help -b --bridge)"{-b=,--bridge=}"[Attach containers to a network bridge]:bridge:_net_interfaces" \
595 595
                 "($help)--bip=[Specify network bridge IP]" \
596 596
                 "($help)--cgroup-parent=[Set parent cgroup for all containers]:cgroup: " \
... ...
@@ -14,25 +14,25 @@ const (
14 14
 // CommonConfig defines the configuration of a docker daemon which are
15 15
 // common across platforms.
16 16
 type CommonConfig struct {
17
-	AuthZPlugins  []string // AuthZPlugins holds list of authorization plugins
18
-	AutoRestart   bool
19
-	Bridge        bridgeConfig // Bridge holds bridge network specific configuration.
20
-	Context       map[string][]string
21
-	DisableBridge bool
22
-	DNS           []string
23
-	DNSOptions    []string
24
-	DNSSearch     []string
25
-	ExecOptions   []string
26
-	ExecRoot      string
27
-	GraphDriver   string
28
-	GraphOptions  []string
29
-	Labels        []string
30
-	LogConfig     container.LogConfig
31
-	Mtu           int
32
-	Pidfile       string
33
-	RemappedRoot  string
34
-	Root          string
35
-	TrustKeyPath  string
17
+	AuthorizationPlugins []string // AuthorizationPlugins holds list of authorization plugins
18
+	AutoRestart          bool
19
+	Bridge               bridgeConfig // Bridge holds bridge network specific configuration.
20
+	Context              map[string][]string
21
+	DisableBridge        bool
22
+	DNS                  []string
23
+	DNSOptions           []string
24
+	DNSSearch            []string
25
+	ExecOptions          []string
26
+	ExecRoot             string
27
+	GraphDriver          string
28
+	GraphOptions         []string
29
+	Labels               []string
30
+	LogConfig            container.LogConfig
31
+	Mtu                  int
32
+	Pidfile              string
33
+	RemappedRoot         string
34
+	Root                 string
35
+	TrustKeyPath         string
36 36
 
37 37
 	// ClusterStore is the storage backend used for the cluster information. It is used by both
38 38
 	// multihost networking (to store networks and endpoints information) and by the node discovery
... ...
@@ -55,7 +55,7 @@ type CommonConfig struct {
55 55
 // from the command-line.
56 56
 func (config *Config) InstallCommonFlags(cmd *flag.FlagSet, usageFn func(string) string) {
57 57
 	cmd.Var(opts.NewListOptsRef(&config.GraphOptions, nil), []string{"-storage-opt"}, usageFn("Set storage driver options"))
58
-	cmd.Var(opts.NewListOptsRef(&config.AuthZPlugins, nil), []string{"-authz-plugin"}, usageFn("List authorization plugins in order from first evaluator to last"))
58
+	cmd.Var(opts.NewListOptsRef(&config.AuthorizationPlugins, nil), []string{"-authorization-plugin"}, usageFn("List authorization plugins in order from first evaluator to last"))
59 59
 	cmd.Var(opts.NewListOptsRef(&config.ExecOptions, nil), []string{"-exec-opt"}, usageFn("Set exec driver options"))
60 60
 	cmd.StringVar(&config.Pidfile, []string{"p", "-pidfile"}, defaultPidFile, usageFn("Path to use for daemon PID file"))
61 61
 	cmd.StringVar(&config.Root, []string{"g", "-graph"}, defaultGraph, usageFn("Root of the Docker runtime"))
... ...
@@ -142,7 +142,7 @@ func (daemon *Daemon) showPluginsInfo() types.PluginsInfo {
142 142
 		pluginsInfo.Network = append(pluginsInfo.Network, nd)
143 143
 	}
144 144
 
145
-	pluginsInfo.Authorization = daemon.configStore.AuthZPlugins
145
+	pluginsInfo.Authorization = daemon.configStore.AuthorizationPlugins
146 146
 
147 147
 	return pluginsInfo
148 148
 }
... ...
@@ -177,9 +177,9 @@ func (cli *DaemonCli) CmdDaemon(args ...string) error {
177 177
 	}
178 178
 
179 179
 	serverConfig := &apiserver.Config{
180
-		AuthZPluginNames: cli.Config.AuthZPlugins,
181
-		Logging:          true,
182
-		Version:          dockerversion.Version,
180
+		AuthorizationPluginNames: cli.Config.AuthorizationPlugins,
181
+		Logging:                  true,
182
+		Version:                  dockerversion.Version,
183 183
 	}
184 184
 	serverConfig = setPlatformServerConfig(serverConfig, cli.Config)
185 185
 
... ...
@@ -12,7 +12,7 @@ weight = -1
12 12
 
13 13
 # Create an authorization plugin
14 14
 
15
-Docker’s out-of-the-box authorization model is all or nothing. Any user with
15
+Docker's out-of-the-box authorization model is all or nothing. Any user with
16 16
 permission to access the Docker daemon can run any Docker client command. The
17 17
 same is true for callers using Docker's remote API to contact the daemon. If you
18 18
 require greater access control, you can create authorization plugins and add
... ...
@@ -45,6 +45,9 @@ Authorization plugins must follow the rules described in [Docker Plugin API](plu
45 45
 Each plugin must reside within directories described under the 
46 46
 [Plugin discovery](plugin_api.md#plugin-discovery) section.
47 47
 
48
+**Note**: the abbreviations `AuthZ` and `AuthN` mean authorization and authentication
49
+respectively.
50
+
48 51
 ## Basic architecture
49 52
 
50 53
 You are responsible for registering your plugin as part of the Docker daemon
... ...
@@ -93,14 +96,14 @@ support the Docker client interactions detailed in this section.
93 93
 ### Setting up Docker daemon
94 94
 
95 95
 Enable the authorization plugin with a dedicated command line flag in the
96
-`--authz-plugin=PLUGIN_ID` format. The flag supplies a `PLUGIN_ID` value.
97
-This value can be the plugin’s socket or a path to a specification file.
96
+`--authorization-plugin=PLUGIN_ID` format. The flag supplies a `PLUGIN_ID`
97
+value. This value can be the plugin’s socket or a path to a specification file.
98 98
 
99 99
 ```bash
100
-$ docker daemon --authz-plugin=plugin1 --authz-plugin=plugin2,...
100
+$ docker daemon --authorization-plugin=plugin1 --authorization-plugin=plugin2,...
101 101
 ```
102 102
 
103
-Docker's authorization subsystem supports multiple `--authz-plugin` parameters.
103
+Docker's authorization subsystem supports multiple `--authorization-plugin` parameters.
104 104
 
105 105
 ### Calling authorized command (allow)
106 106
 
... ...
@@ -17,7 +17,7 @@ weight = -1
17 17
 
18 18
     Options:
19 19
       --api-cors-header=""                   Set CORS headers in the remote API
20
-      --authz-plugin=[]                      Set authorization plugins to load
20
+      --authorization-plugin=[]              Set authorization plugins to load
21 21
       -b, --bridge=""                        Attach containers to a network bridge
22 22
       --bip=""                               Specify network bridge IP
23 23
       --cgroup-parent=                       Set parent cgroup for all containers
... ...
@@ -613,10 +613,10 @@ The currently supported cluster store options are:
613 613
 Docker's access authorization can be extended by authorization plugins that your
614 614
 organization can purchase or build themselves. You can install one or more
615 615
 authorization plugins when you start the Docker `daemon` using the
616
-`--authz-plugin=PLUGIN_ID` option.
616
+`--authorization-plugin=PLUGIN_ID` option.
617 617
 
618 618
 ```bash
619
-docker daemon --authz-plugin=plugin1 --authz-plugin=plugin2,...
619
+docker daemon --authorization-plugin=plugin1 --authorization-plugin=plugin2,...
620 620
 ```
621 621
 
622 622
 The `PLUGIN_ID` value is either the plugin's name or a path to its specification
... ...
@@ -168,7 +168,7 @@ func (s *DockerAuthzSuite) TestAuthZPluginAllowRequest(c *check.C) {
168 168
 	c.Assert(s.d.StartWithBusybox(), check.IsNil)
169 169
 	// restart the daemon and enable the plugin, otherwise busybox loading
170 170
 	// is blocked by the plugin itself
171
-	c.Assert(s.d.Restart("--authz-plugin="+testAuthZPlugin), check.IsNil)
171
+	c.Assert(s.d.Restart("--authorization-plugin="+testAuthZPlugin), check.IsNil)
172 172
 
173 173
 	s.ctrl.reqRes.Allow = true
174 174
 	s.ctrl.resRes.Allow = true
... ...
@@ -189,7 +189,7 @@ func (s *DockerAuthzSuite) TestAuthZPluginAllowRequest(c *check.C) {
189 189
 }
190 190
 
191 191
 func (s *DockerAuthzSuite) TestAuthZPluginDenyRequest(c *check.C) {
192
-	err := s.d.Start("--authz-plugin=" + testAuthZPlugin)
192
+	err := s.d.Start("--authorization-plugin=" + testAuthZPlugin)
193 193
 	c.Assert(err, check.IsNil)
194 194
 	s.ctrl.reqRes.Allow = false
195 195
 	s.ctrl.reqRes.Msg = unauthorizedMessage
... ...
@@ -205,7 +205,7 @@ func (s *DockerAuthzSuite) TestAuthZPluginDenyRequest(c *check.C) {
205 205
 }
206 206
 
207 207
 func (s *DockerAuthzSuite) TestAuthZPluginDenyResponse(c *check.C) {
208
-	err := s.d.Start("--authz-plugin=" + testAuthZPlugin)
208
+	err := s.d.Start("--authorization-plugin=" + testAuthZPlugin)
209 209
 	c.Assert(err, check.IsNil)
210 210
 	s.ctrl.reqRes.Allow = true
211 211
 	s.ctrl.resRes.Allow = false
... ...
@@ -222,7 +222,7 @@ func (s *DockerAuthzSuite) TestAuthZPluginDenyResponse(c *check.C) {
222 222
 }
223 223
 
224 224
 func (s *DockerAuthzSuite) TestAuthZPluginErrorResponse(c *check.C) {
225
-	err := s.d.Start("--authz-plugin=" + testAuthZPlugin)
225
+	err := s.d.Start("--authorization-plugin=" + testAuthZPlugin)
226 226
 	c.Assert(err, check.IsNil)
227 227
 	s.ctrl.reqRes.Allow = true
228 228
 	s.ctrl.resRes.Err = errorMessage
... ...
@@ -235,7 +235,7 @@ func (s *DockerAuthzSuite) TestAuthZPluginErrorResponse(c *check.C) {
235 235
 }
236 236
 
237 237
 func (s *DockerAuthzSuite) TestAuthZPluginErrorRequest(c *check.C) {
238
-	err := s.d.Start("--authz-plugin=" + testAuthZPlugin)
238
+	err := s.d.Start("--authorization-plugin=" + testAuthZPlugin)
239 239
 	c.Assert(err, check.IsNil)
240 240
 	s.ctrl.reqRes.Err = errorMessage
241 241
 
... ...
@@ -247,7 +247,7 @@ func (s *DockerAuthzSuite) TestAuthZPluginErrorRequest(c *check.C) {
247 247
 }
248 248
 
249 249
 func (s *DockerAuthzSuite) TestAuthZPluginEnsureNoDuplicatePluginRegistration(c *check.C) {
250
-	c.Assert(s.d.Start("--authz-plugin="+testAuthZPlugin, "--authz-plugin="+testAuthZPlugin), check.IsNil)
250
+	c.Assert(s.d.Start("--authorization-plugin="+testAuthZPlugin, "--authorization-plugin="+testAuthZPlugin), check.IsNil)
251 251
 
252 252
 	s.ctrl.reqRes.Allow = true
253 253
 	s.ctrl.resRes.Allow = true
... ...
@@ -7,7 +7,7 @@ docker-daemon - Enable daemon mode
7 7
 # SYNOPSIS
8 8
 **docker daemon**
9 9
 [**--api-cors-header**=[=*API-CORS-HEADER*]]
10
-[**--authz-plugin**[=*[]*]]
10
+[**--authorization-plugin**[=*[]*]]
11 11
 [**-b**|**--bridge**[=*BRIDGE*]]
12 12
 [**--bip**[=*BIP*]]
13 13
 [**--cgroup-parent**[=*[]*]]
... ...
@@ -73,7 +73,7 @@ format.
73 73
 **--api-cors-header**=""
74 74
   Set CORS headers in the remote API. Default is cors disabled. Give urls like "http://foo, http://bar, ...". Give "*" to allow all.
75 75
 
76
-**--authz-plugin**=""
76
+**--authorization-plugin**=""
77 77
   Set authorization plugins to load
78 78
 
79 79
 **-b**, **--bridge**=""
... ...
@@ -473,10 +473,10 @@ Key/Value store.
473 473
 Docker's access authorization can be extended by authorization plugins that your
474 474
 organization can purchase or build themselves. You can install one or more
475 475
 authorization plugins when you start the Docker `daemon` using the
476
-`--authz-plugin=PLUGIN_ID` option.
476
+`--authorization-plugin=PLUGIN_ID` option.
477 477
 
478 478
 ```bash
479
-docker daemon --authz-plugin=plugin1 --authz-plugin=plugin2,...
479
+docker daemon --authorization-plugin=plugin1 --authorization-plugin=plugin2,...
480 480
 ```
481 481
 
482 482
 The `PLUGIN_ID` value is either the plugin's name or a path to its specification