userbin 0.2.1 → 0.2.2

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: 7b561838ff6f87c720146c20d9817b0db06b8ff2
4
- data.tar.gz: 3ecd413667cffa28272e8f7563ea1009b0057bfb
3
+ metadata.gz: a53b7ce5956e924c312988da213d450af0452dd9
4
+ data.tar.gz: f23fff56bb22109692e8a56799b3c6a432b2db74
5
5
  SHA512:
6
- metadata.gz: 9b7af19543462d9cb59d5f3060c3fafb91a529b06832d34aa43b52957a6b98b878694028ea75e428fcb5553686f976211ce4aa08b47b51457c49ee3cde9eb7a8
7
- data.tar.gz: 33a11c347a277150e55f581b2cab91a4328b241aa2bd8758081cf11f784d1c97af5a9e3c8b8621e1a6cb7c0124a1ca758fffaeebcabbdb653a8e5fb8fbf24cc8
6
+ metadata.gz: 0285983c3614f68e4072ffa316bf145ea3a3590220c8e517a649c084876b3b78212ef1b687feaac0b443af810b143d2deae74f1d388a9571fcce48b5c16b039d
7
+ data.tar.gz: ecc1820bd394efe36441919b64e3de39ebf33b9d10fce94d0581d1d0f8080b8bd619c459447ba62a0ad96d886c7aa74d48e02d900269fa2e62c92ed428ebbe8b
@@ -41,9 +41,9 @@ module Userbin
41
41
  }
42
42
 
43
43
  Rack::Utils.delete_cookie_header!(
44
- headers, 'userbin_signature', value = {})
44
+ headers, '_ubs', value = {})
45
45
  Rack::Utils.delete_cookie_header!(
46
- headers, 'userbin_data', value = {})
46
+ headers, '_ubd', value = {})
47
47
 
48
48
  [ 400, headers, [message] ]
49
49
  end
@@ -68,7 +68,7 @@ module Userbin
68
68
 
69
69
  def script_tag
70
70
  script_url = ENV.fetch('USERBIN_SCRIPT_URL') {
71
- "https://userbin.com/js/v0"
71
+ "https://js.userbin.com"
72
72
  }
73
73
  str = <<-SCRIPT_TAG
74
74
  <script src="#{script_url}?#{Userbin.config.app_id}"></script>
@@ -129,14 +129,14 @@ module Userbin
129
129
 
130
130
  if signature && data
131
131
  Rack::Utils.set_cookie_header!(
132
- headers, 'userbin_signature', value: signature, path: '/')
132
+ headers, '_ubs', value: signature, path: '/')
133
133
  Rack::Utils.set_cookie_header!(
134
- headers, 'userbin_data', value: data, path: '/')
134
+ headers, '_ubd', value: data, path: '/')
135
135
  else
136
136
  Rack::Utils.delete_cookie_header!(
137
- headers, 'userbin_signature', value = {})
137
+ headers, '_ubs', value = {})
138
138
  Rack::Utils.delete_cookie_header!(
139
- headers, 'userbin_data', value = {})
139
+ headers, '_ubd', value = {})
140
140
  end
141
141
 
142
142
  [status, headers, response]
@@ -1,7 +1,7 @@
1
1
  module Userbin
2
2
  def self.authenticate_events!(request, now = Time.now)
3
3
  signature, data =
4
- request.params.values_at('userbin_signature', 'userbin_data')
4
+ request.params.values_at('signature', 'data')
5
5
 
6
6
  valid_signature?(signature, data)
7
7
 
@@ -12,7 +12,7 @@ module Userbin
12
12
  #
13
13
  def self.authenticate!(request, now = Time.now)
14
14
  signature, data =
15
- request.cookies.values_at('userbin_signature', 'userbin_data')
15
+ request.cookies.values_at('_ubs', '_ubd')
16
16
 
17
17
  if signature && data && valid_signature?(signature, data)
18
18
 
@@ -34,7 +34,7 @@ module Userbin
34
34
  end
35
35
 
36
36
  def self.refresh_session(user_id)
37
- api_endpoint = ENV["USERBIN_API_ENDPOINT"] || 'https://userbin.com/api/v0'
37
+ api_endpoint = ENV["USERBIN_API_ENDPOINT"] || 'https://api.userbin.com'
38
38
  uri = URI("#{api_endpoint}/users/#{user_id}/sessions")
39
39
  net = Net::HTTP.post_form(uri, {})
40
40
  uri.user = config.app_id
@@ -1,3 +1,3 @@
1
1
  module Userbin
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/userbin.rb CHANGED
@@ -9,7 +9,7 @@ require "userbin/basic_auth"
9
9
  require "userbin/railtie" if defined?(Rails::Railtie)
10
10
 
11
11
  api_endpoint = ENV.fetch('USERBIN_API_ENDPOINT') {
12
- "https://userbin.com/api/v0"
12
+ "https://api.userbin.com"
13
13
  }
14
14
 
15
15
  @api = Her::API.setup url: api_endpoint do |c|
data/spec/userbin_spec.rb CHANGED
@@ -11,7 +11,7 @@ describe Userbin do
11
11
 
12
12
  let (:args) do
13
13
  {
14
- "HTTP_COOKIE" => "userbin_signature=abcd; userbin_data=#{CGI.escape(MultiJson.encode(session))} "
14
+ "HTTP_COOKIE" => "_ubs=abcd; _ubd=#{CGI.escape(MultiJson.encode(session))} "
15
15
  }
16
16
  end
17
17
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: userbin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan