yaml_csp_config 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c1a15cf473158e7caa531c124ef6d3b916aea37e2935836e091d45e1a577005
4
- data.tar.gz: d58ca4a23c4f0c9a00c083b3fc53bb05436de96e53f2eb0c49ebbaaecf89553b
3
+ metadata.gz: 636f76164108ed26ee965a4c3a6b62f17691134fba8077f5bdbd157faff5b6d5
4
+ data.tar.gz: 2627769481fee67efdc943ab7e50f0757edcdea387a930079cbf128ef49c927e
5
5
  SHA512:
6
- metadata.gz: b3086d40d76804167f12b22bed3efa8e50267f8e6060a7715769e7fc0a949e5c5bf3a6c0f2e2173c7b5401d76c83a6385e320916d43b7f4cc043848542311c57
7
- data.tar.gz: 0d83c01baa01b4026b0da4c804bdfe3adf1ae3ed2a196d85dc6b10b36cb662306f645a6620382b7b182d8dcf732324e9debc65fc88195247ad1492c725dfdece
6
+ metadata.gz: bbca5b53805a870e2c8f5811d25e718953628c2e6e33150f2f62d5a29555a38d79057b7910a34aca052f97b34cf31d15056a1ecbc9923a5093db7801dc628cc6
7
+ data.tar.gz: ba204c300eb92eadfb14270df762294ccd33ee2f271a1289fce35be10ac104a64854b37f84abd3632014fa6d7ef088e2f352ecd8f6665869e940f49c133d2f5f
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YamlCspConfig
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
@@ -0,0 +1,60 @@
1
+ module YamlCspConfig
2
+ VERSION: String
3
+
4
+ class Railtie < ::Rails::Railtie
5
+ end
6
+
7
+ class Configuration
8
+ attr_accessor configuration_file_path: String | Pathname
9
+ attr_accessor yaml_config_base_key: String | Symbol
10
+ attr_accessor default_env_var_additions_key_prefix: String
11
+ attr_accessor default_env_var_group_key: String
12
+
13
+ def initialize: -> void
14
+ end
15
+
16
+ def self.configuration: -> YamlCspConfig::Configuration
17
+ def self.configure: ?{ (YamlCspConfig::Configuration config) -> void } -> YamlCspConfig::Configuration
18
+
19
+ YamlLoader::DIRECTIVES: Array[Symbol]
20
+
21
+ type cspFilePath = String | Pathname
22
+ type cspGroup = Hash[String, cspDirectives]
23
+ type cspDirectives = Hash[String, String | Symbol | Array[String | Symbol]]
24
+
25
+ type cspPolicyRules = Hash[String, Array[String | Symbol]]
26
+
27
+ class YamlLoader
28
+ def self.call: (ActionDispatch::ContentSecurityPolicy policy, ?cspFilePath config_file) -> ActionDispatch::ContentSecurityPolicy
29
+
30
+ def initialize: (
31
+ ActionDispatch::ContentSecurityPolicy policy,
32
+ cspFilePath config_file_path,
33
+ ?group_key: String,
34
+ ?var_key_prefix: String
35
+ ) -> void
36
+
37
+ def configure: -> ActionDispatch::ContentSecurityPolicy
38
+
39
+ private
40
+
41
+ attr_reader policy: ActionDispatch::ContentSecurityPolicy
42
+ attr_reader config_file_path: cspFilePath
43
+ attr_reader env_var_group_key: String
44
+ attr_reader env_var_key_prefix: String
45
+
46
+ def raw_configuration: -> cspGroup
47
+ def configure_with_overrides: -> cspPolicyRules
48
+ def env_override: (cspGroup config, cspPolicyRules policies) -> cspPolicyRules
49
+ def env_var_group_override: (cspGroup config, cspPolicyRules policies) -> cspPolicyRules
50
+ def env_var_direct_override: (cspPolicyRules policies) -> cspPolicyRules
51
+ def add_to_csp: (cspPolicyRules policies, String rule, (Symbol | String | Array[String | Symbol]) value) -> void
52
+ def config_key_base: -> String
53
+ end
54
+ end
55
+
56
+ module ActionDispatch
57
+ class ContentSecurityPolicy
58
+ def load_from_yml: -> ActionDispatch::ContentSecurityPolicy
59
+ end
60
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml_csp_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Ierodiaconou
@@ -80,7 +80,9 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: The CSP configuration can also be extended by environment variables.
83
+ description: yaml_csp_config provides you with a way to manage your Rails 5.2+ CSP
84
+ configuration via a YAML file. The CSP configuration can also be extended by environment
85
+ variables.
84
86
  email:
85
87
  - stevegeek@gmail.com
86
88
  executables: []
@@ -100,6 +102,7 @@ files:
100
102
  - lib/yaml_csp_config/railtie.rb
101
103
  - lib/yaml_csp_config/version.rb
102
104
  - lib/yaml_csp_config/yaml_loader.rb
105
+ - sig/types.rbs
103
106
  homepage: https://github.com/stevegeek/yaml_csp_config
104
107
  licenses:
105
108
  - MIT