#7029 AuthProvider should be able to add routes to /auth/

v1.2.0
closed
nobody
42cc (432)
General
Cory Johns
2015-08-20
2014-01-06
No

Some auth providers may want to add additional user configuration pages under /auth/. The AuthenticationProvider class already allows a lot of configuration, but can't add new url handling. We should extend it to have a new method which may return references to methods and/or controllers to add. Then AuthController.__init__ can just loop through those and use setattr() to add them to itself. Default implementation should return [] (so existing providers work fine) and have a docstring.

Discussion

  • Dave Brondsema

    Dave Brondsema - 2014-01-08

    UserPreferencesProvider might be slightly better than AuthenticatonProvider since this is more about additional preferences.

     
  • Igor Bondarenko - 2014-02-25

    Closed #521. je/42cc_7029

    For QA: you can add something like the following to LocalUserPreferencesProvider:

    @expose()
    def add(self):
        return 'Hello!'
    
    def additional_urls(self):
        return [('add', self.add), ]
    

    Then go to /auth/add and you should see 'Hello!' there.

     
  • Igor Bondarenko - 2014-02-25
    • status: in-progress --> code-review
     
  • Cory Johns - 2014-02-27
    • QA: Cory Johns
     
  • Cory Johns - 2014-02-27
    • status: code-review --> closed
    • Milestone: forge-backlog --> forge-mar-7
     
  • Dave Brondsema

    Dave Brondsema - 2015-01-05
    • Milestone: unreleased --> asf_release_1.2.0
     

Log in to post a comment.