aliyun_intelligent_captcha 0.1.1 → 0.1.2

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: 439870b8fbbf4efa1096f018d4a6da7c16e94c37ad69d9004ac1184343ac5723
4
- data.tar.gz: 9c3ff9d33936d52d0fc8a1146a6b33f183e9f664db6dbcaf51312955a5413831
3
+ metadata.gz: caa9e4f6902d4de2aac79931b4defab776b00dd83adc8d3aa3f74939474fce64
4
+ data.tar.gz: a46e141473aec0fbe94c8e44570ffa1b4ed3e1fc10e52594795248ece4b4440c
5
5
  SHA512:
6
- metadata.gz: e8c947510d890025ac956b903b12bfc80f7446418aa869a9a2751c0b756e418ae88e696dbf73daf24a0e2825c8712351f01d9262cc7ea1e1e2f6164e698eee8d
7
- data.tar.gz: af45e038d8cc9a4f278fb6436000ac3b06e2a5b0c41034fed5f91e335370629bc4192a9ed2d76d88b7954f6e57fb4d7f436ad600c2cdcd4b6bf90458aa91c01c
6
+ metadata.gz: ba5cabbf2947d157fbb3d5fadb8ffeb55e89bb5052e7506b81d63409036834e48f1d736a0081ab6ef3fec267258d586711b278d4beefe28aa9944de2496b2ca6
7
+ data.tar.gz: a32e969511454e5364c5f6167e1edaadd01d8715316dbd03353e3738aae89aa147d056111c7b686073b0cfe31b240772879daa7c941901d604da0d12be9252b1
data/README.md CHANGED
@@ -4,6 +4,15 @@ Ruby gem for verifying Alibaba Cloud intelligent captcha tokens with the `Verify
4
4
 
5
5
  It has no runtime dependency on the Alibaba Cloud SDK. The client signs requests with Alibaba Cloud ACS3-HMAC-SHA256 and uses Ruby's standard `Net::HTTP`.
6
6
 
7
+ ## Changelog
8
+
9
+ See [CHANGELOG.md](CHANGELOG.md) for version history and release notes.
10
+
11
+ ## Latest Release
12
+
13
+ - `0.1.1`
14
+ - Fix railtie inheritance to use top-level `::Rails::Railtie`, preventing constant lookup conflicts in Rails apps.
15
+
7
16
  ## Installation
8
17
 
9
18
  Add this line to your application's Gemfile:
@@ -15,7 +15,7 @@ require_relative "result"
15
15
  module AliyunIntelligentCaptcha
16
16
  class Client
17
17
  ACTION = "VerifyIntelligentCaptcha"
18
- CONTENT_TYPE = "application/json; charset=utf-8"
18
+ CONTENT_TYPE = "application/x-www-form-urlencoded"
19
19
  SIGNATURE_ALGORITHM = "ACS3-HMAC-SHA256"
20
20
 
21
21
  def initialize(access_key_id:,
@@ -57,12 +57,15 @@ module AliyunIntelligentCaptcha
57
57
 
58
58
  def perform_request(payload)
59
59
  uri = URI::HTTPS.build(host: @endpoint, path: "/")
60
- body = JSON.generate(payload)
60
+ body = URI.encode_www_form(payload)
61
61
  request = Net::HTTP::Post.new(uri)
62
62
  request.body = body
63
63
  signed_headers(body).each { |key, value| request[key] = value }
64
+ @logger&.info("[aliyun_intelligent_captcha] request: POST https://#{@endpoint}/ body=#{body.inspect}")
64
65
 
65
66
  response = @http_client ? @http_client.call(request, uri) : net_http_request(uri, request)
67
+ @logger&.info("[aliyun_intelligent_captcha] response: status=#{response.code} body=#{response.body}")
68
+
66
69
  validate_response!(response)
67
70
  response
68
71
  rescue Timeout::Error, SocketError, SystemCallError, OpenSSL::SSL::SSLError => error
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AliyunIntelligentCaptcha
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyun_intelligent_captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ming