recaptcha 1.3.0 → 2.0.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
  SHA1:
3
- metadata.gz: e3c89ffab2c2bcfb9e2310157d81cca7a6310eb7
4
- data.tar.gz: 12e9212f8ec32eb1f67470fc0a0644a8570b1dae
3
+ metadata.gz: 0c0d1a72cc8afa953bf825eb56110bac7c2504f9
4
+ data.tar.gz: 8dd5b6d14ec70ff852a331e7f561669c79f89c1a
5
5
  SHA512:
6
- metadata.gz: 354b302b4061839590ac00b6c599c9d7317c1f8221e0ac3ef38ec514d52e459d0ecabbb347aaf1930a7e0aff8957e9835f122e8c73d8a7aba8763ddb6715a6d7
7
- data.tar.gz: b1045a9e879f6267ba59a44e738c89bbaac29c5f52fa68b8421dc68ec0fc782dfdf2557d63b10cefc9bb013f44f9d3826fcdf292128055e12c20e9daad3fb397
6
+ metadata.gz: 1b473d5e4f2e2d44f395b649bfc1f8eb191689e8ceab3ddbd02a2a97de8cf22a601157ac3a59ff5d6aeaa7f333530ffe351a99fd3eb0b7624e11c528db21a12b
7
+ data.tar.gz: d5b92c45ab72e016bfa6b0052de795a884eba337e456cd4dd89261de46a4f5428bd5aac70e6ae9106fd71794e4afdd7cf3971cad110761a225343396ee36104f
@@ -1,3 +1,12 @@
1
+ ## 2.0.0 - 2016-05-17
2
+ * remove stoken support, must use custom domain verification or domain whitelist
3
+
4
+ ## 1.3.0 - 2016-04-07
5
+ * do not set model error and flash
6
+
7
+ ## 1.2.0 - 2016-04-01
8
+ * custom domain validation
9
+
1
10
  ## 1.1.0 - 2016-01-27
2
11
  * support RACK_ENV
3
12
 
data/README.md CHANGED
@@ -72,8 +72,8 @@ Some of the options available:
72
72
  | :ajax | Render the dynamic AJAX captcha per the API. (default `false`)|
73
73
  | :public_key | Override public API key |
74
74
  | :error | Override the error code returned from the reCAPTCHA API (default `nil`)|
75
- | :stoken | Include security token to enable the use of any domain without registration with reCAPTCHA, `stoken expired` will be raised when the system clock is out of sync (default `true`)|
76
75
  | :size | Specify a size (default `nil`)|
76
+ | :hl | Optional. Forces the widget to render in a specific language. Auto-detects the user's language if unspecified. (See [language codes](https://developers.google.com/recaptcha/docs/language)) |
77
77
 
78
78
  You can also override the html attributes for the sizes of the generated `textarea` and `iframe`
79
79
  elements, if CSS isn't your thing. Inspect the source of `recaptcha_tags` to see these options.
@@ -1,7 +1,6 @@
1
1
  require 'recaptcha/configuration'
2
2
  require 'recaptcha/client_helper'
3
3
  require 'recaptcha/verify'
4
- require 'recaptcha/token'
5
4
  require 'uri'
6
5
  require 'net/http'
7
6
 
@@ -3,6 +3,7 @@ module Recaptcha
3
3
  # Your public API can be specified in the +options+ hash or preferably
4
4
  # using the Configuration.
5
5
  def recaptcha_tags(options = {})
6
+ raise(RecaptchaError, "Secure Token is deprecated.") if options[:stoken]
6
7
  public_key = options[:public_key] || Recaptcha.configuration.public_key!
7
8
 
8
9
  script_url = Recaptcha.configuration.api_server_url(ssl: options[:ssl])
@@ -14,7 +15,6 @@ module Recaptcha
14
15
  a[k] = v if data_attributes.include?(k)
15
16
  end
16
17
  data_attributes[:sitekey] = public_key
17
- data_attributes[:stoken] = Recaptcha::Token.secure_token if options[:stoken] != false
18
18
  data_attributes = data_attributes.map { |k,v| %{data-#{k.to_s.tr('_','-')}="#{v}"} }.join(" ")
19
19
 
20
20
  html = %{<script src="#{script_url}" async defer></script>\n}
@@ -1,3 +1,3 @@
1
1
  module Recaptcha
2
- VERSION = "1.3.0"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recaptcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason L Perry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-08 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -150,7 +150,6 @@ files:
150
150
  - lib/recaptcha/client_helper.rb
151
151
  - lib/recaptcha/configuration.rb
152
152
  - lib/recaptcha/rails.rb
153
- - lib/recaptcha/token.rb
154
153
  - lib/recaptcha/verify.rb
155
154
  - lib/recaptcha/version.rb
156
155
  homepage: http://github.com/ambethia/recaptcha
@@ -1,24 +0,0 @@
1
- require 'json'
2
- require 'recaptcha'
3
- require 'base64'
4
- require 'securerandom'
5
- require 'openssl'
6
-
7
- module Recaptcha
8
- module Token
9
-
10
- def self.secure_token
11
- private_key = Recaptcha.configuration.private_key
12
- raise RecaptchaError, "No private key specified." unless private_key
13
-
14
- stoken_json = {'session_id' => SecureRandom.uuid, 'ts_ms' => (Time.now.to_f * 1000).to_i}.to_json
15
- cipher = OpenSSL::Cipher::AES128.new(:ECB)
16
- private_key_digest = Digest::SHA1.digest(private_key)[0...16]
17
-
18
- cipher.encrypt
19
- cipher.key = private_key_digest
20
- encrypted_stoken = cipher.update(stoken_json) << cipher.final
21
- Base64.urlsafe_encode64(encrypted_stoken).gsub(/\=+\Z/, '')
22
- end
23
- end
24
- end