oneaws 0.3.0 → 0.4.0

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: dda27219e75a4a047c0ac7e6c10591eb46686a25007bc0ab55a08ea9ca6e6ab1
4
- data.tar.gz: d093f8296dac9c675c540c213a9090e6d743c5577408e9af04645d9a7f7edc0f
3
+ metadata.gz: af998829b0bd0674ee923e173025684f16c92be665ebccbad6064627ba8d90d7
4
+ data.tar.gz: c6710c75bf309c0d9dc1d4208815eebff4c01e5f3e057cee07a41ecf08626fac
5
5
  SHA512:
6
- metadata.gz: 85b6edf146b66166dc48d725f03d0a9e80c761d126f87ee72b864ec9d31a2fb42dfe506205ee7fce370f37a647c681bcf5b718bb3752da9d7237cc2bb6eb0c88
7
- data.tar.gz: 61fbf35cc9914673854e3b38b101d230872ef513a8fdba08bbf544dc7ab2b52e5effda941e268ca9e4bcd1f2f5afbf5785a1f6cb5183ff2def11a6b83dd01493
6
+ metadata.gz: 9053ce65d3d2f182e7c0a9c704fcf605cae97785779733c2820d1b171681c847d542a87ddd8c736e8c967faa33f0e8177525f65603c167a2e6a53c5c3071eb2a
7
+ data.tar.gz: e1030899f630dd449337bca924dbb878f8a64950539c9cb94b2f5152779c9e6a29b4b58c482ace512e406155a9ed3651389dc5abec0e7f7d85dc06f1fb90afd1
data/lib/oneaws/client.rb CHANGED
@@ -31,12 +31,23 @@ module Oneaws
31
31
  end
32
32
 
33
33
  mfa = response.mfa
34
+
35
+ if mfa.devices.length == 1
36
+ mfa_device = mfa.devices.first
37
+ else
38
+ puts "\nAvailable MFA devices:"
39
+ mfa.devices.each_with_index do |device, index|
40
+ puts "#{index + 1}. #{device.type} (ID: #{device.id})"
41
+ end
34
42
 
35
- # sent push notification to OneLogin Protect
36
- mfa_device = mfa.devices.first
43
+ print "\nSelect MFA device (1-#{mfa.devices.length}): "
44
+ selection = STDIN.gets.chomp.to_i
45
+
46
+ if selection < 1 || selection > mfa.devices.length
47
+ raise MfaDeviceNotFoundError.new("Invalid device selection.")
48
+ end
37
49
 
38
- if mfa_device.nil?
39
- raise MfaDeviceNotFoundError.new("MFA device not found.")
50
+ mfa_device = mfa.devices[selection - 1]
40
51
  end
41
52
 
42
53
  device_types_that_do_not_require_token = [
@@ -1,3 +1,3 @@
1
1
  module Oneaws
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
data/oneaws.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ['lib']
26
26
 
27
- spec.add_dependency 'aws-sdk-core'
27
+ spec.add_dependency 'aws-sdk-core', '~> 3.206.0'
28
28
  spec.add_dependency 'inifile'
29
29
  spec.add_dependency 'onelogin', '~> 1.6'
30
30
  spec.add_dependency 'thor'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oneaws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuki Koya
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-24 00:00:00.000000000 Z
11
+ date: 2024-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 3.206.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 3.206.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: inifile
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.4.10
111
+ rubygems_version: 3.5.16
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Issue temporary credentials using OneLogin and AWS STS.