awskeyring 1.9.3 → 1.9.5

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: ab7e97d00115352839c4d8e0824bb600df50322cab8fc819236635ff17235c3b
4
- data.tar.gz: bc9f08082c31fe1fdc130506ccab07f782b78b55aa8b55d45b51d2c93305a9fc
3
+ metadata.gz: b6ba49e965bca0b0058320cec1abfaaad640ce032c8e0307e1eb00c234de1290
4
+ data.tar.gz: 74c07eac3bf8080a776460a6466e789e6c18a31880fc619ea8ce2dca200b5d01
5
5
  SHA512:
6
- metadata.gz: 200fd3d71505cb09266c76ff58ed9ad09ed671353b3df800aa774e68e482e4f02d87304cd5af59a978f084493da97352b10eed7fa47fa3aafad7a4aabdbfdd26
7
- data.tar.gz: e0e114ab4d902e2ca79d571a34b88fd7d600abd322e6a98a2e44bd90f8b705a2d9571e9175fd3481e8666986d78b78e7de8c4b3038cd3e3744d5b61c60c0323f
6
+ metadata.gz: 93fe4ab30ce3b64de1ca11f3db11253593c5aba9935bb9b766ab17121f8fd4ae931ce3ac99769ca97bb00682b13b8909092e2741e95f4aa6fdffc967edeb345a
7
+ data.tar.gz: 39ababe4689fd33f5c5600adb08646e3e42fa0a67e5e93b69d608c346d90b4628ec828e35f1646038904f9b1e4f0017ed62e756222791f24cf4ae14acd275fd2
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016-2021 Tristan Morgan
3
+ Copyright (c) 2016-2022 Tristan Morgan
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![Awskeyring](https://raw.githubusercontent.com/servian/awskeyring/main/awskeyring-144.png)
4
4
 
5
- * [![Build Status](https://travis-ci.com/servian/awskeyring.svg?branch=main)](https://travis-ci.com/servian/awskeyring)
5
+ * [![Build Status](https://app.travis-ci.com/servian/awskeyring.svg?branch=main)](https://app.travis-ci.com/github/servian/awskeyring)
6
6
  * [![Gem Version](https://badge.fury.io/rb/awskeyring.svg)](https://badge.fury.io/rb/awskeyring)
7
7
  * [![license MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
8
8
  * [![All Downloads](https://ruby-gem-downloads-badge.herokuapp.com/awskeyring?type=total)](https://rubygems.org/gems/awskeyring)
data/awskeyring.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = Awskeyring::HOMEPAGE
16
16
  spec.licenses = ['MIT']
17
17
 
18
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/|^\..*|C.*\.md|.*\.ronn|.*\.png}) }
18
+ spec.files = %w[awskeyring.gemspec README.md LICENSE.txt] + Dir['exe/*', 'lib/**/*.rb', 'man/*.5', 'i18n/*']
19
19
  spec.bindir = 'exe'
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
@@ -6,7 +6,7 @@ require 'json'
6
6
  # Version const and query of latest.
7
7
  module Awskeyring
8
8
  # The Gem's version number
9
- VERSION = '1.9.3'
9
+ VERSION = '1.9.5'
10
10
  # The Gem's homepage
11
11
  HOMEPAGE = 'https://github.com/servian/awskeyring'
12
12
 
@@ -364,21 +364,16 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
364
364
  end
365
365
  item_hash = age_check_and_get(account: account, no_token: true)
366
366
 
367
- begin
368
- new_creds = Awskeyring::Awsapi.get_token(
369
- code: code,
370
- role_arn: (Awskeyring.get_role_arn(role_name: role) if role),
371
- duration: default_duration(options[:duration], role, code),
372
- mfa: item_hash[:mfa],
373
- key: item_hash[:key],
374
- secret: item_hash[:secret],
375
- user: ENV['USER']
376
- )
377
- Awskeyring.delete_token(account: account, message: '# Removing STS credentials')
378
- rescue Aws::Errors::ServiceError => e
379
- warn e.to_s
380
- exit 1
381
- end
367
+ new_creds = Awskeyring::Awsapi.get_token(
368
+ code: code,
369
+ role_arn: (Awskeyring.get_role_arn(role_name: role) if role),
370
+ duration: default_duration(options[:duration], role, code),
371
+ mfa: item_hash[:mfa],
372
+ key: item_hash[:key],
373
+ secret: item_hash[:secret],
374
+ user: ENV.fetch('USER', 'awskeyring')
375
+ )
376
+ Awskeyring.delete_token(account: account, message: '# Removing STS credentials')
382
377
 
383
378
  Awskeyring.add_token(
384
379
  account: account,
@@ -409,18 +404,13 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
409
404
 
410
405
  path = options[:path] || 'console'
411
406
 
412
- begin
413
- login_url = Awskeyring::Awsapi.get_login_url(
414
- key: cred[:key],
415
- secret: cred[:secret],
416
- token: cred[:token],
417
- path: path,
418
- user: ENV['USER']
419
- )
420
- rescue Aws::Errors::ServiceError => e
421
- warn e.to_s
422
- exit 1
423
- end
407
+ login_url = Awskeyring::Awsapi.get_login_url(
408
+ key: cred[:key],
409
+ secret: cred[:secret],
410
+ token: cred[:token],
411
+ path: path,
412
+ user: ENV.fetch('USER', 'awskeyring')
413
+ )
424
414
 
425
415
  if options['no-open']
426
416
  puts login_url
@@ -436,8 +426,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
436
426
  # autocomplete
437
427
  def autocomplete(curr, prev = nil)
438
428
  curr, prev = fix_args(curr, prev)
439
- comp_line = ENV['COMP_LINE']
440
- comp_point_str = ENV['COMP_POINT']
429
+ comp_line = ENV.fetch('COMP_LINE', nil)
430
+ comp_point_str = ENV.fetch('COMP_POINT', nil)
441
431
  unless comp_line && comp_point_str
442
432
  exec_name = File.basename($PROGRAM_NAME)
443
433
  warn I18n.t('message.awskeyring', path: $PROGRAM_NAME, bin: exec_name)
@@ -609,7 +599,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
609
599
  bundled_env = to_delete.map { |elem| elem[('BUNDLER_ORIG_'.length)..] }
610
600
  to_delete << 'BUNDLE_GEMFILE'
611
601
  bundled_env.each do |env_name|
612
- ENV[env_name] = ENV["BUNDLER_ORIG_#{env_name}"]
602
+ ENV[env_name] = ENV.fetch("BUNDLER_ORIG_#{env_name}", nil)
613
603
  to_delete << env_name if ENV["BUNDLER_ORIG_#{env_name}"].start_with? 'BUNDLER_'
614
604
  end
615
605
  to_delete.each do |env_name|
data/man/awskeyring.5 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AWSKEYRING" "5" "January 2022" "" ""
4
+ .TH "AWSKEYRING" "5" "October 2022" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBAwskeyring\fR \- is a small tool to manage AWS account keys in the macOS Keychain
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awskeyring
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.3
4
+ version: 1.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tristan Morgan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-18 00:00:00.000000000 Z
11
+ date: 2022-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-iam
@@ -73,10 +73,8 @@ executables:
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - Gemfile
77
76
  - LICENSE.txt
78
77
  - README.md
79
- - Rakefile
80
78
  - awskeyring.gemspec
81
79
  - exe/awskeyring
82
80
  - i18n/en.yml
@@ -94,9 +92,9 @@ licenses:
94
92
  metadata:
95
93
  bug_tracker_uri: https://github.com/servian/awskeyring/issues
96
94
  changelog_uri: https://github.com/servian/awskeyring/blob/main/CHANGELOG.md
97
- documentation_uri: https://rubydoc.info/gems/awskeyring/1.9.3
95
+ documentation_uri: https://rubydoc.info/gems/awskeyring/1.9.5
98
96
  rubygems_mfa_required: 'true'
99
- source_code_uri: https://github.com/servian/awskeyring/tree/v1.9.3
97
+ source_code_uri: https://github.com/servian/awskeyring/tree/v1.9.5
100
98
  wiki_uri: https://github.com/servian/awskeyring/wiki
101
99
  post_install_message:
102
100
  rdoc_options: []
data/Gemfile DELETED
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in awskeyring.gemspec
6
- gemspec
7
-
8
- group :development do
9
- gem 'github_changelog_generator'
10
- gem 'rake'
11
- gem 'ronn'
12
- gem 'rspec'
13
- gem 'rubocop'
14
- gem 'rubocop-performance'
15
- gem 'rubocop-rake'
16
- gem 'rubocop-rspec'
17
- gem 'rubocop-rubycw'
18
- gem 'simplecov'
19
- gem 'yard'
20
- end
data/Rakefile DELETED
@@ -1,63 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rubocop/rake_task'
5
- require 'ronn'
6
- require 'github_changelog_generator/task'
7
- require 'yard'
8
-
9
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
10
- config.user = 'servian'
11
- config.project = 'awskeyring'
12
- config.future_release = "v#{Awskeyring::VERSION}"
13
- config.since_tag = 'v0.10.0'
14
- end
15
-
16
- RuboCop::RakeTask.new do |rubocop|
17
- rubocop.options = %w[-D --enable-pending-cops]
18
- rubocop.requires << 'rubocop-performance'
19
- rubocop.requires << 'rubocop-rake'
20
- rubocop.requires << 'rubocop-rspec'
21
- rubocop.requires << 'rubocop-rubycw'
22
- end
23
-
24
- desc 'Run RSpec code examples'
25
- task :spec do
26
- puts 'Running RSpec...'
27
- require 'rspec/core'
28
- runner = RSpec::Core::Runner
29
- xcode = runner.run(%w[--pattern spec/**{,/*/**}/*_spec.rb --order rand --format documentation --color])
30
- abort 'RSpec failed' if xcode.positive?
31
- end
32
-
33
- desc 'Check filemode bits'
34
- task :filemode do
35
- puts 'Running FileMode...'
36
- files = Set.new(`git ls-files -z`.split("\x0"))
37
- dirs = Set.new(files.map { |file| File.dirname(file) })
38
- failure = []
39
- files.merge(dirs).each do |file|
40
- mode = File.stat(file).mode
41
- print '.'
42
- failure << file if (mode & 0x7) != ((mode >> 3) & 0x7)
43
- end
44
- abort "\nError: Incorrect file mode found\n#{failure.join("\n")}" unless failure.empty?
45
- print "\n"
46
- end
47
-
48
- desc 'generate manpage'
49
- task :ronn do
50
- puts 'Running Ronn...'
51
- doc = Ronn::Document.new('man/awskeyring.5.ronn')
52
- doc.date = Time.parse(`git show -s --format=%ad --date=short`)
53
- File.write('man/awskeyring.5', doc.to_roff)
54
- puts "done\n\n"
55
- end
56
-
57
- YARD::Rake::YardocTask.new do |t|
58
- t.options = ['--fail-on-warning', '--no-progress', '--files', '*.md']
59
- t.stats_options = ['--list-undoc']
60
- end
61
-
62
- desc 'Run Linting, Tests and Documetation tasks'
63
- task default: %i[filemode rubocop spec ronn yard]