Permalink
Switch branches/tags
Nothing to show
Commits on Apr 14, 2017
  1. Automatic lint ignore for khan-linter upgrade

    Summary:
    
    See D35059.  This change is the output of webapp's:
    `tools/add_lint_ignore_lines.py --todo_target colin ~/khan/khan-api`
    
    I removed the change lint ignore from the third_party code and added an
    @UnusedImport as well.
    
    Test Plan:
    `~/khan/devtools/khan-linter/runlint.py .`
    
    Auditors: csilvers
    cjfuller committed Apr 14, 2017
Commits on Jan 2, 2016
  1. Overhaul the README

    Add sections for how to get help with the API (some of which was moved from the
    "Khan Academy API Authentication" page) and how to contribute. Also rewrite
    basically everything else because it had gotten out of date.
    
    Auditors: benkraft
    Alan Pierce committed Jan 2, 2016
Commits on Oct 13, 2015
Commits on Aug 24, 2015
  1. Merge pull request #93 from hblumberg/test_client2_fix

    Ensure test_client2 handles URL queries.
    alangpierce committed Aug 24, 2015
  2. Ensure test_client2 handles URL queries.

    Addresses: #92
    
    Test Plan:
    Run test.py, ensure "/api/v1/user?email=[email address of authenticated user]" returns information about the authenticated user.
    Hannah Blumberg committed Aug 24, 2015
Commits on Jul 22, 2015
  1. Address bug reports in the new API client.

    Summary:
    1. Change response.json() to response.text so there's no crash on timeout.
    2. Remove "format=json" parameter since it fails with csilvers' new arg validation.
    
    Addresses: https://app.asana.com/0/27216215224639/42347977167518/f
    
    Test Plan:
    Ensure test.py completes the authentication process successfully.
    Ensure subsequent API calls are successful.
    
    Reviewers: alan
    
    Reviewed By: alan
    
    Subscribers: csilvers
    
    Differential Revision: https://phabricator.khanacademy.org/D19747
    hblumberg committed Jul 22, 2015
Commits on Jun 11, 2015
  1. Add updated samples of KA API clients.

    Summary:
    Add samples for new authentication steps (/api/auth2). The "examples" directory in https://github.com/Khan/khan-api currently has two outdated API clients, which use the old /api/auth API.
    
    Addresses: https://app.asana.com/0/35650367474073/35539396390394
    
    Test Plan:
    Ensure test.py completes the authentication process successfully.
    Ensure subsequent API calls are successful.
    
    Reviewers: alan
    
    Reviewed By: alan
    
    Differential Revision: https://phabricator.khanacademy.org/D18362
    hblumberg committed Jun 2, 2015
Commits on Jun 8, 2015
  1. Tell .arcconfig to use the .arclint file in the khan-api repo.

    Summary: Similar to change in webapp: https://phabricator.khanacademy.org/rGWA99268e3a1e7b5eeac6357d9d844457ffc1302226#387e7f10
    
    Test Plan: Ran 'arc lint' before and after this change, had it succeed after.
    
    Reviewers: csilvers
    
    Reviewed By: csilvers
    
    Subscribers: alan, marcos
    
    Differential Revision: https://phabricator.khanacademy.org/D18363
    hblumberg committed Jun 2, 2015
Commits on May 20, 2015
  1. Create .arclint

    summary: add `.arclint` file now that lint engines are deprecated in global .arcconfig files.
    
    auditors: alan
    nsfmc committed May 20, 2015
Commits on Mar 30, 2015
  1. Fix OAuth signing with repeated parameters in the sample client

    I just deployed a fix to the server signing implementation, so the sample client
    needs to be fixed as well.
    
    Test Plan:
    Log in with the test client.
    Run this request:
    /api/v1/user/exercises?username=alangpierce&exercises=addition_1&exercises=multiplication_1&format=pretty
    The request succeeds, and the response contains two elements.
    
    Auditors: benkomalo
    Alan Pierce committed Mar 30, 2015
Commits on Mar 27, 2015
  1. Merge pull request #86 from jb-1980/master

    Allow multiple values per parameter
    alangpierce committed Mar 27, 2015
Commits on Mar 4, 2015
Commits on Feb 4, 2015
  1. Add a sample PHP client

    This uses the oauth-php library to go through a browser-based authentication
    flow. I also included the oauth-php library directly as a dependency.
    
    Test Plan:
    Visit localhost:8001/ka_client.php, click the login button, log in, it redirects
    to a page with a form for making a GET request. Run the default request and
    gives back my user data.
    
    Auditors: marcos
    Alan Pierce committed Feb 4, 2015
Commits on Aug 13, 2014
  1. Make the test client show the response body for HTTP errors

    Summary:
    Previously, only the title of an error response (e.g. "Unauthorized" for 401)
    was displayed when there was an HTTP error. I'm introducing a new error and I
    want the message to be more visible, so this at least makes it visible in the
    example client.
    
    Test Plan:
    Register a consumer in dev_appserver.
    Run /api/v1/user/students. It fails with 401 because the consumer isn't
    anointed, and the response message is displayed in the client (previously, it
    just said "Unauthorized").
    
    Reviewers: alpert
    
    Reviewed By: alpert
    
    Subscribers: ben
    
    Differential Revision: http://phabricator.khanacademy.org/D12243
    Alan Pierce committed Aug 13, 2014
