oneaws 0.5.0 → 0.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f54d58039f558feb418d69d9252d073333ac9a0fc6278f14d2e2589110908f2
4
- data.tar.gz: 8185852f34183388ee1038aceade221dac8308cf0253d6ef37a8b4e911728a79
3
+ metadata.gz: 4703d2dc9224791ac0371ddd739ab899e62920749111148b46c3a664c7952e77
4
+ data.tar.gz: 2b34d7a1278a18d71409754fdbc303781f29f440610108c138a02cfbf75e42b2
5
5
  SHA512:
6
- metadata.gz: 44c212bffa35b64a4150a008b4755a08b3a817ccb91de8a9e8a41dcb93e9fe07187b2c0eeec961adb39e2a4b11a6a2d6a81b10ac94884871b86eb32302edb9a9
7
- data.tar.gz: b46a0acaf73c53fb6bfec0dcf5e778bde1a58332233b6b476e2cfc53f232f6f2b9b70a5dab0b8341e9856e8f9b93f6259c105ce8f1c84db21f881ee1e3bac75d
6
+ metadata.gz: cbbb5ac0988de0813939b348f79aaa97fba800d9ac0ec38faf39e56a6410c780cf95824eb9f018cd7fb6c83a8aacd720f9f6ed00dd3a05b183243cc3a8c5bd23
7
+ data.tar.gz: db5971dde56056811590806fdc4fa5133e99830f3f76e3afeb1bb6b780ce6ebe1f657fdafc0e52f70db0100746fced72398c77729196e659a125a8ba2f7f25f9
data/README.md CHANGED
@@ -51,3 +51,5 @@ Select MFA device (1-2):
51
51
  ```
52
52
 
53
53
  デバイスの選択が面倒な場合は、環境変数 `ONEAWS_MFA_DEVICE` を指定することで、指定した番号のデバイスを自動で選択できます。上記を例にすると、`1. OneLogin Protect` を選ぶ場合は `ONEAWS_MFA_DEVICE=1` と指定します。
54
+
55
+ ワンタイムパスワードが必要なデバイスを選択した場合、 `--otp` オプションでワンタイムパスワードを指定することができます。
data/lib/oneaws/cli.rb CHANGED
@@ -10,6 +10,7 @@ module Oneaws
10
10
  option :update_aws_credentials, aliases: "-u", type: :boolean, default: true
11
11
  option :profile, aliases: "-p", type: :string, default: "oneaws"
12
12
  option :eval, type: :string, enum: ["bash", "fish"]
13
+ option :otp, type: :string
13
14
  def getkey
14
15
  client = Client.new
15
16
 
@@ -19,7 +20,7 @@ module Oneaws
19
20
  app_id: ENV['ONELOGIN_APP_ID'],
20
21
  subdomain: ENV['ONELOGIN_SUBDOMAIN'],
21
22
  }
22
- credential = client.issue_credential(params)
23
+ credential = client.issue_credential(params, options[:otp])
23
24
 
24
25
  if options["update_aws_credentials"]
25
26
  credential_file = File.expand_path(find_credentials)
@@ -52,6 +53,11 @@ module Oneaws
52
53
  end
53
54
  end
54
55
 
56
+ desc 'version', 'Show version'
57
+ def version
58
+ puts Oneaws::VERSION
59
+ end
60
+
55
61
  private
56
62
 
57
63
  # AWS の credential を以下の順番で存在チェックをする
data/lib/oneaws/client.rb CHANGED
@@ -20,7 +20,7 @@ module Oneaws
20
20
  )
21
21
  end
22
22
 
23
- def issue_credential(options)
23
+ def issue_credential(options, otp = nil)
24
24
  username = options[:username]
25
25
  password = options[:password]
26
26
  app_id = options[:app_id]
@@ -37,7 +37,11 @@ module Oneaws
37
37
  "OneLogin Protect"
38
38
  ]
39
39
 
40
- otp_token = unless device_types_that_do_not_require_token.include?(mfa_device.type)
40
+ otp_token = if device_types_that_do_not_require_token.include?(mfa_device.type)
41
+ nil
42
+ elsif otp
43
+ otp
44
+ else
41
45
  print "input OTP of #{mfa_device.type}: "
42
46
  STDIN.noecho(&:gets)
43
47
  end
@@ -1,3 +1,3 @@
1
1
  module Oneaws
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oneaws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuki Koya
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-02-20 00:00:00.000000000 Z
10
+ date: 2025-04-23 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: aws-sdk-core
@@ -121,7 +120,6 @@ metadata:
121
120
  homepage_uri: https://github.com/pepabo/oneaws
122
121
  source_code_uri: https://github.com/pepabo/oneaws
123
122
  changelog_uri: https://github.com/pepabo/oneaws
124
- post_install_message:
125
123
  rdoc_options: []
126
124
  require_paths:
127
125
  - lib
@@ -136,8 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
134
  - !ruby/object:Gem::Version
137
135
  version: '0'
138
136
  requirements: []
139
- rubygems_version: 3.5.22
140
- signing_key:
137
+ rubygems_version: 3.6.2
141
138
  specification_version: 4
142
139
  summary: Issue temporary credentials using OneLogin and AWS STS.
143
140
  test_files: []