Closed Bug 757940 Opened 12 years ago Closed 12 years ago

Ensure MindTouch auth and all other use of API can be switched off

Categories

(developer.mozilla.org Graveyard :: Wiki pages, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lorchard, Assigned: lorchard)

References

Details

(Whiteboard: u=admin c=wiki s=2012-06-05 p=2 t=2012-06-19)

We use the MindTouch API for auth integration, and I think page existence detection. Need to make sure we have a switch (ie. waffle and/or detect when DEKIWIKI_ENDPOINT is empty or False) that turns off *all* MindTouch integration points and allows Kuma to run standalone
Blocks: 756263
Whiteboard: u=admin c=wiki s=2012-06-05 p=2
Assignee: nobody → lorchard
Note to self: https://github.com/mozilla/kuma/blob/master/apps/docs/cron.py#L44

Another spot where the MindTouch API is used. Find more, try to fix but maybe file follow up bug to reimplement MindTouch-reliant parts like this with Kuma equivalents
More notes-to-self:

-> % find . -type f -name '*py' -print0 | xargs -n96 -0 grep -Hni '@api' | tee api-grep.txt
./apps/dekicompat/backends.py:50:    profile_url = "%s/@api/deki/users/current" % settings.DEKIWIKI_ENDPOINT
./apps/dekicompat/backends.py:51:    profile_by_id_url = ("%s/@api/deki/users/%s" %
./apps/dekicompat/backends.py:53:    users_by_email = ("%s/@api/deki/users?%s" %
./apps/dekicompat/backends.py:201:        auth_url = "%s/@api/deki/users/authenticate" % (
./apps/dekicompat/backends.py:204:            auth_url = "%s/@api/deki/users/authenticate?apikey=%s" % (
./apps/dekicompat/backends.py:242:        user_url = '%s/@api/deki/users?apikey=%s' % (
./apps/dekicompat/backends.py:268:        user_url = '%s/@api/deki/users/%s?apikey=%s' % (
./apps/dekicompat/backends.py:315:            conn.request("PUT", '/@api/deki/users/%s' % self.id, body, {
./apps/dekicompat/tests.py:151:    auth_url = "%s/@api/deki/users/authenticate" % stage_endpoint
./apps/devmo/helpers.py:122:        conn.request("GET", '/@api/deki/pages/=%s' %
./apps/devmo/models.py:254:        return u'%s/@api/deki/users/=%s/feed?format=raw' % (
./apps/devmo/models.py:298:    eg. https://developer.mozilla.org/@api/deki/users/=Sheppy/feed?format=raw
./apps/devmo/tests/test_misc.py:67:            ("Disallow", "/@api/deki/*"),
./apps/devmo/tests/test_models.py:135:        ok_(url.endswith('/@api/deki/users/=%s/feed?format=raw' % username))
./apps/devmo/tests/test_views.py:401:            passwd_url = '%s/@api/deki/users/%s/password?apikey=%s' % (
./apps/docs/cron.py:25:            'https://developer.mozilla.org/@api/deki/pages/popular'))
./apps/docs/cron.py:45:                'https://developer.mozilla.org/@api/deki/pages/'
./apps/docs/cron.py:57:                'https://developer.mozilla.org/@api/deki/pages/'
./apps/users/tests/test_templates.py:244:            passwd_url = '%s/@api/deki/users/%s/password?apikey=%s' % (
./apps/users/tests/test_views.py:130:            passwd_url = '%s/@api/deki/users/%s/password?apikey=%s' % (
No longer blocks: 756263
Progress: https://github.com/mozilla/kuma/pull/238

I *think* I found all the MindTouch integration points, but I'm not sure. I grepped back and forth over the code for instances of "@api" and "deki" and "mindtouch" and tried to disable each case I found. I wouldn't rule out my having missed something, though.
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/bb22d40a28832641683974d43039e11931d640d3
fix bug 757940: Ensure MindTouch API use can be switched off

* Set DEKIWIKI_ENDPOINT to False by default in settings.py

* When DEKIWIKI_ENDPOINT is false:

    * All calls to dekicompat.backends.authenticate() return False (ie.
      MindTouch logins are refused)

    * Successful logins via BrowserID skip MindTouch login
      and setting of the `authtoken` cookie

    * Disable MindTouch API in devmo_url() helper

    * Disable Doc of the Day on docs landing page when MindTouch
      popularity data is unavailable

    * Disable most-active docs sidebar when MindTouch feed is
      unavailable

    * Ensure MindTouch feed for user activity is never fetched when
      unavailable

    * Disable POST to update MindTouch user on UserProfile.save()

    * Disable MindTouch username check in registration forms

https://github.com/mozilla/kuma/commit/1ff96d880d06ca45b52789df5c96b38880b5bd5d
bug 757940: Disable MT API user existence check during browserid_verify

https://github.com/mozilla/kuma/commit/233f039fcc933b62fef5b56d096ccb6a3b66e052
bug 757940: Ensure change to settings.DEKIWIKI_ENDPOINT happens directly before and after HTTP request

https://github.com/mozilla/kuma/commit/93518825b5e6a36bec0bee7e67bd34a626487350
bug 757940: Skip some tests that rely on MindTouch API, when disabled

https://github.com/mozilla/kuma/commit/169234e00366e270d0c7633d86d60c92322420ab
bug 757940: Don't POST to update MT user on registration when API unavailable

https://github.com/mozilla/kuma/commit/5935f8ead2bc9ee5463fed775235f5d7ea5109b4
Merge pull request #238 from lmorchard/mindtouch-switch-off-757940

fix bug 757940: Ensure MindTouch API use can be switched off
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Commit pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/f2ff538abe9f732b4cb7f6283ccbc1b8ce5aa36f
bug 757940: Bugfixes for passwd reset form & tests

* Profile edit should not save to MindTouch when the API is disabled.

* Password reset form should not consult MT API for existence of a user
  when the API is disabled.

* Skip more UserDocsActivityFeed tests when the MT API is gone.
Whiteboard: u=admin c=wiki s=2012-06-05 p=2 → u=admin c=wiki s=2012-06-05 p=2 t=2012-06-19
Version: Kuma → unspecified
Component: Website → Landing pages
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.