<commit_before>#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import copy

from oslo_config import cfg

from oslo_policy._i18n import _

__all__ = [
    'list_opts',
    'set_defaults',
]

_option_group = 'oslo_policy'

_options = [
    cfg.BoolOpt('enforce_scope',
                default=False,
                help=_('This option controls whether or not to enforce scope '
                       'when evaluating policies. If ``True``, the scope of '
                       'the token used in the request is compared to the '
                       '``scope_types`` of the policy being enforced. If the '
                       'scopes do not match, an ``InvalidScope`` exception '
                       'will be raised. If ``False``, a message will be '
                       'logged informing operators that policies are being '
                       'invoked with mismatching scope.')),
    cfg.BoolOpt('enforce_new_defaults',
                default=False,
                help=_('This option controls whether or not to use old '
                       'deprecated defaults when evaluating policies. If '
                       '``True``, the old deprecated defaults are not going '
                       'to be evaluated. This means if any existing token is '
                       'allowed for old defaults but is disallowed for new '
                       'defaults, it will be disallowed. It is encouraged to '
                       'enable this flag along with the ``enforce_scope`` '
                       'flag so that you can get the benefits of new defaults '
                       'and ``scope_type`` together')),
    cfg.StrOpt('policy_file',
               default='policy.json',
               help=_('The relative or absolute path of a file that maps '
                      'roles to permissions for a given service. Relative '
                      'paths must be specified in relation to the '
                      'configuration file setting this option.'),
               deprecated_group='DEFAULT'),
    cfg.StrOpt('policy_default_rule',<commit_msg>Clarify enforce_new_defaults help text<commit_after>#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import copy

from oslo_config import cfg

from oslo_policy._i18n import _

__all__ = [
    'list_opts',
    'set_defaults',
]

_option_group = 'oslo_policy'

_options = [
    cfg.BoolOpt('enforce_scope',
                default=False,
                help=_('This option controls whether or not to enforce scope '
                       'when evaluating policies. If ``True``, the scope of '
                       'the token used in the request is compared to the '
                       '``scope_types`` of the policy being enforced. If the '
                       'scopes do not match, an ``InvalidScope`` exception '
                       'will be raised. If ``False``, a message will be '
                       'logged informing operators that policies are being '
                       'invoked with mismatching scope.')),
    cfg.BoolOpt('enforce_new_defaults',
                default=False,
                help=_('This option controls whether or not to use old '
                       'deprecated defaults when evaluating policies. If '
                       '``True``, the old deprecated defaults are not going '
                       'to be evaluated. This means if any existing token is '
                       'allowed for old defaults but is disallowed for new '
                       'defaults, it will be disallowed. It is encouraged to '
                       'enable this flag along with the ``enforce_scope`` '
                       'flag so that you can get the benefits of new defaults '
                       'and ``scope_type`` together. If ``False``, the '
                       'deprecated policy check string is logically OR\'d '
                       'with the new policy check string, allowing for a '
                       'graceful upgrade experience between releases with '
                       'new policies, which is the default behavior.')),
    cfg.StrOpt('policy_file',
               default='policy.json',
               help=_('The relative or absolute path of a file that maps '
                      'roles to permissions for a given service. Relative '
                      'paths must be specified in relation to the '
                      'configuration file setting this option.'),
               deprecated_group='DEFAULT'),
    cfg.StrOpt('policy_default_rule',
{'fraction_non_alphanumeric': 0.06988860941430111, 'fraction_numerical': 0.0021559468199784403, 'mean_word_length': 1.8475703324808184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '467898', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1266, 'n_words': 568}