awskeyring 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +5 -4
- data/Rakefile +6 -8
- data/lib/awskeyring.rb +4 -0
- data/lib/awskeyring/validate.rb +6 -6
- data/lib/awskeyring/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 665195367b45827f29c9a4815a6cf8f17fa414f31c9756a24bb2aefba704333e
|
4
|
+
data.tar.gz: 5a820147d8e6ab38df951b293bf0fb342a5a3eba2068607997adf69f152ceac2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49358a374bef7dffd71f9e30687856f80eb2a60e142770083ea1c8f3830593a06a61cff8bf2d69ddd19ae1c1147e891b15cac0df8203bc7727d6d39202866971
|
7
|
+
data.tar.gz: 898e363ac9613e735168870b65b7896ce44073bade612d4e9eb27176a3d3a2d0b895707516b68568c6b5cc5f82e394a208bf2412af941b3dc9b6e41245d725f9
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [v1.3.
|
3
|
+
## [v1.3.2](https://github.com/servian/awskeyring/tree/v1.3.2) (2020-04-27)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.3.1...v1.3.2)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Fix I18n message load when used as a library. [\#63](https://github.com/servian/awskeyring/pull/63) ([tristanmorgan](https://github.com/tristanmorgan))
|
10
|
+
|
11
|
+
## [v1.3.1](https://github.com/servian/awskeyring/tree/v1.3.1) (2020-03-19)
|
4
12
|
|
5
13
|
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.3.0...v1.3.1)
|
6
14
|
|
data/README.md
CHANGED
@@ -9,7 +9,8 @@
|
|
9
9
|
* [](https://rubygems.org/gems/awskeyring)
|
10
10
|
* [](https://www.rubydoc.info/gems/awskeyring)
|
11
11
|
|
12
|
-
Awskeyring is a small tool to manage AWS account keys in the macOS Keychain.
|
12
|
+
Awskeyring is a small tool to manage AWS account keys in the macOS Keychain. It has
|
13
|
+
grown to incorporate a lot of [features](https://github.com/servian/awskeyring/wiki/Awskeyring-features).
|
13
14
|
|
14
15
|
## Motivation
|
15
16
|
|
@@ -34,15 +35,15 @@ Please see the [Wiki](https://github.com/servian/awskeyring/wiki) for full usage
|
|
34
35
|
|
35
36
|
First you need to initialise your keychain to hold your AWS credentials.
|
36
37
|
|
37
|
-
awskeyring initialise
|
38
|
+
$ awskeyring initialise
|
38
39
|
|
39
40
|
Then add your keys to it.
|
40
41
|
|
41
|
-
awskeyring add personal-aws
|
42
|
+
$ awskeyring add personal-aws
|
42
43
|
|
43
44
|
Now your keys are stored safely in the macOS keychain. To print environment variables run...
|
44
45
|
|
45
|
-
awskeyring env personal-aws
|
46
|
+
$ awskeyring env personal-aws
|
46
47
|
|
47
48
|
Alternatively you can create a profile using the credential_process config variable. See the
|
48
49
|
[AWS CLI Config docs](https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#cli-aws-help-config-vars) for
|
data/Rakefile
CHANGED
@@ -26,17 +26,15 @@ RSpec::Core::RakeTask.new(:spec)
|
|
26
26
|
|
27
27
|
desc 'Check filemode bits'
|
28
28
|
task :filemode do
|
29
|
-
files = `git ls-files -z`.split("\x0")
|
30
|
-
|
31
|
-
|
29
|
+
files = Set.new(`git ls-files -z`.split("\x0"))
|
30
|
+
dirs = Set.new(files.map { |file| File.dirname(file) })
|
31
|
+
failure = []
|
32
|
+
files.merge(dirs).each do |file|
|
32
33
|
mode = File.stat(file).mode
|
33
34
|
print '.'
|
34
|
-
if (mode & 0x7) != (mode >> 3 & 0x7)
|
35
|
-
puts file
|
36
|
-
failure = true
|
37
|
-
end
|
35
|
+
failure << file if (mode & 0x7) != (mode >> 3 & 0x7)
|
38
36
|
end
|
39
|
-
abort
|
37
|
+
abort "\nError: Incorrect file mode found\n#{failure.join("\n")}" unless failure.empty?
|
40
38
|
print "\n"
|
41
39
|
end
|
42
40
|
|
data/lib/awskeyring.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'i18n'
|
3
4
|
require 'json'
|
4
5
|
require 'keychain'
|
5
6
|
require 'awskeyring/validate'
|
@@ -7,6 +8,9 @@ require 'awskeyring/validate'
|
|
7
8
|
# Awskeyring Module,
|
8
9
|
# gives you an interface to access keychains and items.
|
9
10
|
module Awskeyring # rubocop:disable Metrics/ModuleLength
|
11
|
+
I18n.load_path = Dir.glob(File.join(File.realpath(__dir__), '..', 'i18n', '*.{yml,yaml}'))
|
12
|
+
I18n.backend.load_translations
|
13
|
+
|
10
14
|
# Default rpeferences fole path
|
11
15
|
PREFS_FILE = (File.expand_path '~/.awskeyring').freeze
|
12
16
|
# Prefix for Roles
|
data/lib/awskeyring/validate.rb
CHANGED
@@ -9,7 +9,7 @@ module Awskeyring
|
|
9
9
|
#
|
10
10
|
# @param [String] account_name the associated account name.
|
11
11
|
def self.account_name(account_name)
|
12
|
-
raise 'Invalid Account Name' unless
|
12
|
+
raise 'Invalid Account Name' unless /\S+/.match?(account_name)
|
13
13
|
|
14
14
|
account_name
|
15
15
|
end
|
@@ -18,7 +18,7 @@ module Awskeyring
|
|
18
18
|
#
|
19
19
|
# @param [String] aws_access_key The aws_access_key_id
|
20
20
|
def self.access_key(aws_access_key)
|
21
|
-
raise 'Invalid Access Key' unless
|
21
|
+
raise 'Invalid Access Key' unless /\AAKIA[A-Z0-9]{12,16}\z/.match?(aws_access_key)
|
22
22
|
|
23
23
|
aws_access_key
|
24
24
|
end
|
@@ -36,7 +36,7 @@ module Awskeyring
|
|
36
36
|
#
|
37
37
|
# @param [String] mfa_arn The users MFA arn
|
38
38
|
def self.mfa_arn(mfa_arn)
|
39
|
-
raise 'Invalid MFA ARN' unless
|
39
|
+
raise 'Invalid MFA ARN' unless %r(\Aarn:aws:iam::[0-9]{12}:mfa\/\S*\z).match?(mfa_arn)
|
40
40
|
|
41
41
|
mfa_arn
|
42
42
|
end
|
@@ -45,7 +45,7 @@ module Awskeyring
|
|
45
45
|
#
|
46
46
|
# @param [String] role_name
|
47
47
|
def self.role_name(role_name)
|
48
|
-
raise 'Invalid Role Name' unless
|
48
|
+
raise 'Invalid Role Name' unless /\S+/.match?(role_name)
|
49
49
|
|
50
50
|
role_name
|
51
51
|
end
|
@@ -54,7 +54,7 @@ module Awskeyring
|
|
54
54
|
#
|
55
55
|
# @param [String] role_arn The role arn
|
56
56
|
def self.role_arn(role_arn)
|
57
|
-
raise 'Invalid Role ARN' unless
|
57
|
+
raise 'Invalid Role ARN' unless %r(\Aarn:aws:iam::[0-9]{12}:role\/\S*\z).match?(role_arn)
|
58
58
|
|
59
59
|
role_arn
|
60
60
|
end
|
@@ -63,7 +63,7 @@ module Awskeyring
|
|
63
63
|
#
|
64
64
|
# @param [String] mfa_code The mfa code
|
65
65
|
def self.mfa_code(mfa_code)
|
66
|
-
raise 'Invalid MFA CODE' unless
|
66
|
+
raise 'Invalid MFA CODE' unless /\A\d{6}\z/.match?(mfa_code)
|
67
67
|
|
68
68
|
mfa_code
|
69
69
|
end
|
data/lib/awskeyring/version.rb
CHANGED
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.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-iam
|