Class: Imgproxy::ServiceConfig

Inherits:
Anyway::Config
  • Object
show all
Defined in:
lib/imgproxy/service_config.rb

Overview

Imgproxy custom config for services

See Also:

Instance Attribute Summary collapse

Instance Attribute Details

#always_encrypt_source_urlsString

Always encrypt source URLs. Defaults to false

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/imgproxy/service_config.rb', line 37

class ServiceConfig < Anyway::Config
  # Inherit global config values
  config_name :imgproxy

  attr_config(
    :endpoint,
    :key,
    :salt,
    :raw_key,
    :raw_salt,
    :source_url_encryption_key,
    :raw_source_url_encryption_key,
    signature_size: 32,
    always_encrypt_source_urls: false,
  )

  coerce_types(
    endpoint: :string,
    key: :string,
    salt: :string,
    raw_key: :string,
    raw_salt: :string,
    signature_size: :integer,
    source_url_encryption_key: :string,
    raw_source_url_encryption_key: :string,
    always_encrypt_source_urls: :boolean,
  )

  alias_method :set_key, :key=
  alias_method :set_raw_key, :raw_key=
  alias_method :set_salt, :salt=
  alias_method :set_raw_salt, :raw_salt=
  alias_method :set_source_url_encryption_key, :source_url_encryption_key=
  alias_method :set_raw_source_url_encryption_key, :raw_source_url_encryption_key=

  private :set_key, :set_raw_key, :set_salt, :set_raw_salt,
    :set_source_url_encryption_key, :set_raw_source_url_encryption_key

  def key=(value)
    value = value&.to_s
    super(value)
    set_raw_key(value && [value].pack("H*"))
  end

  def raw_key=(value)
    value = value&.to_s
    super(value)
    set_key(value&.unpack!("H*"))
  end

  def salt=(value)
    value = value&.to_s
    super(value)
    set_raw_salt(value && [value].pack("H*"))
  end

  def raw_salt=(value)
    value = value&.to_s
    super(value)
    set_salt(value&.unpack1("H*"))
  end

  def source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_raw_source_url_encryption_key(value && [value].pack("H*"))
  end

  def raw_source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_source_url_encryption_key(value&.unpack1("H*"))
  end
end

#endpointString

imgproxy endpoint

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/imgproxy/service_config.rb', line 37

class ServiceConfig < Anyway::Config
  # Inherit global config values
  config_name :imgproxy

  attr_config(
    :endpoint,
    :key,
    :salt,
    :raw_key,
    :raw_salt,
    :source_url_encryption_key,
    :raw_source_url_encryption_key,
    signature_size: 32,
    always_encrypt_source_urls: false,
  )

  coerce_types(
    endpoint: :string,
    key: :string,
    salt: :string,
    raw_key: :string,
    raw_salt: :string,
    signature_size: :integer,
    source_url_encryption_key: :string,
    raw_source_url_encryption_key: :string,
    always_encrypt_source_urls: :boolean,
  )

  alias_method :set_key, :key=
  alias_method :set_raw_key, :raw_key=
  alias_method :set_salt, :salt=
  alias_method :set_raw_salt, :raw_salt=
  alias_method :set_source_url_encryption_key, :source_url_encryption_key=
  alias_method :set_raw_source_url_encryption_key, :raw_source_url_encryption_key=

  private :set_key, :set_raw_key, :set_salt, :set_raw_salt,
    :set_source_url_encryption_key, :set_raw_source_url_encryption_key

  def key=(value)
    value = value&.to_s
    super(value)
    set_raw_key(value && [value].pack("H*"))
  end

  def raw_key=(value)
    value = value&.to_s
    super(value)
    set_key(value&.unpack!("H*"))
  end

  def salt=(value)
    value = value&.to_s
    super(value)
    set_raw_salt(value && [value].pack("H*"))
  end

  def raw_salt=(value)
    value = value&.to_s
    super(value)
    set_salt(value&.unpack1("H*"))
  end

  def source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_raw_source_url_encryption_key(value && [value].pack("H*"))
  end

  def raw_source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_source_url_encryption_key(value&.unpack1("H*"))
  end
end

#keyString

imgproxy hex-encoded signature key

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/imgproxy/service_config.rb', line 37

