| OLD | NEW |
| 1 #!/usr/bin/env python | 1 # -*- coding: utf-8 -*- |
| 2 # | 2 # Copyright 2011 Google Inc. All Rights Reserved. |
| 3 # Copyright 2010 Google Inc. | |
| 4 # | 3 # |
| 5 # Licensed under the Apache License, Version 2.0 (the "License"); | 4 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 # you may not use this file except in compliance with the License. | 5 # you may not use this file except in compliance with the License. |
| 7 # You may obtain a copy of the License at | 6 # You may obtain a copy of the License at |
| 8 # | 7 # |
| 9 # http://www.apache.org/licenses/LICENSE-2.0 | 8 # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 # | 9 # |
| 11 # Unless required by applicable law or agreed to in writing, software | 10 # Unless required by applicable law or agreed to in writing, software |
| 12 # distributed under the License is distributed on an "AS IS" BASIS, | 11 # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 # See the License for the specific language governing permissions and | 13 # See the License for the specific language governing permissions and |
| 15 # limitations under the License. | 14 # limitations under the License. |
| 15 """No-op authorization plugin allowing boto anonymous access. |
| 16 | 16 |
| 17 """Web request dispatcher for the Google App Engine Pipeline API. | 17 This allows users to use gsutil for accessing publicly readable buckets and |
| 18 | 18 objects without first signing up for an account. |
| 19 In a separate file from the core pipeline module to break circular dependencies. | |
| 20 """ | 19 """ |
| 21 | 20 |
| 22 from google.appengine.ext import webapp | 21 from __future__ import absolute_import |
| 23 from google.appengine.ext.webapp import util as webapp_util | |
| 24 | 22 |
| 25 import pipeline | 23 from boto.auth_handler import AuthHandler |
| 26 | 24 |
| 27 | 25 |
| 28 _APP = webapp.WSGIApplication(pipeline.create_handlers_map(), debug=True) | 26 class NoOpAuth(AuthHandler): |
| 27 """No-op authorization plugin class.""" |
| 29 | 28 |
| 29 capability = ['s3'] |
| 30 | 30 |
| 31 def _main(): | 31 def __init__(self, path, config, provider): |
| 32 webapp_util.run_wsgi_app(_APP) | 32 pass |
| 33 | 33 |
| 34 | 34 def add_auth(self, http_request): |
| 35 if __name__ == '__main__': | 35 pass |
| 36 _main() | |
| OLD | NEW |