Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test pr #17

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d7a9a25
Create README.md
Jul 16, 2013
4778cb9
remove Savon 1.x style configuration for compatbility with Savon 2.x
Jul 17, 2013
25bb205
minor cleanup to make tests pass w/o warnings
Jul 17, 2013
8e1ad94
update gemspec after forking
Jul 17, 2013
576c318
update gemspec after forking
Jul 17, 2013
4d09015
update gemspec, version
Jul 18, 2013
bb7a843
use generic company name in spec
Jul 18, 2013
a166e42
remove pry from spec
Jul 18, 2013
b262fe8
handle leads with no lead attributes set
Jul 18, 2013
1acff5a
Update get_lead for new Savon API; broke lots of rspec; removed old c…
Jul 18, 2013
822f42c
Update README.md
Jul 18, 2013
f6137eb
- Rewrite API for sanity and concision
Jul 19, 2013
656abc3
Merge branch 'master' of https://github.com/jgeorge-gc/marketo_gem
Jul 19, 2013
d9d790b
update version to 0.0.3
Jul 19, 2013
a53f8bc
update to 0.0.4, change sync_lead to be more descriptive
Jul 19, 2013
9854a43
0.0.5: default log fixes
Jul 19, 2013
940e787
fix classname reference in gemspec
Jul 19, 2013
9811807
logger fixes
Jul 19, 2013
df319d3
update version
Jul 19, 2013
30a8fad
remove pry
Jul 19, 2013
25c7425
rspec tests run but don't all succeed; lead_key and authentication_he…
Jul 20, 2013
3e25bb8
update rspec tests to cover basic use cases in new API
Jul 22, 2013
dfbc6d6
change default WSDL to bundled marketo API 2.1 WSDL as optimization a…
Jul 22, 2013
16dff9d
updated docs
Jul 22, 2013
ef49fb8
fix exception with duplicate lead email addresses
Jul 29, 2013
168c619
add list key type
Jul 29, 2013
89843ef
add lead type
Jul 29, 2013
ea5f375
add support for list operations
Jul 29, 2013
c2d03c0
update version to 0.0.10
Jul 29, 2013
1cd72e6
Create PULL_REQUEST_TEMPLATE.md
Mar 15, 2016
c797913
Merge pull request #2 from jgeorge-gc/pr-template
Mar 15, 2016
501ae76
Update README.md
Mar 15, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Description: <brief description of feature>
Code reviewed by: <reviewer's name>
Tested by: <tester's name>
PM reviewed by: <PM name>
TeamCity passed: [yes]
Test plan: <URL>
Risk/complexity: [high|low]
Impact/scope: [high|low]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
marketo_gem
===========
Fork of the original Rapleaf marketo gem to support updates to the Marketo API and fix some bugs.

Use at your own risk.
6 changes: 2 additions & 4 deletions lib/marketo.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
require 'rubygems'
require 'savon'

Savon.configure do |config|
config.log = false # disable logging
end

require File.expand_path('marketo/client', File.dirname(__FILE__))
require File.expand_path('marketo/authentication_header', File.dirname(__FILE__))
require File.expand_path('marketo/enums', File.dirname(__FILE__))
require File.expand_path('marketo/key', File.dirname(__FILE__))
require File.expand_path('marketo/lead_key', File.dirname(__FILE__))
require File.expand_path('marketo/list_key', File.dirname(__FILE__))
require File.expand_path('marketo/lead_record', File.dirname(__FILE__))


Expand Down
31 changes: 10 additions & 21 deletions lib/marketo/authentication_header.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Rapleaf
module Grabcad
module Marketo
# This class exists only to encapsulate the authentication header part of a soap request to marketo
# Marketo requires a somewhat complex calculation of an encrypted signature and so it seemed sensible to pull this code out here
# It contains a SHA1-based MAC based on a timestamp
class AuthenticationHeader
DIGEST = OpenSSL::Digest::Digest.new('sha1')

Expand All @@ -12,36 +12,25 @@ def initialize(access_key, secret_key, time = DateTime.now)
end

public
# time should be a DateTime instance
def set_time(time)
@time = time
end

def get_mktows_user_id
@access_key
end

def get_request_signature
calculate_signature
end

def get_request_timestamp
@time.to_s
end

def to_hash
{
"mktowsUserId" => get_mktows_user_id,
"requestSignature" => get_request_signature,
"requestTimestamp" => get_request_timestamp
"mktowsUserId" => @access_key,
"requestSignature" => calculate_signature,
"requestTimestamp" => request_timestamp
}
end

private
def request_timestamp
@time.to_s
end

def calculate_signature
request_timestamp = get_request_timestamp
string_to_encrypt = request_timestamp + @access_key
OpenSSL::HMAC.hexdigest(DIGEST, @secret_key, string_to_encrypt)
OpenSSL::HMAC.hexdigest(DIGEST, @secret_key, request_timestamp + @access_key)
end
end
end
Expand Down
Loading