panmind-zendesk 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +3 -3
  2. data/lib/panmind/zendesk.rb +17 -3
  3. metadata +52 -50
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'rake'
2
- require 'rake/rdoctask'
2
+ require 'rdoc/task'
3
3
 
4
4
  require './lib/panmind/zendesk'
5
5
 
@@ -14,7 +14,7 @@ begin
14
14
  'code to implement remote authentication'
15
15
 
16
16
  gemspec.authors = ['Fabrizio Regini','Marcello Barnaba']
17
- gemspec.email = 'info@panmind.org'
17
+ gemspec.email = 'info@panmind.com'
18
18
  gemspec.homepage = 'http://github.com/Panmind/zendesk'
19
19
 
20
20
  gemspec.files = %w( README.md Rakefile rails/init.rb ) + Dir['lib/**/*']
@@ -22,7 +22,7 @@ begin
22
22
  gemspec.has_rdoc = true
23
23
 
24
24
  gemspec.version = Panmind::Zendesk::Version
25
- gemspec.date = '2011-05-16'
25
+ gemspec.date = '2013-03-06'
26
26
 
27
27
  gemspec.require_path = 'lib'
28
28
 
@@ -13,14 +13,14 @@ module Panmind
13
13
  # - vjt Wed Jul 21 13:00:42 CEST 2010
14
14
  #
15
15
  module Zendesk
16
- Version = '1.0.2'
16
+ Version = '1.1.0'
17
17
 
18
18
  class ConfigurationError < StandardError; end
19
19
 
20
20
  class << self
21
21
  attr_reader :token, :hostname
22
22
 
23
- def auth_url; @auth_url ||= "http://#{hostname}/access/remote/".freeze end
23
+ def auth_url; @auth_url ||= "http://#{hostname}/access/remoteauth/".freeze end
24
24
  def return_url; @return_url ||= "http://#{hostname}/login".freeze end
25
25
  def support_url; @support_url ||= "http://#{hostname}/home".freeze end
26
26
 
@@ -100,7 +100,7 @@ module Panmind
100
100
  name, email = instance_exec(&Zendesk.login)
101
101
 
102
102
  now = params[:timestamp] || Time.now.to_i.to_s
103
- hash = Digest::MD5.hexdigest(name + email + Zendesk.token + now)
103
+ hash = remote_hash({:name => name, :email => email, :token => Zendesk.token, :timestamp => now})
104
104
  back = params[:return_to] || Zendesk.return_url
105
105
 
106
106
  auth_params = [
@@ -135,6 +135,20 @@ module Panmind
135
135
  redirect_to Zendesk.support_url
136
136
  end
137
137
  end
138
+
139
+ def remote_hash(args)
140
+ parts = []
141
+ parts << args[:name]
142
+ parts << args[:email]
143
+ parts << args[:external_id]
144
+ parts << args[:organization]
145
+ parts << args[:tags]
146
+ parts << args[:remote_photo_url]
147
+ parts << args[:token]
148
+ parts << args[:timestamp]
149
+ input = parts.join("|")
150
+ Digest::MD5.hexdigest(input)
151
+ end
138
152
  end
139
153
 
140
154
  module Routing
metadata CHANGED
@@ -1,82 +1,84 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: panmind-zendesk
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 0
8
- - 2
9
- version: 1.0.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Fabrizio Regini
13
9
  - Marcello Barnaba
14
10
  autorequire:
15
11
  bindir: bin
16
12
  cert_chain: []
17
-
18
- date: 2011-05-16 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: rails
13
+ date: 2013-03-06 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: panmind-zendesk
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
23
24
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
+ version_requirements: !ruby/object:Gem::Requirement
25
26
  none: false
26
- requirements:
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
31
+ - !ruby/object:Gem::Dependency
32
+ name: rails
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
27
36
  - - ~>
28
- - !ruby/object:Gem::Version
29
- segments:
30
- - 3
31
- - 0
32
- version: "3.0"
37
+ - !ruby/object:Gem::Version
38
+ version: '3.0'
33
39
  type: :runtime
34
- version_requirements: *id001
35
- description: The plugin implements the HTML generation code for the Zendesk dropbox and the necessary controller and routing code to implement remote authentication
36
- email: info@panmind.org
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '3.0'
47
+ description: The plugin implements the HTML generation code for the Zendesk dropbox
48
+ and the necessary controller and routing code to implement remote authentication
49
+ email: info@panmind.com
37
50
  executables: []
38
-
39
51
  extensions: []
40
-
41
- extra_rdoc_files:
52
+ extra_rdoc_files:
42
53
  - README.md
43
- files:
54
+ files:
44
55
  - README.md
45
56
  - Rakefile
46
57
  - lib/panmind/zendesk.rb
47
58
  - lib/panmind/zendesk/railtie.rb
48
59
  - rails/init.rb
49
- has_rdoc: true
50
60
  homepage: http://github.com/Panmind/zendesk
51
61
  licenses: []
52
-
53
62
  post_install_message:
54
63
  rdoc_options: []
55
-
56
- require_paths:
64
+ require_paths:
57
65
  - lib
58
- required_ruby_version: !ruby/object:Gem::Requirement
66
+ required_ruby_version: !ruby/object:Gem::Requirement
59
67
  none: false
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- segments:
64
- - 0
65
- version: "0"
66
- required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
73
  none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- segments:
72
- - 0
73
- version: "0"
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
74
78
  requirements: []
75
-
76
79
  rubyforge_project:
77
- rubygems_version: 1.3.7
80
+ rubygems_version: 1.8.23
78
81
  signing_key:
79
82
  specification_version: 3
80
83
  summary: Zendesk on Rails - Dropbox and Remote Authentication
81
84
  test_files: []
82
-