File: cors.pp

package info (click to toggle)
puppet-module-gnocchi 25.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,096 kB
  • sloc: ruby: 2,339; python: 38; makefile: 10; sh: 10
file content (58 lines) | stat: -rw-r--r-- 1,750 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# == Class: gnocchi::cors
#
# Configure the gnocchi cors
#
# === Parameters
#
# [*allowed_origin*]
#   (Optional) Indicate whether this resource may be shared with the domain
#   received in the requests "origin" header.
#   (string value)
#   Defaults to $facts['os_service_default'].
#
# [*allow_credentials*]
#   (Optional) Indicate that the actual request can include user credentials.
#   (boolean value)
#   Defaults to $facts['os_service_default'].
#
# [*expose_headers*]
#   (Optional) Indicate which headers are safe to expose to the API.
#   (list value)
#   Defaults to $facts['os_service_default'].
#
# [*max_age*]
#   (Optional) Maximum cache age of CORS preflight requests.
#   (integer value)
#   Defaults to $facts['os_service_default'].
#
# [*allow_methods*]
#   (Optional) Indicate which methods can be used during the actual request.
#   (list value)
#   Defaults to $facts['os_service_default'].
#
# [*allow_headers*]
#   (Optional) Indicate which header field names may be used during the actual
#   request.
#   (list value)
#   Defaults to $facts['os_service_default'].
#
class gnocchi::cors (
  $allowed_origin    = $facts['os_service_default'],
  $allow_credentials = $facts['os_service_default'],
  $expose_headers    = $facts['os_service_default'],
  $max_age           = $facts['os_service_default'],
  $allow_methods     = $facts['os_service_default'],
  $allow_headers     = $facts['os_service_default'],
) {

  include gnocchi::deps

  oslo::cors { 'gnocchi_config':
    allowed_origin    => $allowed_origin,
    allow_credentials => $allow_credentials,
    expose_headers    => $expose_headers,
    max_age           => $max_age,
    allow_methods     => $allow_methods,
    allow_headers     => $allow_headers,
  }
}