Class: Neetob::CLI::MonthlyAudit::Misc::SparkpostSubAccountUsedForAllApps

Inherits:
Base
  • Object
show all
Defined in:
lib/neetob/cli/monthly_audit/misc/sparkpost_sub_account_used_for_all_apps.rb

Constant Summary collapse

APPS_TO_IGNORE =
["neeto-wheel-web"]

Constants inherited from Base

Base::NEETO_APPS_LIST_LINK

Instance Attribute Summary

Attributes inherited from Base

#ui

Instance Method Summary collapse

Methods included from Utils

#camel_case_to_slug, #is_upper?, #symbolize_keys

Constructor Details

#initializeSparkpostSubAccountUsedForAllApps

Returns a new instance of SparkpostSubAccountUsedForAllApps.



10
11
12
# File 'lib/neetob/cli/monthly_audit/misc/sparkpost_sub_account_used_for_all_apps.rb', line 10

def initialize
  super()
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/neetob/cli/monthly_audit/misc/sparkpost_sub_account_used_for_all_apps.rb', line 14

def run
  repo_data = [["App",
"SPARKPOST_PASSWORD env variable first 4 characters same as corresponding sub-account in Sparkpost dashboard", "Comments", "Audit Passed"]]
  ui.info "\n"
  ui.info "#### Please manually check and add Yes/No for all the following checks:"
  ui.info "- Get the first 4 characters of the SPARKPOST_PASSWORD environment variable for the app"
  ui.info "- Go to https://app.sparkpost.com/account/api-keys"
  ui.info "- Match the first 4 characters against the API keys values"
  ui.info "- Verify that the API key belongs to the subaccount for same app. Accordingly add Yes/No in the 2nd column"
  ui.info "- Finally, set Audit Passed as Yes only if the last check passed, otherwise set it as No and add a comment in the Comments column"
  ui.info "\n"
  NeetoCompliance::NeetoRepos.products.keys.each do |repo|
    repo_data << (
      APPS_TO_IGNORE.include?(repo) ?
      [repo, "No", "App ignored from this check", "Ignored"] :
      [repo, nil, nil, nil]
    )
  end
  ui.print_table(repo_data)
end