amazon_auth 0.6.0 → 0.8.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/README.md +2 -21
- data/amazon_auth.gemspec +1 -1
- data/lib/amazon_auth/converter.rb +2 -2
- data/lib/amazon_auth/extensions/session_extension.rb +3 -1
- data/lib/amazon_auth/version.rb +1 -1
- data/lib/amazon_auth.rb +1 -0
- metadata +6 -9
- data/.gitignore +0 -14
- data/.rspec +0 -2
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: be42ef6936b600922637d6ff82740c6cb355b8574336ba18142729fbcd5ab394
|
|
4
|
+
data.tar.gz: ec6d91bf0e702c892ae26e2d4edd5db2095bc6b322c78bc4b2dc3dd54f4a9beb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac1946c5930553fdee2febf9abd735eba70c033247edb679f2a06a4c16d8d309c7e97d03a0fbef6c69df7ccb05e9c06328e1985e7180e8636006a2374ef75a24
|
|
7
|
+
data.tar.gz: ceb6c2bbb0d5f8cf37129ab9d906eadecfaf6b3db0efa5d15476901f2487d55ef25b195ddff73581590877e80030e328468056744ae310252b2256512a3362b7
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AmazonAuth
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/rb/amazon_auth)
|
|
4
|
-
[](https://circleci.com/gh/kyamaguchi/amazon_auth)
|
|
5
5
|
|
|
6
6
|
Sign In Amazon using Capybara and Selenium
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ Or install it yourself as:
|
|
|
31
31
|
|
|
32
32
|
Before running, you need to **download chromedriver**.
|
|
33
33
|
And you may need to **update chromedriver regularly**.
|
|
34
|
-
Please download latest chromedriver_xxx.zip from
|
|
34
|
+
Please download latest chromedriver_xxx.zip from https://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
|
|
35
35
|
|
|
36
36
|
```
|
|
37
37
|
mv ~/Downloads/chromedriver /usr/local/bin/
|
|
@@ -120,31 +120,12 @@ client = AmazonAuth::Client.new(debug: true)
|
|
|
120
120
|
|
|
121
121
|
### Use Firefox
|
|
122
122
|
|
|
123
|
-
This gem may not work with newer versions of Firefox.
|
|
124
|
-
Check README of [capybara](https://github.com/teamcapybara/capybara).
|
|
125
|
-
|
|
126
|
-
Firefox (<= 47.0.2) may work better.
|
|
127
|
-
|
|
128
|
-
[Download Firefox](https://ftp.mozilla.org/pub/firefox/releases/)
|
|
129
|
-
Don't forget to disable automatic updates of Firefox.
|
|
130
|
-
|
|
131
|
-
You may also need geckodriver.
|
|
132
|
-
This may need to be older depending on the version of selenium-webdriver.
|
|
133
|
-
|
|
134
|
-
[Download geckodriver](https://github.com/mozilla/geckodriver/releases)
|
|
135
|
-
|
|
136
|
-
If the browser doesn't work, try selenium-webdriver version '~> 2.0' or different version of geckodriver/Firefox.
|
|
137
|
-
|
|
138
123
|
In console,
|
|
139
124
|
|
|
140
125
|
```
|
|
141
126
|
client = AmazonAuth::Client.new(driver: :firefox)
|
|
142
127
|
```
|
|
143
128
|
|
|
144
|
-
## TODO
|
|
145
|
-
|
|
146
|
-
- [Idea] Hook `submit_signin_form` after every `visit` and `click` action
|
|
147
|
-
|
|
148
129
|
## Development
|
|
149
130
|
|
|
150
131
|
Use _.env.development_ instead of _.env_ in development.
|
data/amazon_auth.gemspec
CHANGED
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.homepage = "https://github.com/kyamaguchi/amazon_auth"
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) || f.start_with?('.') }
|
|
17
17
|
spec.bindir = "exe"
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
19
19
|
spec.require_paths = ["lib"]
|
|
@@ -7,7 +7,7 @@ module AmazonAuth
|
|
|
7
7
|
|
|
8
8
|
def encode(str)
|
|
9
9
|
raise "Empty string" if str.to_s.size == 0
|
|
10
|
-
Base64.strict_encode64("#{salt}#{str}")
|
|
10
|
+
::Base64.strict_encode64("#{salt}#{str}")
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def salt
|
|
@@ -16,7 +16,7 @@ module AmazonAuth
|
|
|
16
16
|
|
|
17
17
|
def self.decode(code)
|
|
18
18
|
raise "Empty string" if code.to_s.size == 0
|
|
19
|
-
Base64.strict_decode64(code).gsub(/\A#{salt}/, '')
|
|
19
|
+
::Base64.strict_decode64(code).gsub(/\A#{salt}/, '')
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def self.salt
|
|
@@ -29,7 +29,9 @@ module AmazonAuth
|
|
|
29
29
|
session.visit url
|
|
30
30
|
debug "Visiting #{url}"
|
|
31
31
|
restore_cookies if keep_cookie?
|
|
32
|
-
if (
|
|
32
|
+
if session.current_url.include?('/ap/signin')
|
|
33
|
+
debug "current_url: [#{session.current_url}]"
|
|
34
|
+
elsif (link = find_sign_in_link)
|
|
33
35
|
debug "link: [#{link}]"
|
|
34
36
|
session.visit(link)
|
|
35
37
|
end
|
data/lib/amazon_auth/version.rb
CHANGED
data/lib/amazon_auth.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: amazon_auth
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kazuho Yamaguchi
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-09-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: capybara
|
|
@@ -158,9 +158,6 @@ executables:
|
|
|
158
158
|
extensions: []
|
|
159
159
|
extra_rdoc_files: []
|
|
160
160
|
files:
|
|
161
|
-
- ".gitignore"
|
|
162
|
-
- ".rspec"
|
|
163
|
-
- ".travis.yml"
|
|
164
161
|
- Gemfile
|
|
165
162
|
- LICENSE.txt
|
|
166
163
|
- README.md
|
|
@@ -181,7 +178,7 @@ homepage: https://github.com/kyamaguchi/amazon_auth
|
|
|
181
178
|
licenses:
|
|
182
179
|
- MIT
|
|
183
180
|
metadata: {}
|
|
184
|
-
post_install_message:
|
|
181
|
+
post_install_message:
|
|
185
182
|
rdoc_options: []
|
|
186
183
|
require_paths:
|
|
187
184
|
- lib
|
|
@@ -196,8 +193,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
196
193
|
- !ruby/object:Gem::Version
|
|
197
194
|
version: '0'
|
|
198
195
|
requirements: []
|
|
199
|
-
rubygems_version: 3.
|
|
200
|
-
signing_key:
|
|
196
|
+
rubygems_version: 3.1.6
|
|
197
|
+
signing_key:
|
|
201
198
|
specification_version: 4
|
|
202
199
|
summary: Login amazon.
|
|
203
200
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED