1# -*- coding: utf-8 -*-
2# Copyright 2012 Google Inc. All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15"""Additional help text for anonymous access."""
16
17from __future__ import absolute_import
18
19from gslib.help_provider import HelpProvider
20
21_DETAILED_HELP_TEXT = ("""
22<B>OVERVIEW</B>
23  gsutil users can access publicly readable data without obtaining
24  credentials. For example, the gs://uspto-pair bucket contains a number
25  of publicly readable objects, so any user can run the following command
26  without first obtaining credentials:
27
28    gsutil ls gs://uspto-pair/applications/0800401*
29
30  Users can similarly download objects they find via the above gsutil ls
31  command.
32
33  If a user without credentials attempts to access protected data using gsutil,
34  they will be prompted to run "gsutil config" to obtain credentials.
35
36  See "gsutil help acls" for more details about data protection.
37""")
38
39
40class CommandOptions(HelpProvider):
41  """Additional help text for anonymous access."""
42
43  # Help specification. See help_provider.py for documentation.
44  help_spec = HelpProvider.HelpSpec(
45      help_name='anon',
46      help_name_aliases=['anonymous', 'public'],
47      help_type='additional_help',
48      help_one_line_summary='Accessing Public Data Without Credentials',
49      help_text=_DETAILED_HELP_TEXT,
50      subcommand_help_text={},
51  )
52