Show More
@@ -762,6 +762,16 b' def allowed_auth_token_access(view_name,' | |||||
762 | from rhodecode import CONFIG |
|
762 | from rhodecode import CONFIG | |
763 | whitelist = aslist( |
|
763 | whitelist = aslist( | |
764 | CONFIG.get('api_access_controllers_whitelist'), sep=',') |
|
764 | CONFIG.get('api_access_controllers_whitelist'), sep=',') | |
|
765 | # backward compat translation | |||
|
766 | compat = { | |||
|
767 | # old controller, new VIEW | |||
|
768 | 'ChangesetController:*': 'RepoCommitsView:*', | |||
|
769 | 'ChangesetController:changeset_patch': 'RepoCommitsView:repo_commit_patch', | |||
|
770 | 'ChangesetController:changeset_raw': 'RepoCommitsView:repo_commit_raw', | |||
|
771 | 'FilesController:raw': 'RepoCommitsView:repo_commit_raw', | |||
|
772 | 'FilesController:archivefile': 'RepoFilesView:repo_archivefile', | |||
|
773 | 'GistsController:*': 'GistView:*', | |||
|
774 | } | |||
765 |
|
775 | |||
766 | log.debug( |
|
776 | log.debug( | |
767 | 'Allowed views for AUTH TOKEN access: %s' % (whitelist,)) |
|
777 | 'Allowed views for AUTH TOKEN access: %s' % (whitelist,)) | |
@@ -769,6 +779,10 b' def allowed_auth_token_access(view_name,' | |||||
769 |
|
779 | |||
770 | for entry in whitelist: |
|
780 | for entry in whitelist: | |
771 | token_match = True |
|
781 | token_match = True | |
|
782 | if entry in compat: | |||
|
783 | # translate from old Controllers to Pyramid Views | |||
|
784 | entry = compat[entry] | |||
|
785 | ||||
772 | if '@' in entry: |
|
786 | if '@' in entry: | |
773 | # specific AuthToken |
|
787 | # specific AuthToken | |
774 | entry, allowed_token = entry.split('@', 1) |
|
788 | entry, allowed_token = entry.split('@', 1) |
General Comments 0
You need to be logged in to leave comments.
Login now