Sha256: 6b2a1ddc08692571c7ab4317cfe115477774c02b0873a1d2c9fa9c2f4e9e236d
Contents?: true
Size: 1.11 KB
Versions: 13
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true require "json" module Neetob class CLI module NeetoDeploy class Certificates < CLI::Base attr_accessor :app def initialize(app) super() @app = app end def run certificates_command_result = `neetodeploy certificates list -a #{app}` parseable_result = certificates_command_result.strip.gsub("=>", ":") parsed_certificates_result = JSON.parse(parseable_result) return parsed_certificates_result if Thread.current[:audit_mode] if parsed_certificates_result.empty? ui.error("No certificates found for the app with name \"#{app}\".") else parsed_certificates_result.each do |certificate| if certificate["expires_before_30_days"] ui.error("Certificate #{certificate["name"]} is expiring in less than 30 days.") else ui.success("Certificate #{certificate["name"]} is valid for over 30 days in the future.") end end end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems