Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save kbighorse/6939929 to your computer and use it in GitHub Desktop.
Bad tool_provider and request.
BAD:
=> #<IMS::LTI::ToolProvider:0x007ff1923a0058
@consumer_key="test",
@consumer_secret="secret",
@context_id="1",
@context_label="venture",
@context_title="Technology Entrepreneurship",
@custom_params=
{"complex____________key"=>"Complex!@\#$^*(){}[]\u00BDValue",
"simple_key"=>"custom_simple_value"},
@ext_params={},
@launch_presentation_locale="en-US",
@launch_presentation_return_url="http://localhost:3000/venture",
@lis_outcome_service_url=
"http://localhost:3000/venture/question_set_submissions/99/grade_passback",
@lis_result_sourcedid="109",
@lti_message_type="basic-lti-launch-request",
@lti_version="LTI-1p0",
@non_spec_params={},
@oauth_callback="about:blank",
@oauth_consumer_key="test",
@oauth_nonce="0EIf9hUakhZiqT7LIiToEAhuzTsswRKvi0EemBcZUA",
@oauth_signature="wIA3McL4nb+FapsliGrnkCG2z+M=",
@oauth_signature_method="HMAC-SHA1",
@oauth_timestamp="1381516670",
@oauth_version="1.0",
@outcome_requests=[],
@resource_link_id="99",
@role_scope_mentor="f5b2cc6c-8c5c-24e8-75cc-fac504df920f",
@roles=["instructor", "urn:lti:role:ims/lis/mentor"],
@tool_consumer_info_product_family_code="NovoEd",
@tool_consumer_info_version="0.0.1",
@tool_consumer_instance_name="NovoEd Collaborative Learning Platform",
@user_id="109">
=> #<Sinatra::Request:0x007ff19228c3b0
@env=
{"CONTENT_LENGTH"=>"1028",
"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/venture/question_sets/99",
"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:0x007ff192359ec8
@input=#<StringIO:0x007ff192898f88>>,
"rack.errors"=>
#<Rack::Lint::ErrorWrapper:0x007ff192359e28 @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:0x007ff192359ec8
@input=#<StringIO:0x007ff192898f88>>,
"rack.request.form_hash"=>
{"oauth_consumer_key"=>"test",
"oauth_signature_method"=>"HMAC-SHA1",
"oauth_timestamp"=>"1381516670",
"oauth_nonce"=>"0EIf9hUakhZiqT7LIiToEAhuzTsswRKvi0EemBcZUA",
"oauth_version"=>"1.0",
"context_id"=>"1",
"context_label"=>"venture",
"context_title"=>"Technology Entrepreneurship",
"custom_complex____________key"=>"Complex!@\#$^*(){}[]\u00BDValue",
"custom_simple_key"=>"custom_simple_value",
"launch_presentation_locale"=>"en-US",
"launch_presentation_return_url"=>"http://localhost:3000/venture",
"lis_outcome_service_url"=>
"http://localhost:3000/venture/question_set_submissions/99/grade_passback",
"lis_result_sourcedid"=>"109",
"lti_message_type"=>"basic-lti-launch-request",
"lti_version"=>"LTI-1p0",
"oauth_callback"=>"about:blank",
"resource_link_id"=>"99",
"role_scope_mentor"=>"f5b2cc6c-8c5c-24e8-75cc-fac504df920f",
"roles"=>"Instructor,urn:lti:role:ims/lis/Mentor",
"tool_consumer_info_product_family_code"=>"NovoEd",
"tool_consumer_info_version"=>"0.0.1",
"tool_consumer_instance_name"=>"NovoEd Collaborative Learning Platform",
"user_id"=>"109",
"oauth_signature"=>"wIA3McL4nb+FapsliGrnkCG2z+M="},
"rack.request.form_vars"=>
"oauth_consumer_key=test&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1381516670&oauth_nonce=0EIf9hUakhZiqT7LIiToEAhuzTsswRKvi0EemBcZUA&oauth_version=
"rack.logger"=>
#<Logger:0x007ff1921dff70
@default_formatter=
#<Logger::Formatter:0x007ff1921dff48 @datetime_format=nil>,
@formatter=nil,
@level=1,
@logdev=
#<Logger::LogDevice:0x007ff1921dfe58
@dev=#<Rack::Lint::ErrorWrapper:0x007ff192359e28 @error=#<IO:<STDERR>>>,
@filename=nil,
@mutex=
#<Logger::LogDevice::LogDeviceMutex:0x007ff1921dfe30
@mon_count=0,
@mon_mutex=#<Mutex:0x007ff1921dfd40>,
@mon_owner=nil>,
@shift_age=nil,
@shift_size=nil>,
@progname=nil>,
"rack.session"=>
{"csrf"=>"41f7c17e956b18dec03c98fde7f937fbd70d3002894f5f51322ee55f2b4449fd", "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:0x007ff19290c780>},
"rack.request.cookie_hash"=>
{"request_method"=>"GET",
"_scaffold_session"=>
"cm5xRWhFL0lRa1FaaXdDazVYbTN0MGhjQ1IwQ0h2d1A3emh3UWdYODlZOHp5aHc3V003MHdGU0x6T2lpWWZBaGp0azREU3FSaVFaTWx1Q252Y1lNZjJwSkRWb2hwM1E2R2Z6U0srMDErTjk0VitEM2l
"PHPSESSID"=>"dd04306323ef3a25f294f12da620ab4b",
"rack.session"=>
"BAh7CUkiCWNzcmYGOgZFRiJFZjJmMjY2NzRlY2QxNzNiYzViYjIyYTM5YzBl\nOGM3NDkyZDBmOTI2M2NiYTVkYmFjZjAxYjg5YmVkZDYyNjBhZUkiDXRyYWNr\naW5nBjsARnsISSIUSFRUUF9VU0V
"remember_user_token"=>
"BAhbB1sGaXJJIhltR2U1bTNMcFY4b2RqWjVhTWlEbgY6BkVG--557a3d24097abd595d8c5ed1bfabb5b99af591e7",
"_entrepreneurship_session"=>
"BAh7CEkiEF9jc3JmX3Rva2VuBjoGRUZJIjFTdkU0QzFXQVA1dFQ0ZHFETTJlandqeDNHbEtMeHMxbzE2RTdGWHhWUFMwPQY7AEZJIg9zZXNzaW9uX2lkBjsARkkiJTQ1MDc1NWJhYTkzYjBhOWRiOWV
"rack.request.cookie_string"=>
"request_method=GET; _scaffold_session=cm5xRWhFL0lRa1FaaXdDazVYbTN0MGhjQ1IwQ0h2d1A3emh3UWdYODlZOHp5aHc3V003MHdGU0x6T2lpWWZBaGp0azREU3FSaVFaTWx1Q252Y1lNZjJ
"rack.session.unpacked_cookie_data"=>
{"csrf"=>
"f2f26674ecd173bc5bb22a39c0e8c7492d0f9263cba5dbacf01b89bedd6260ae",
"tracking"=>
{"HTTP_USER_AGENT"=>"1c511875ee287e7aeb0b4415ff9ff14257b051d2",
"HTTP_ACCEPT_ENCODING"=>"ed2b3ca90a4e723402367a1d17c8b28392842398",
"HTTP_ACCEPT_LANGUAGE"=>"66eae971492938c2dcc2fb1ddc8d7ec3196037da"},
"launch_params"=>
{"context_id"=>"creativity13",
"context_title"=>"Crash Course in Creativity",
"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",
"oauth_consumer_key"=>"test",
"oauth_nonce"=>"b3luC52faPe7k6wTga0N894R0bqildh11w6GNpm6hg",
"oauth_signature"=>"6kQvehKsxqOVOZG5AvMtTfw1z08=",
"oauth_signature_method"=>"HMAC-SHA1",
"oauth_timestamp"=>"1381515545",
"oauth_version"=>"1.0",
"resource_link_id"=>"thisisuniquetome",
"roles"=>"learner",
"tool_consumer_instance_name"=>"NovoEd",
"user_id"=>"6b743689ac31c9b583361670b7928630",
"custom_message_from_sinatra"=>"hey from the sinatra example consumer"},
"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"=>"1381516670",
"oauth_nonce"=>"0EIf9hUakhZiqT7LIiToEAhuzTsswRKvi0EemBcZUA",
"oauth_version"=>"1.0",
"context_id"=>"1",
"context_label"=>"venture",
"context_title"=>"Technology Entrepreneurship",
"custom_complex____________key"=>"Complex!@\#$^*(){}[]\u00BDValue",
"custom_simple_key"=>"custom_simple_value",
"launch_presentation_locale"=>"en-US",
"launch_presentation_return_url"=>"http://localhost:3000/venture",
"lis_outcome_service_url"=>
"http://localhost:3000/venture/question_set_submissions/99/grade_passback",
"lis_result_sourcedid"=>"109",
"lti_message_type"=>"basic-lti-launch-request",
"lti_version"=>"LTI-1p0",
"oauth_callback"=>"about:blank",
"resource_link_id"=>"99",
"role_scope_mentor"=>"f5b2cc6c-8c5c-24e8-75cc-fac504df920f",
"roles"=>"Instructor,urn:lti:role:ims/lis/Mentor",
"tool_consumer_info_product_family_code"=>"NovoEd",
"tool_consumer_info_version"=>"0.0.1",
"tool_consumer_instance_name"=>"NovoEd Collaborative Learning Platform",
"user_id"=>"109",
"oauth_signature"=>"wIA3McL4nb+FapsliGrnkCG2z+M="}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment