Class: Chronicle::ETL::CLI::Authorizations
- Inherits:
-
SubcommandBase
- Object
- Thor
- CLIBase
- SubcommandBase
- Chronicle::ETL::CLI::Authorizations
- Defined in:
- lib/chronicle/etl/cli/authorizations.rb
Overview
CLI commands for authorizing chronicle-etl with third-party services
Instance Method Summary collapse
Methods inherited from SubcommandBase
banner, help, subcommand_prefix
Instance Method Details
#new(provider) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/chronicle/etl/cli/authorizations.rb', line 22 def new(provider) = (provider) credentials = load_credentials(provider: provider, credentials_source: [:credentials]) = .new(port: [:port], credentials: credentials) secrets = . secrets_namespace = [:secrets] || provider Chronicle::ETL::Secrets.set_all(secrets_namespace, secrets) pp secrets if [:print] cli_exit(message: "Authorization saved to '#{secrets_namespace}' secrets") rescue StandardError => e cli_fail(message: "Authorization not successful.\n#{e.}", exception: e) end |