class ServiceConfig < Anyway::Config
  # Inherit global config values
  config_name :imgproxy

  attr_config(
    :endpoint,
    :key,
    :salt,
    :raw_key,
    :raw_salt,
    :source_url_encryption_key,
    :raw_source_url_encryption_key,
    signature_size: 32,
    always_encrypt_source_urls: false,
  )

  coerce_types(
    endpoint: :string,
    key: :string,
    salt: :string,
    raw_key: :string,
    raw_salt: :string,
    signature_size: :integer,
    source_url_encryption_key: :string,
    raw_source_url_encryption_key: :string,
    always_encrypt_source_urls: :boolean,
  )

  alias_method :set_key, :key=
  alias_method :set_raw_key, :raw_key=
  alias_method :set_salt, :salt=
  alias_method :set_raw_salt, :raw_salt=
  alias_method :set_source_url_encryption_key, :source_url_encryption_key=
  alias_method :set_raw_source_url_encryption_key, :raw_source_url_encryption_key=

  private :set_key, :set_raw_key, :set_salt, :set_raw_salt,
    :set_source_url_encryption_key, :set_raw_source_url_encryption_key

  def key=(value)
    value = value&.to_s
    super(value)
    set_raw_key(value && [value].pack("H*"))
  end

  def raw_key=(value)
    value = value&.to_s
    super(value)
    set_key(value&.unpack!("H*"))
  end

  def salt=(value)
    value = value&.to_s
    super(value)
    set_raw_salt(value && [value].pack("H*"))
  end

  def raw_salt=(value)
    value = value&.to_s
    super(value)
    set_salt(value&.unpack1("H*"))
  end

  def source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_raw_source_url_encryption_key(value && [value].pack("H*"))
  end

  def raw_source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_source_url_encryption_key(value&.unpack1("H*"))
  end
end

#raw_keyString

Decoded signature key

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/imgproxy/service_config.rb', line 37

class ServiceConfig < Anyway::Config
  # Inherit global config values
  config_name :imgproxy

  attr_config(
    :endpoint,
    :key,
    :salt,
    :raw_key,
    :raw_salt,
    :source_url_encryption_key,
    :raw_source_url_encryption_key,
    signature_size: 32,
    always_encrypt_source_urls: false,
  )

  coerce_types(
    endpoint: :string,
    key: :string,
    salt: :string,
    raw_key: :string,
    raw_salt: :string,
    signature_size: :integer,
    source_url_encryption_key: :string,
    raw_source_url_encryption_key: :string,
    always_encrypt_source_urls: :boolean,
  )

  alias_method :set_key, :key=
  alias_method :set_raw_key, :raw_key=
  alias_method :set_salt, :salt=
  alias_method :set_raw_salt, :raw_salt=
  alias_method :set_source_url_encryption_key, :source_url_encryption_key=
  alias_method :set_raw_source_url_encryption_key, :raw_source_url_encryption_key=

  private :set_key, :set_raw_key, :set_salt, :set_raw_salt,
    :set_source_url_encryption_key, :set_raw_source_url_encryption_key

  def key=(value)
    value = value&.to_s
    super(value)
    set_raw_key(value && [value].pack("H*"))
  end

  def raw_key=(value)
    value = value&.to_s
    super(value)
    set_key(value&.unpack!("H*"))
  end

  def salt=(value)
    value = value&.to_s
    super(value)
    set_raw_salt(value && [value].pack("H*"))
  end

  def raw_salt=(value)
    value = value&.to_s
    super(value)
    set_salt(value&.unpack1("H*"))
  end

  def source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_raw_source_url_encryption_key(value && [value].pack("H*"))
  end

  def raw_source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_source_url_encryption_key(value&.unpack1("H*"))
  end
end

#raw_saltString

Decoded signature salt

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/imgproxy/service_config.rb', line 37

class ServiceConfig < Anyway::Config
  # Inherit global config values
  config_name :imgproxy

  attr_config(
    :endpoint,
    :key,
    :salt,
    :raw_key,
    :raw_salt,
    :source_url_encryption_key,
    :raw_source_url_encryption_key,
    signature_size: 32,
    always_encrypt_source_urls: false,
  )

  coerce_types(
    endpoint: :string,
    key: :string,
    salt: :string,
    raw_key: :string,
    raw_salt: :string,
    signature_size: :integer,
    source_url_encryption_key: :string,
    raw_source_url_encryption_key: :string,
    always_encrypt_source_urls: :boolean,
  )

  alias_method :set_key, :key=
  alias_method :set_raw_key, :raw_key=
  alias_method :set_salt, :salt=
  alias_method :set_raw_salt, :raw_salt=
  alias_method :set_source_url_encryption_key, :source_url_encryption_key=
  alias_method :set_raw_source_url_encryption_key, :raw_source_url_encryption_key=

  private :set_key, :set_raw_key, :set_salt, :set_raw_salt,
    :set_source_url_encryption_key, :set_raw_source_url_encryption_key

  def key=(value)
    value = value&.to_s
    super(value)
    set_raw_key(value && [value].pack("H*"))
  end

  def raw_key=(value)
    value = value&.to_s
    super(value)
    set_key(value&.unpack!("H*"))
  end

  def salt=(value)
    value = value&.to_s
    super(value)
    set_raw_salt(value && [value].pack("H*"))
  end

  def raw_salt=(value)
    value = value&.to_s
    super(value)
    set_salt(value&.unpack1("H*"))
  end

  def source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_raw_source_url_encryption_key(value && [value].pack("H*"))
  end

  def raw_source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_source_url_encryption_key(value&.unpack1("H*"))
  end
end

#raw_source_url_encryption_keyString

Decoded source URL encryption key

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/imgproxy/service_config.rb', line 37

class ServiceConfig < Anyway::Config
  # Inherit global config values
  config_name :imgproxy

  attr_config(
    :endpoint,
    :key,
    :salt,
    :raw_key,
    :raw_salt,
    :source_url_encryption_key,
    :raw_source_url_encryption_key,
    signature_size: 32,
    always_encrypt_source_urls: false,
  )

  coerce_types(
    endpoint: :string,
    key: :string,
    salt: :string,
    raw_key: :string,
    raw_salt: :string,
    signature_size: :integer,
    source_url_encryption_key: :string,
    raw_source_url_encryption_key: :string,
    always_encrypt_source_urls: :boolean,
  )

  alias_method :set_key, :key=
  alias_method :set_raw_key, :raw_key=
  alias_method :set_salt, :salt=
  alias_method :set_raw_salt, :raw_salt=
  alias_method :set_source_url_encryption_key, :source_url_encryption_key=
  alias_method :set_raw_source_url_encryption_key, :raw_source_url_encryption_key=

  private :set_key, :set_raw_key, :set_salt, :set_raw_salt,
    :set_source_url_encryption_key, :set_raw_source_url_encryption_key

  def key=(value)
    value = value&.to_s
    super(value)
    set_raw_key(value && [value].pack("H*"))
  end

  def raw_key=(value)
    value = value&.to_s
    super(value)
    set_key(value&.unpack!("H*"))
  end

  def salt=(value)
    value = value&.to_s
    super(value)
    set_raw_salt(value && [value].pack("H*"))
  end

  def raw_salt=(value)
    value = value&.to_s
    super(value)
    set_salt(value&.unpack1("H*"))
  end

  def source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_raw_source_url_encryption_key(value && [value].pack("H*"))
  end

  def raw_source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_source_url_encryption_key(value&.unpack1("H*"))
  end
end

#saltString

imgproxy hex-encoded signature salt

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/imgproxy/service_config.rb', line 37

class ServiceConfig < Anyway::Config
  # Inherit global config values
  config_name :imgproxy

  attr_config(
    :endpoint,
    :key,
    :salt,
    :raw_key,
    :raw_salt,
    :source_url_encryption_key,
    :raw_source_url_encryption_key,
    signature_size: 32,
    always_encrypt_source_urls: false,
  )

  coerce_types(
    endpoint: :string,
    key: :string,
    salt: :string,
    raw_key: :string,
    raw_salt: :string,
    signature_size: :integer,
    source_url_encryption_key: :string,
    raw_source_url_encryption_key: :string,
    always_encrypt_source_urls: :boolean,
  )

  alias_method :set_key, :key=
  alias_method :set_raw_key, :raw_key=
  alias_method :set_salt, :salt=
  alias_method :set_raw_salt, :raw_salt=
  alias_method :set_source_url_encryption_key, :source_url_encryption_key=
  alias_method :set_raw_source_url_encryption_key, :raw_source_url_encryption_key=

  private :set_key, :set_raw_key, :set_salt, :set_raw_salt,
    :set_source_url_encryption_key, :set_raw_source_url_encryption_key

  def key=(value)
    value = value&.to_s
    super(value)
    set_raw_key(value && [value].pack("H*"))
  end

  def raw_key=(value)
    value = value&.to_s
    super(value)
    set_key(value&.unpack!("H*"))
  end

  def salt=(value)
    value = value&.to_s
    super(value)
    set_raw_salt(value && [value].pack("H*"))
  end

  def raw_salt=(value)
    value = value&.to_s
    super(value)
    set_salt(value&.unpack1("H*"))
  end

  def source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_raw_source_url_encryption_key(value && [value].pack("H*"))
  end

  def raw_source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_source_url_encryption_key(value&.unpack1("H*"))
  end
