Edgewall Software
Modify

Opened 11 years ago

Closed 10 years ago

#11529 closed enhancement (fixed)

[authz_policy] authz_file should be defined using PathOption

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.4
Component: general Version: 1.0-stable
Severity: normal Keywords: authzpolicy
Cc: Branch:
Release Notes:

Relative paths for the [authz_policy] authz_file option are resolved relative to the Environment's conf directory, rather than relative to the Environment directory.

API Changes:
Internal Changes:

Description

The example in the documentation for AuthzPolicy shows:

[authz_policy]
authz_file = conf/authzpolicy.conf

and authz_file is defined:

authz_file = Option('authz_policy', 'authz_file', '',
                    'Location of authz policy configuration file.')

A relative path for authz_file is resolved relative to the environment directory: branches/1.0-stable/tracopt/perm/authz_policy.py@12054:175-17#L166.

On the other hand, PathOption resolves relative paths as relative to the directory of the trac.ini configuration file. It is probably reasonable to expect that authz_file would be relative to the $env/conf directory since it is a configuration file. This would also make the behavior consistent with [trac] authz_file, which uses PathOption.

$ grep -r "PathOption(" teo-rjollos.git/ --exclude-dir=.svn --exclude=config.py --exclude=*.pyc
teo-rjollos.git/tracopt/versioncontrol/git/git_fs.py:    projects_list = PathOption('git', 'projects_list', doc=
teo-rjollos.git/tracopt/versioncontrol/git/git_fs.py:    projects_base = PathOption('git', 'projects_base', doc=
teo-rjollos.git/trac/env.py:    shared_plugins_dir = PathOption('inherit', 'plugins_dir', '',
teo-rjollos.git/trac/web/chrome.py:    shared_templates_dir = PathOption('inherit', 'templates_dir', '',
teo-rjollos.git/trac/web/chrome.py:    shared_htdocs_dir = PathOption('inherit', 'htdocs_dir', '',
teo-rjollos.git/trac/versioncontrol/svn_authz.py:    authz_file = PathOption('trac', 'authz_file', '',

If the change is made, an environment upgrade step will be required to modify the value of authz_file in trac.ini:

  • Strip conf/ when path begins with conf/.
  • Transform other relative paths to absolute paths or prefix with ...

Attachments (0)

Change History (2)

comment:1 by Ryan J Ollos, 10 years ago

Milestone: next-dev-1.1.x1.1.4
Owner: set to Ryan J Ollos
Release Notes: modified (diff)
Status: newassigned

Proposed changes in log:rjollos.git:t11529.

comment:2 by Ryan J Ollos, 10 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in [13741:13743].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.