|
4 | 4 | #
|
5 | 5 | # == Parameters
|
6 | 6 | #
|
7 |
| -# [*admin_token*] |
8 |
| -# Keystone admin token that can serve as a shared secret |
9 |
| -# for authenticating. If this is choosen if is used instead of a user,tenant,password. |
10 |
| -# Optional. Defaults to false. |
11 |
| -# |
12 |
| -# [*admin_user*] |
13 |
| -# User used to authenticate service. |
14 |
| -# Optional. Defaults to 'swift'. |
15 |
| -# |
16 |
| -# [*admin_tenant_name*] |
17 |
| -# Tenant used to authenticate service. |
18 |
| -# Optional. Defaults to 'services'. |
19 |
| -# |
20 |
| -# [*admin_password*] |
21 |
| -# Password used with user to authenticate service. |
22 |
| -# Optional. Defaults to 'password'. |
23 |
| -# |
24 |
| -# [*delay_auth_decision*] |
25 |
| -# Set to 1 to support token-less access (anonymous access, tempurl, ...) |
26 |
| -# Optional, Defaults to 0 |
27 |
| -# |
28 |
| -# [*auth_host*] |
29 |
| -# Host providing the keystone service API endpoint. Optional. |
30 |
| -# Defaults to 127.0.0.1 |
31 |
| -# |
32 |
| -# [*auth_port*] |
33 |
| -# Port where keystone service is listening. Optional. |
34 |
| -# Defaults to 3557. |
35 |
| -# |
36 |
| -# [*auth_protocol*] |
37 |
| -# Protocol to use to communicate with keystone. Optional. |
38 |
| -# Defaults to https. |
39 |
| -# |
40 |
| -# [*auth_admin_prefix*] |
41 |
| -# Path part of the auth url. Optional. |
42 |
| -# This allows admin auth URIs like http://host/keystone/admin/v2.0. |
43 |
| -# Defaults to false for empty. It defined, should be a string with a leading '/' and no trailing '/'. |
44 |
| -# |
45 |
| -# [*auth_uri*] |
46 |
| -# The public auth url to redirect unauthenticated requests. |
47 |
| -# Defaults to false to be expanded to '${auth_protocol}://${auth_host}:5000'. |
48 |
| -# Should be set to your public keystone endpoint (without version). |
49 |
| -# |
50 |
| -# [*identity_uri*] |
51 |
| -# identity_uri points to the Keystone Admin service. This information is |
52 |
| -# used by the middleware to actually query Keystone about the validity of the |
53 |
| -# authentication tokens. It is not necessary to append any Keystone API version |
54 |
| -# number to this URI. |
55 |
| -# Defaults to false. |
56 |
| -# |
57 |
| -# [*signing_dir*] |
| 7 | +# [*delay_auth_decision*] |
| 8 | +# (Optional) Do not handle authorization requests within the middleware, but |
| 9 | +# delegate the authorization decision to downstream WSGI components. Boolean value |
| 10 | +# Defaults to 1 |
| 11 | +# |
| 12 | +# [*signing_dir*] |
58 | 13 | # The cache directory for signing certificates.
|
59 | 14 | # Defaults to '/var/cache/swift'
|
60 | 15 | #
|
61 |
| -# [*cache*] |
| 16 | +# [*cache*] |
62 | 17 | # The cache backend to use
|
63 | 18 | # Optional. Defaults to 'swift.cache'
|
64 | 19 | #
|
| 20 | +# [*auth_uri*] |
| 21 | +# (Optional) Complete public Identity API endpoint. |
| 22 | +# Defaults to 'http://127.0.0.1:5000' |
| 23 | +# |
| 24 | +# [*auth_url*] |
| 25 | +# (Optional) The URL to use for authentication. |
| 26 | +# Defaults to 'http://127.0.0.1:35357' |
| 27 | +# |
| 28 | +# [*auth_plugin*] |
| 29 | +# (Optional) The plugin for authentication |
| 30 | +# Defaults to 'password' |
| 31 | +# |
| 32 | +# [*username*] |
| 33 | +# (Optional) The name of the service user |
| 34 | +# Defaults to 'swift' |
| 35 | +# |
| 36 | +# [*password*] |
| 37 | +# (Optional) The password for the user |
| 38 | +# Defaults to 'password' |
| 39 | +# |
| 40 | +# [*project_name*] |
| 41 | +# (Optional) Service project name |
| 42 | +# Defaults to 'services' |
| 43 | +# |
| 44 | +# [*project_domain_id*] |
| 45 | +# (Optional) id of domain for $project_name |
| 46 | +# Defaults to 'default' |
| 47 | +# |
| 48 | +# [*user_domain_id*] |
| 49 | +# (Optional) id of domain for $username |
| 50 | +# Defaults to 'default' |
| 51 | +# |
| 52 | +# [*include_service_catalog*] |
| 53 | +# (Optional) Indicate whether to set the X-Service-Catalog header. If False, |
| 54 | +# middleware will not ask for service catalog on token validation and will |
| 55 | +# not set the X-Service-Catalog header. Boolean value. |
| 56 | +# Defaults to false |
| 57 | +# |
| 58 | +# == DEPRECATED |
| 59 | +# |
| 60 | +# [*admin_token*] |
| 61 | +# (optional) Depreated. |
| 62 | +# Defaults to undef |
| 63 | +# |
| 64 | +# [*identity_uri*] |
| 65 | +# (optional) Deprecated. Use auth_url instead. |
| 66 | +# Defaults to undef |
| 67 | +# |
| 68 | +# [*admin_user*] |
| 69 | +# (optional) Deprecated. Use username instead. |
| 70 | +# Defaults to undef |
| 71 | +# |
| 72 | +# [*admin_tenant_name*] |
| 73 | +# (optional) Deprecated. Use project_name instead. |
| 74 | +# Defaults to undef |
| 75 | +# |
| 76 | +# [*admin_password*] |
| 77 | +# (optional) Deprecated. Use password instead. |
| 78 | +# Defaults to undef |
| 79 | +# |
65 | 80 | # == Authors
|
66 | 81 | #
|
67 | 82 | # Dan Bode dan@puppetlabs.com
|
|
71 | 86 | # Copyright 2012 Puppetlabs Inc, unless otherwise noted.
|
72 | 87 | #
|
73 | 88 | class swift::proxy::authtoken(
|
74 |
| - $admin_user = 'swift', |
75 |
| - $admin_tenant_name = 'services', |
76 |
| - $admin_password = 'password', |
77 |
| - $auth_uri = false, |
78 |
| - $identity_uri = false, |
79 |
| - $delay_auth_decision = 1, |
80 |
| - $admin_token = false, |
81 |
| - $signing_dir = '/var/cache/swift', |
82 |
| - $cache = 'swift.cache', |
| 89 | + $delay_auth_decision = 1, |
| 90 | + $signing_dir = '/var/cache/swift', |
| 91 | + $cache = 'swift.cache', |
| 92 | + $auth_uri = 'http://127.0.0.1:5000', |
| 93 | + $auth_url = 'http://127.0.0.1:35357', |
| 94 | + $auth_plugin = 'password', |
| 95 | + $project_domain_id = 'default', |
| 96 | + $user_domain_id = 'default', |
| 97 | + $project_name = 'services', |
| 98 | + $username = 'swift', |
| 99 | + $password = 'password', |
| 100 | + $include_service_catalog = false, |
83 | 101 | # DEPRECATED PARAMETERS
|
84 |
| - $auth_host = '127.0.0.1', |
85 |
| - $auth_port = '35357', |
86 |
| - $auth_protocol = 'http', |
87 |
| - $auth_admin_prefix = false, |
| 102 | + $admin_user = undef, |
| 103 | + $admin_tenant_name = undef, |
| 104 | + $admin_password = undef, |
| 105 | + $identity_uri = undef, |
| 106 | + $admin_token = undef, |
88 | 107 | ) {
|
89 | 108 |
|
90 | 109 | include ::swift::deps
|
91 | 110 |
|
92 |
| - if $auth_uri { |
93 |
| - $auth_uri_real = $auth_uri |
94 |
| - } else { |
95 |
| - $auth_uri_real = "${auth_protocol}://${auth_host}:5000" |
| 111 | + if $admin_token { |
| 112 | + warning('admin_token is deprecated, has no usage and will be removed in the O release') |
| 113 | + } |
| 114 | + |
| 115 | + if $identity_uri { |
| 116 | + warning('identity_uri is deprecated and will be removed, please use auth_url instead') |
96 | 117 | }
|
97 | 118 |
|
98 |
| - # if both auth_uri and identity_uri are set we skip these deprecated warnings |
99 |
| - if !$auth_uri or !$identity_uri { |
100 |
| - if $auth_host { |
101 |
| - warning('The auth_host parameter is deprecated. Please use auth_uri and identity_uri instead.') |
102 |
| - } |
103 |
| - if $auth_port { |
104 |
| - warning('The auth_port parameter is deprecated. Please use auth_uri and identity_uri instead.') |
105 |
| - } |
106 |
| - if $auth_protocol { |
107 |
| - warning('The auth_protocol parameter is deprecated. Please use auth_uri and identity_uri instead.') |
108 |
| - } |
109 |
| - if $auth_admin_prefix { |
110 |
| - warning('The auth_admin_prefix parameter is deprecated. Please use auth_uri and identity_uri instead.') |
111 |
| - validate_re($auth_admin_prefix, '^(/.+[^/])?$') |
112 |
| - } |
| 119 | + if $admin_user { |
| 120 | + warning('admin_user is deprecated and will be removed, please use username instead') |
113 | 121 | }
|
114 | 122 |
|
| 123 | + if $admin_tenant_name { |
| 124 | + warning('admin_tenant_name is deprecated and will be removed, please use project_name instead') |
| 125 | + } |
| 126 | + |
| 127 | + if $admin_password { |
| 128 | + warning('admin_password is deprecated and will be removed, please use password isntead') |
| 129 | + } |
| 130 | + |
| 131 | + $auth_url_real = pick($identity_uri, $auth_url) |
| 132 | + $username_real = pick($admin_user, $username) |
| 133 | + $project_name_real = pick($admin_tenant_name, $project_name) |
| 134 | + $password_real = pick($admin_password, $password) |
| 135 | + |
115 | 136 | file { $signing_dir:
|
116 | 137 | ensure => directory,
|
117 | 138 | mode => '0700',
|
|
0 commit comments