block internal modules
Bug #988417 reported by
Till Westmann
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
High
|
Till Westmann |
Bug Description
If one wants to limit the choice of of available modules for a user, this is very easy for external modules. One simply registers an URIMapper that disallows access to certain modules. However, this does not work for Zorba's internal modules as those are not resolved via the usual resolution mechanism.
Related branches
lp:~zorba-coders/zorba/bug-988417-block-internal-module
- Matthias Brantner: Approve
- Markos Zaharioudakis: Approve
- Chris Hillery: Approve
-
Diff: 171 lines (+95/-5)5 files modifiedChangeLog (+1/-0)
src/compiler/translator/translator.cpp (+5/-0)
src/context/static_context.cpp (+15/-0)
src/context/static_context.h (+9/-0)
test/api/userdefined_uri_resolution.cpp (+65/-5)
description: | updated |
Changed in zorba: | |
milestone: | none → 2.5 |
status: | New → In Progress |
Changed in zorba: | |
status: | In Progress → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I saw the branch merge proposal before I noticed this bug, so I'll copy my comment from there:
I don't like that this mechanism is so different to the way you block non-internal modules (using a URIMapper with DENY_ACCESS). While it would be a bit less efficient, it would be more consistent to call static_ context: :resolve_ uri() at translator.cpp line 2840 solely for the purpose of seeing if zerr::ZXQP0029_ URI_ACCESS_ DENIED is thrown.
Further note:
Actually it would be sufficient to call static_ context: :apply_ uri_mappers( ) if we made that method non-private, or (probably better) added a method static_ context: :get_candidate_ uris() which was exactly the same as static_ context: :get_component_ uris() except for passing internal: :URIMapper: :CANDIDATE instead of COMPONENT.