oneaws 0.1.3 → 0.2.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 +4 -4
- data/lib/oneaws/client.rb +14 -3
- data/lib/oneaws/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4246492bb2bb3db3d687669b230897b097f2962c381822b7bbc5acd194d3af4b
|
4
|
+
data.tar.gz: 3e0a5e9de75af06e83671bc1bf89133ee6fdef8f68a367f7c520a0a9b89cfed2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76c21fcd42010ad553aa036898f3b629f920409713dd494a02e18683794924c3d5989f03ae1f8243fb5b794d8d238945646915c9e5cc6d4d555041baeb1f173c
|
7
|
+
data.tar.gz: 3b7dba5bd0457b20273ab25f56f9ca3ec78b7ef4a0abe1ec8385ce801cc2ad378e95ed2c4edc7161d5929135172b8f522902c3b497a47985a5a31be03725198f
|
data/lib/oneaws/client.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'onelogin'
|
2
2
|
require 'aws-sdk-core'
|
3
|
+
require 'io/console'
|
3
4
|
|
4
5
|
module Oneaws
|
5
6
|
class Client
|
@@ -32,13 +33,23 @@ module Oneaws
|
|
32
33
|
mfa = response.mfa
|
33
34
|
|
34
35
|
# sent push notification to OneLogin Protect
|
35
|
-
mfa_device = mfa.devices.
|
36
|
+
mfa_device = mfa.devices.first
|
36
37
|
|
37
38
|
if mfa_device.nil?
|
38
|
-
raise MfaDeviceNotFoundError.new("
|
39
|
+
raise MfaDeviceNotFoundError.new("MFA device not found.")
|
39
40
|
end
|
40
41
|
|
41
|
-
|
42
|
+
device_types_that_do_not_require_token = [
|
43
|
+
"OneLogin Protect"
|
44
|
+
]
|
45
|
+
|
46
|
+
otp_token = unless device_types_that_do_not_require_token.include?(mfa_device.type)
|
47
|
+
print "input OTP of #{mfa_device.type}: "
|
48
|
+
STDIN.noecho(&:gets)
|
49
|
+
end
|
50
|
+
|
51
|
+
response = @onelogin.get_saml_assertion_verifying(app_id, mfa_device.id, mfa.state_token, otp_token, nil, false)
|
52
|
+
|
42
53
|
if response.nil?
|
43
54
|
raise SamlRequestError.new("#{@onelogin.error} #{@onelogin.error_description}")
|
44
55
|
end
|
data/lib/oneaws/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oneaws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki Koya
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -93,7 +93,7 @@ metadata:
|
|
93
93
|
homepage_uri: https://github.com/pepabo/oneaws
|
94
94
|
source_code_uri: https://github.com/pepabo/oneaws
|
95
95
|
changelog_uri: https://github.com/pepabo/oneaws
|
96
|
-
post_install_message:
|
96
|
+
post_install_message:
|
97
97
|
rdoc_options: []
|
98
98
|
require_paths:
|
99
99
|
- lib
|
@@ -108,8 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
112
|
-
signing_key:
|
111
|
+
rubygems_version: 3.3.26
|
112
|
+
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Issue temporary credentials using OneLogin and AWS STS.
|
115
115
|
test_files: []
|