Module: SecureKeys::Validation::Globals
- Defined in:
- lib/validation/globals/globals.rb
Class Method Summary collapse
-
.api_key_length ⇒ Integer
Returns the minimum length for an API key.
-
.default_scan_excludes ⇒ Array<String>
Returns the default directory and file names to exclude from scanning.
-
.default_scan_extensions ⇒ Array<String>
Returns the default file extensions to scan.
-
.key_length ⇒ Integer
Returns the minimum length for a generic key.
-
.max_scan_depth ⇒ Integer
Returns the maximum directory traversal depth for scanning.
-
.min_entropy_threshold ⇒ Float
Returns the minimum Shannon entropy threshold for secret validation.
-
.password_length ⇒ Integer
Returns the minimum length for a password.
-
.secret_length ⇒ Integer
Returns the minimum length for a secret.
-
.token_length ⇒ Integer
Returns the minimum length for a token.
Class Method Details
.api_key_length ⇒ Integer
Returns the minimum length for an API key
12 13 14 |
# File 'lib/validation/globals/globals.rb', line 12 def api_key_length Services::Environment.integer(key: :api_key_length, default: 20) end |
.default_scan_excludes ⇒ Array<String>
Returns the default directory and file names to exclude from scanning
51 52 53 54 55 56 |
# File 'lib/validation/globals/globals.rb', line 51 def default_scan_excludes Services::Environment.fetch( key: :scan_excludes, default: '.git,node_modules,Pods,build,DerivedData,.build,vendor,.bundle,Carthage,.secure-keys,coverage' ).split(',') end |
.default_scan_extensions ⇒ Array<String>
Returns the default file extensions to scan
42 43 44 45 46 47 |
# File 'lib/validation/globals/globals.rb', line 42 def default_scan_extensions Services::Environment.fetch( key: :scan_extensions, default: '.swift,.m,.mm,.h,.rb,.py,.js,.ts,.java,.kt,.yaml,.yml,.json,.env,.plist' ).split(',') end |
.key_length ⇒ Integer
Returns the minimum length for a generic key
36 37 38 |
# File 'lib/validation/globals/globals.rb', line 36 def key_length Services::Environment.integer(key: :key_length, default: 16) end |
.max_scan_depth ⇒ Integer
Returns the maximum directory traversal depth for scanning
60 61 62 |
# File 'lib/validation/globals/globals.rb', line 60 def max_scan_depth Services::Environment.integer(key: :max_scan_depth, default: 10) end |
.min_entropy_threshold ⇒ Float
Returns the minimum Shannon entropy threshold for secret validation
66 67 68 |
# File 'lib/validation/globals/globals.rb', line 66 def min_entropy_threshold Services::Environment.decimal(key: :min_entropy_threshold, default: 3.0) end |
.password_length ⇒ Integer
Returns the minimum length for a password
30 31 32 |
# File 'lib/validation/globals/globals.rb', line 30 def password_length Services::Environment.integer(key: :password_length, default: 12) end |
.secret_length ⇒ Integer
Returns the minimum length for a secret
24 25 26 |
# File 'lib/validation/globals/globals.rb', line 24 def secret_length Services::Environment.integer(key: :secret_length, default: 16) end |
.token_length ⇒ Integer
Returns the minimum length for a token
18 19 20 |
# File 'lib/validation/globals/globals.rb', line 18 def token_length Services::Environment.integer(key: :token_length, default: 20) end |