Commits on Aug 23, 2013
  1. Update lint_blacklist to include node_modules. Remove js_version.py f…

    …rom source control
    
    Summary: Cosmetic fix, but it was bothering me a lot
    
    Test Plan:
    js_version.py is ignored and node_modules is not linted
    on commit
    
    Reviewers: csilvers, alpert
    
    Reviewed By: alpert
    
    Differential Revision: http://phabricator.khanacademy.org/D3712
    robert3005 committed Aug 23, 2013
  2. Fix for google app engine truncating too long headers

    Summary:
    This is an ugly hack which is necessary due to google app engine design. It is not stated anywhere directly but google app engine trims headers which are more than 498 bytes long (this number might be wrong). I have managed to dig out an old issue that mentions this but it is nowhere in official documentation. Anyway this is consistent with the behaviour I have observed where X-Original-Headers gets removed from the response. If you have any other suggestions how this might be avoided I will be more than happy to implement them. Also if you want to file a bug report with google then you're more than welcome.
    
    Remove function included for testing
    
    Test Plan:
    headers are present in the api response.
    
    <see below>
    
    Reviewers: alpert, csilvers
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3098
    robert3005 committed Aug 23, 2013
Commits on Jul 19, 2013
  1. Merge pull request #55 from bcipolli/fix_test_example

    updating changed 3rd party package refs
    robert3005 committed Jul 19, 2013
  2. updating changed 3rd party package refs

    Ben Cipollini committed Jul 19, 2013
Commits on Jul 17, 2013
  1. Minification process for javascript

    Summary: Add minification build. Only minified file gets uploaded to production. We cannot load jquery from CDN on shim based config. It's a limitation of require.js. This way we only get minified file and require.js on the server. I think I have not messed up deployment and everything works.
    
    Test Plan: deploy and see if it works (don't change default!)
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    Differential Revision: http://phabricator.khanacademy.org/D3076
    robert3005 committed Jul 17, 2013
Commits on Jul 16, 2013
  1. External libraries for new explorer

    Summary: Because those had to go somewhere
    
    Reviewers: csilvers, alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3018
    robert3005 committed Jul 16, 2013
  2. Config bits for appengine, require.js, requirements, etc.

    Summary: Configuration files that bring everything together. I decide to use require.js to avoid lots of frustration from javascript poor dependency management. What is more it also allows asynchronous loading of dependencies in contrast to how browser would have done it. It's easy to replace it if necessary.
    
    Reviewers: csilvers, alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3016
    robert3005 committed Jul 16, 2013
  3. React view to draw api call form

    Summary: Draws api call form and handles submission and validation.
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3014
    robert3005 committed Jul 16, 2013
  4. React view for a given endpoint

    Summary: React view to represent one endpoint. Handles expanding.
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3013
    robert3005 committed Jul 16, 2013
  5. Top documentation react view

    Summary: Main documentation view and Loader that precedes it while loading
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3012
    robert3005 committed Jul 16, 2013
  6. Root react views

    Summary: Most top level react views that put everything together. There is also nice link hijacking handler that allows us to have normal links (without hash)
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3011
    robert3005 committed Jul 16, 2013
  7. Router for api explorer - imitates anchor links without custom ids on…

    … elements
    
    Summary: Router that handles link clicks. Due to the fact that React hijacks ids this is a bit of a hack.
    
    Test Plan: check that clicking on menu links actually moves you to a different place on a page
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3010
    robert3005 committed Jul 16, 2013
Commits on Jul 15, 2013
  1. utility functions that don't belong to any particular class

    Summary: Simple utility functions that are used by many views and don't belong to any particular model
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3009
    robert3005 committed Jul 15, 2013
  2. Models and Backbone Helper of API Explorer

    Summary: Rather simple backbone models with backbone mixin for react (taken from react examples).
    
    Test Plan: Creating PublicApi collection and populating it creates a Backbone representation of our api
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3008
    robert3005 committed Jul 15, 2013
  3. Template and CSS styles for API Explorer

    Summary: templates and css styles for api explorer. Most of the client side code is generated by javascript. Stylus is a superset of CSS so any valid css can be used in the stylesheet. I can replace it with raw css if that's desired, but the syntax is so much nicer.
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3007
    robert3005 committed Jul 15, 2013
  4. Refactored backend code to work with requests and google app engine

    Summary: Most of the program structure has been preserved. Mostly cases for handling different that GET requests have been added. Using requests makes code a lot less awkward.
    
    Reviewers: csilvers, alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3006
    robert3005 committed Jul 15, 2013
  5. grunt based build system

    Summary: First in the series of reviews of my new api explorer. Rest is coming up shortly. I have create task T1210 to keep reviews together. The first one introduces grunt based build system with npm packages to make it possible. npm install && grunt (having grunt-cli installed beforehand) should build the project and launch devappserver on 0.0.0.0:8080.
    
    Test Plan:
    grunt still produces expected result
    
    running "grunt deploy" builds and deploys the app
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3005
    robert3005 committed Jul 15, 2013
Commits on Apr 8, 2013
  1. Specify Python test client version in README

    Closes #49.
    
    Auditors: ben
    spicyj committed Apr 8, 2013
Commits on Dec 9, 2012
  1. Correctly escape displayed json values and put response in window.API…

    …_RESPONSE
    
    Summary: add window.API_RESPONSE variable which contains the preformated api response and some helpful tips on the homepage about it. The original rationale behind escaping the displayed json was that it's probably not so unfathomable that a person using the explorer would try to parse the #response_body variable, but it's actually not encoded correctly. In any way, to discourage that (and to encourage actually poking of the api) i'm exposing the response json in a variable which gets set after each call is made.
    
    Test Plan:
    $.parseJSON($("#response_body").text()) works.
    additionally, and more usefully, window.API_RESPONSE is available for perusing rather than mucking with #response_body.
    
    Reviewers: kamens
    
    Reviewed By: kamens
    
    Differential Revision: http://phabricator.khanacademy.org/D975
    nsfmc committed Dec 9, 2012