end

#signature_sizeString

imgproxy signature size. Defaults to 32

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/imgproxy/service_config.rb', line 37

class ServiceConfig < Anyway::Config
  # Inherit global config values
  config_name :imgproxy

  attr_config(
    :endpoint,
    :key,
    :salt,
    :raw_key,
    :raw_salt,
    :source_url_encryption_key,
    :raw_source_url_encryption_key,
    signature_size: 32,
    always_encrypt_source_urls: false,
  )

  coerce_types(
    endpoint: :string,
    key: :string,
    salt: :string,
    raw_key: :string,
    raw_salt: :string,
    signature_size: :integer,
    source_url_encryption_key: :string,
    raw_source_url_encryption_key: :string,
    always_encrypt_source_urls: :boolean,
  )

  alias_method :set_key, :key=
  alias_method :set_raw_key, :raw_key=
  alias_method :set_salt, :salt=
  alias_method :set_raw_salt, :raw_salt=
  alias_method :set_source_url_encryption_key, :source_url_encryption_key=
  alias_method :set_raw_source_url_encryption_key, :raw_source_url_encryption_key=

  private :set_key, :set_raw_key, :set_salt, :set_raw_salt,
    :set_source_url_encryption_key, :set_raw_source_url_encryption_key

  def key=(value)
    value = value&.to_s
    super(value)
    set_raw_key(value && [value].pack("H*"))
  end

  def raw_key=(value)
    value = value&.to_s
    super(value)
    set_key(value&.unpack!("H*"))
  end

  def salt=(value)
    value = value&.to_s
    super(value)
    set_raw_salt(value && [value].pack("H*"))
  end

  def raw_salt=(value)
    value = value&.to_s
    super(value)
    set_salt(value&.unpack1("H*"))
  end

  def source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_raw_source_url_encryption_key(value && [value].pack("H*"))
  end

  def raw_source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_source_url_encryption_key(value&.unpack1("H*"))
  end
end

#source_url_encryption_keyString

imgproxy hex-encoded source URL encryption key

Returns:

  • (String)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/imgproxy/service_config.rb', line 37

class ServiceConfig < Anyway::Config
  # Inherit global config values
  config_name :imgproxy

  attr_config(
    :endpoint,
    :key,
    :salt,
    :raw_key,
    :raw_salt,
    :source_url_encryption_key,
    :raw_source_url_encryption_key,
    signature_size: 32,
    always_encrypt_source_urls: false,
  )

  coerce_types(
    endpoint: :string,
    key: :string,
    salt: :string,
    raw_key: :string,
    raw_salt: :string,
    signature_size: :integer,
    source_url_encryption_key: :string,
    raw_source_url_encryption_key: :string,
    always_encrypt_source_urls: :boolean,
  )

  alias_method :set_key, :key=
  alias_method :set_raw_key, :raw_key=
  alias_method :set_salt, :salt=
  alias_method :set_raw_salt, :raw_salt=
  alias_method :set_source_url_encryption_key, :source_url_encryption_key=
  alias_method :set_raw_source_url_encryption_key, :raw_source_url_encryption_key=

  private :set_key, :set_raw_key, :set_salt, :set_raw_salt,
    :set_source_url_encryption_key, :set_raw_source_url_encryption_key

  def key=(value)
    value = value&.to_s
    super(value)
    set_raw_key(value && [value].pack("H*"))
  end

  def raw_key=(value)
    value = value&.to_s
    super(value)
    set_key(value&.unpack!("H*"))
  end

  def salt=(value)
    value = value&.to_s
    super(value)
    set_raw_salt(value && [value].pack("H*"))
  end

  def raw_salt=(value)
    value = value&.to_s
    super(value)
    set_salt(value&.unpack1("H*"))
  end

  def source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_raw_source_url_encryption_key(value && [value].pack("H*"))
  end

  def raw_source_url_encryption_key=(value)
    value = value&.to_s
    super(value)
    set_source_url_encryption_key(value&.unpack1("H*"))
  end
end