FAQ | This is a LIVE service | Changelog

Skip to content
  1. Jan 21, 2020
  2. Nov 06, 2019
    • Robin Goodall's avatar
      Merge branch 'issue-91-google-oauth2' into 'master' · 3c38899c
      Robin Goodall authored
      Replace authentication with Google OAuth2 and remove cruft
      
      Closes #91 and #88
      
      See merge request uis/devops/iar/backend!87
      3c38899c
    • Dr Rich Wareham's avatar
      remove unused hydra and lookupproxy services · 4c55c091
      Dr Rich Wareham authored
      We no-longer use hydra or lookupproxy so we can remove them from the
      docker-compose configuration along with the related support files.
      4c55c091
    • Dr Rich Wareham's avatar
      remove custom swagger templates · c5413c72
      Dr Rich Wareham authored
      We had a number of customisations to the DRF YASG shipped swagger which
      we no-longer need as the later versions of Swagger UI shipped with DRF
      cover our needs adequately.
      c5413c72
    • Dr Rich Wareham's avatar
      remove sphinx documentation · dbe27c83
      Dr Rich Wareham authored
      The entire sphinx documentation was hilariously out of date with respect
      to our current practices. Rather than hacking it, remove it with an eye
      to replacing it with a better README and markdown formatted
      documentation.
      dbe27c83
    • Dr Rich Wareham's avatar
      remove django-ucamwebauth · 9ea3e6f1
      Dr Rich Wareham authored
      By including django social auth we no-longer need the use the legacy
      ucamwebauth protocol.
      9ea3e6f1
    • Dr Rich Wareham's avatar
      add ability to authenticate via Google OAuth2 · bb37d4c2
      Dr Rich Wareham authored
      Add the ability to authenticate to the application via Google OAuth2
      (aka GSuite@Cambridge) by making use of the Django social auth library.
      We enable the option to associate users by email address since we have a
      large number of existing users in the application and an earlier
      migration has ensured they should have the correct email address
      associated with the account.
      
      In order to allow use of Google OAuth2 tokens with the API, we implement
      an "exchange" endpoint which can convert an access token from one of the
      Django social auth backends into an API token which can be passed to the
      API in the Authorization header. This is based on a pattern from the
      Django social auth docs [1].
      
      The Swagger UI is updated to pre-populate the Google client id and
      correct scopes so that the token exchange can be performed in the
      Swagger UI.
      
      [1] https://python-social-auth.readthedocs.io/en/latest/use_cases.html#signup-by-oauth-access-token
      bb37d4c2
    • Dr Rich Wareham's avatar
      remove use of hydra OAuth2 and hence lookupproxy · 70150cd6
      Dr Rich Wareham authored
      Instead of using OAuth2 to authenticate the API, use DRF's token-based
      authentication. This removes one place where we rely on hydra's Oauth2
      implementation.
      
      The other place is the use of lookupproxy. Remove the dependence on
      lookupproxy and replace it with the use of the djang-ucamlookup
      wrappers in assets.lookup.
      
      This rendered a large number of formerly required settings useless so
      remove them.
      
      Update the tests to make use of token authentication instead of faking
      OAuth authentication and to mock the lookup wrapper functions.
      70150cd6
    • Dr Rich Wareham's avatar
      assets: remove unnecessary "name" arguments from filter · 59868302
      Dr Rich Wareham authored
      The filter defined for assets duplicated the "name" arguments. Modern
      versions of django-filters infer this from the name of the field in
      the class so the 2name" argument is unnecessary.
      59868302
    • Dr Rich Wareham's avatar
      assets: mark the stats endpoint as unauthenticated · 357ce41e
      Dr Rich Wareham authored
      The stats endpoint does not require authentication but this is not
      reflected in the generated Swagger. Annotate it appropriately.
      357ce41e
    • Dr Rich Wareham's avatar
      assets: add lookup utility functions · 354e7051
      Dr Rich Wareham authored
      We will be removing lookupproxy so we want to make use of the Lookup
      client functionality provided by django-ucamlookup. This package assumes
      that usernames are crsids which is not the case in this application.
      Indeed it will continue not to be the case since we'll be moving to
      Django social auth which does not guarantee any particular form for the
      username.
      
      Instead, use the email address as the primary key for user identity. We
      can write a migration to migrate the existing "crisd+{crsid}" named
      users to have the right email address and Django social auth *will* set
      the email address properly for GSuite@Cambridge users.
      
      Users with email addresses of the form {crsid}@cam.ac.uk can have
      information returned from Lookup by parsing out the crsid. Add some
      utility functions which do so.
      
      We add a secrets.env template to the configuration so that a lookup
      group's credentials may be used ot use the lookup API from outside the
      CUDN.
      354e7051
    • Dr Rich Wareham's avatar
      assets: ensure email address for existing users · b2ec2a88
      Dr Rich Wareham authored
      We are going to move to a world where email address is the primary key
      for a user. To this end, make sure that the existing "crsid+{crsid}"
      users have their emails set correctly.
      
      Django social auth will happily associate the Google sign in with these
      users if the email addresses match and we enable it in the social
      pipeline.
      b2ec2a88
    • Dr Rich Wareham's avatar
      update README · 44264799
      Dr Rich Wareham authored
      The existing README linked to out-of-date test and code coverage and
      documentation which was no-longer being built.
      
      Remove most of the README and replace its contents. Note that this
      README is "forward-looking". It describes functionality which is added
      in later commits but it didn't seem worth writing a README for old-world
      and then immediately re-writing it.
      44264799
  3. May 08, 2018
  4. May 04, 2018
    • Dr Rich Wareham's avatar
      re-arrange asset stats endpoint · abc01933
      Dr Rich Wareham authored
      Rather than having the stats endpoint split each count out separately by
      institution, gather them together as proposed in #84. Take the
      opportunity to make the serializer a little more sophisticated so that
      the asset count model is re-used between the "all" field and the
      "by_institution" field.
      
      Closes #84.
      abc01933
    • Dr Rich Wareham's avatar
      make stats endpoint not count deleted assets · e9081e65
      Dr Rich Wareham authored
      As noted in #85, the stats endpoint was incorrectly counting deleted
      assets. Update the view to ignore deleted assets.
      
      Closes #85.
      e9081e65
    • Dr Rich Wareham's avatar
      test_views: re-factor stats test · a64b5003
      Dr Rich Wareham authored
      Make the stats test a little more orthogonal by directly creating the
      Asset models rather than bouncing through the API.
      a64b5003
  5. May 01, 2018
  6. Apr 30, 2018
  7. Apr 27, 2018
  8. Apr 26, 2018
  9. Apr 24, 2018
  10. Apr 23, 2018
  11. Apr 19, 2018