Skip to content

Instantly share code, notes, and snippets.

@kbighorse
Created October 11, 2013 18:46
Show Gist options
  • Select an option

  • Save kbighorse/6939963 to your computer and use it in GitHub Desktop.

Select an option

Save kbighorse/6939963 to your computer and use it in GitHub Desktop.
Good tool_provider and request.
GOOD:
=> #<IMS::LTI::ToolProvider:0x007fb4f1425f88
@consumer_key="test",
@consumer_secret="secret",
@context_id="creativity13",
@context_title="Crash Course in Creativity",
@custom_params=
{"message_from_sinatra"=>"hey from the sinatra example consumer"},
@ext_params={},
@launch_presentation_return_url="http://localhost:3000/tool_return",
@lis_outcome_service_url="http://localhost:3000/grade_passback",
@lis_person_name_given="kimball",
@lis_result_sourcedid="oi",
@lti_message_type="basic-lti-launch-request",
@lti_version="LTI-1p0",
@non_spec_params={},
@oauth_consumer_key="test",
@oauth_nonce="b3luC52faPe7k6wTga0N894R0bqildh11w6GNpm6hg",
@oauth_signature="6kQvehKsxqOVOZG5AvMtTfw1z08=",
@oauth_signature_method="HMAC-SHA1",
@oauth_timestamp="1381515545",
@oauth_version="1.0",
@outcome_requests=[],
@resource_link_id="thisisuniquetome",
@roles=["learner"],
@tool_consumer_instance_name="NovoEd",
@user_id="6b743689ac31c9b583361670b7928630">
=> #<Sinatra::Request:0x007fb4f2274ee0
@env=
{"CONTENT_LENGTH"=>"720",
"CONTENT_TYPE"=>"application/x-www-form-urlencoded",
"GATEWAY_INTERFACE"=>"CGI/1.1",
"PATH_INFO"=>"/lti_tool",
"QUERY_STRING"=>"",
"REMOTE_ADDR"=>"127.0.0.1",
"REMOTE_HOST"=>"localhost",
"REQUEST_METHOD"=>"POST",
"REQUEST_URI"=>"http://localhost:9394/lti_tool",
"SCRIPT_NAME"=>"",
"SERVER_NAME"=>"localhost",
"SERVER_PORT"=>"9394",
"SERVER_PROTOCOL"=>"HTTP/1.1",
"SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/1.9.3/2013-02-22)",
"HTTP_HOST"=>"localhost:9394",
"HTTP_CONNECTION"=>"keep-alive",
"HTTP_CACHE_CONTROL"=>"max-age=0",
"HTTP_ACCEPT"=>
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"HTTP_ORIGIN"=>"http://localhost:3000",
"HTTP_USER_AGENT"=>
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36",
"HTTP_REFERER"=>"http://localhost:3000/tool_launch",
"HTTP_ACCEPT_ENCODING"=>"gzip,deflate,sdch",
"HTTP_ACCEPT_LANGUAGE"=>"en-US,en;q=0.8",
"HTTP_COOKIE"=>
"request_method=GET; _scaffold_session=cm5xRWhFL0lRa1FaaXdDazVYbTN0MGhjQ1IwQ0h2d1A3emh3UWdYODlZOHp5aHc3V003MHdGU0x6T2lpWWZBaGp0azREU3FSaVFaTWx1Q252Y1lNZjJ
"rack.version"=>[1, 2],
"rack.input"=>
#<Rack::Lint::InputWrapper:0x007fb4f15a3450
@input=#<StringIO:0x007fb4f11e1218>>,
"rack.errors"=>
#<Rack::Lint::ErrorWrapper:0x007fb4f15aefd0 @error=#<IO:<STDERR>>>,
"rack.multithread"=>true,
"rack.multiprocess"=>false,
"rack.run_once"=>false,
"rack.url_scheme"=>"http",
"HTTP_VERSION"=>"HTTP/1.1",
"REQUEST_PATH"=>"/lti_tool",
"sinatra.commonlogger"=>true,
"rack.request.form_input"=>
#<Rack::Lint::InputWrapper:0x007fb4f15a3450
@input=#<StringIO:0x007fb4f11e1218>>,
"rack.request.form_hash"=>
{"oauth_consumer_key"=>"test",
"oauth_signature_method"=>"HMAC-SHA1",
"oauth_timestamp"=>"1381515545",
"oauth_nonce"=>"b3luC52faPe7k6wTga0N894R0bqildh11w6GNpm6hg",
"oauth_version"=>"1.0",
"context_id"=>"creativity13",
"context_title"=>"Crash Course in Creativity",
"custom_message_from_sinatra"=>"hey from the sinatra example consumer",
"launch_presentation_return_url"=>"http://localhost:3000/tool_return",
"lis_outcome_service_url"=>"http://localhost:3000/grade_passback",
"lis_person_name_given"=>"kimball",
"lis_result_sourcedid"=>"oi",
"lti_message_type"=>"basic-lti-launch-request",
"lti_version"=>"LTI-1p0",
"resource_link_id"=>"thisisuniquetome",
"roles"=>"learner",
"tool_consumer_instance_name"=>"NovoEd",
"user_id"=>"6b743689ac31c9b583361670b7928630",
"oauth_signature"=>"6kQvehKsxqOVOZG5AvMtTfw1z08="},
"rack.request.form_vars"=>
"oauth_consumer_key=test&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1381515545&oauth_nonce=b3luC52faPe7k6wTga0N894R0bqildh11w6GNpm6hg&oauth_version=
"rack.logger"=>
#<Logger:0x007fb4f20c5f18
@default_formatter=
#<Logger::Formatter:0x007fb4f20c5e78 @datetime_format=nil>,
@formatter=nil,
@level=1,
@logdev=
#<Logger::LogDevice:0x007fb4f20c5e28
@dev=#<Rack::Lint::ErrorWrapper:0x007fb4f15aefd0 @error=#<IO:<STDERR>>>,
@filename=nil,
@mutex=
#<Logger::LogDevice::LogDeviceMutex:0x007fb4f20c5db0
@mon_count=0,
@mon_mutex=#<Mutex:0x007fb4f20c5d38>,
@mon_owner=nil>,
@shift_age=nil,
@shift_size=nil>,
@progname=nil>,
"rack.session"=>
{"csrf"=>"f2f26674ecd173bc5bb22a39c0e8c7492d0f9263cba5dbacf01b89bedd6260ae", "tracking"=>{"HTTP_USER_AGENT"=>"1c511875ee287e7aeb0b4415ff9ff14257b051d2", "
"rack.session.options"=>
{:path=>"/",
:domain=>nil,
:expire_after=>nil,
:secure=>false,
:httponly=>true,
:defer=>false,
:renew=>false,
:sidbits=>128,
:secure_random=>SecureRandom,
:coder=>#<Rack::Session::Cookie::Base64::Marshal:0x007fb4f11fe3e0>},
"rack.request.cookie_hash"=>
{"request_method"=>"GET",
"_scaffold_session"=>
"cm5xRWhFL0lRa1FaaXdDazVYbTN0MGhjQ1IwQ0h2d1A3emh3UWdYODlZOHp5aHc3V003MHdGU0x6T2lpWWZBaGp0azREU3FSaVFaTWx1Q252Y1lNZjJwSkRWb2hwM1E2R2Z6U0srMDErTjk0VitEM2l
"PHPSESSID"=>"dd04306323ef3a25f294f12da620ab4b",
"rack.session"=>
"BAh7CEkiCWNzcmYGOgZFRiJFZDc1MjEzYTU0MTZiNmFhNzMwNTViMDRmNTg0\nYjE3ZmZkYzM4MjI0ZGEzNTZlNjE2Y2MyMzFmNDE1NDE1ZTM0NUkiDXRyYWNr\naW5nBjsARnsISSIUSFRUUF9VU0V
"_entrepreneurship_session"=>
"BAh7BzoQX2NzcmZfdG9rZW5JIjFTdkU0QzFXQVA1dFQ0ZHFETTJlandqeDNHbEtMeHMxbzE2RTdGWHhWUFMwPQY6BkVGSSIPc2Vzc2lvbl9pZAY7BkZJIiU4NjQ1OTY4MzhhNDU4OWU3ZmYzZGEyZTQ
"rack.request.cookie_string"=>
"request_method=GET; _scaffold_session=cm5xRWhFL0lRa1FaaXdDazVYbTN0MGhjQ1IwQ0h2d1A3emh3UWdYODlZOHp5aHc3V003MHdGU0x6T2lpWWZBaGp0azREU3FSaVFaTWx1Q252Y1lNZjJ
"rack.session.unpacked_cookie_data"=>
{"csrf"=>
"d75213a5416b6aa73055b04f584b17ffdc38224da356e616cc231f415415e345",
"tracking"=>
{"HTTP_USER_AGENT"=>"1c511875ee287e7aeb0b4415ff9ff14257b051d2",
"HTTP_ACCEPT_ENCODING"=>"ed2b3ca90a4e723402367a1d17c8b28392842398",
"HTTP_ACCEPT_LANGUAGE"=>"66eae971492938c2dcc2fb1ddc8d7ec3196037da"},
"session_id"=>
"71df15b3be4eb7db6a2b865f06b6bfbc97eda69f674bd05be2ca7b8d4038a110"},
"rack.request.query_string"=>"",
"rack.request.query_hash"=>{},
"sinatra.route"=>"POST /lti_tool"},
@params=
{"oauth_consumer_key"=>"test",
"oauth_signature_method"=>"HMAC-SHA1",
"oauth_timestamp"=>"1381515545",
"oauth_nonce"=>"b3luC52faPe7k6wTga0N894R0bqildh11w6GNpm6hg",
"oauth_version"=>"1.0",
"context_id"=>"creativity13",
"context_title"=>"Crash Course in Creativity",
"custom_message_from_sinatra"=>"hey from the sinatra example consumer",
"launch_presentation_return_url"=>"http://localhost:3000/tool_return",
"lis_outcome_service_url"=>"http://localhost:3000/grade_passback",
"lis_person_name_given"=>"kimball",
"lis_result_sourcedid"=>"oi",
"lti_message_type"=>"basic-lti-launch-request",
"lti_version"=>"LTI-1p0",
"resource_link_id"=>"thisisuniquetome",
"roles"=>"learner",
"tool_consumer_instance_name"=>"NovoEd",
"user_id"=>"6b743689ac31c9b583361670b7928630",
"oauth_signature"=>"6kQvehKsxqOVOZG5AvMtTfw1z08="}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment