[ESRCH-34] Limit MGNL code to use our own APIs Created: 15/Oct/20 Updated: 19/Jan/21 |
|
| Status: | Accepted |
| Project: | External Enterprise Search |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Story | Priority: | Neutral |
| Reporter: | Ilgun Ilgun | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Date of First Response: | |
| Epic Link: | Elastic Search |
| Story Points: | 8 |
| Description |
|
Relationale: We don't want people to directly contact JCR bypassing our APIs, that is not the right approach going forward. Instead, they should inject our components and make use of them. Hence, we should be able to block all internal codebase calls to JCR search related operations
AC
|
| Comments |
| Comment by Michael Duerig [ 26/Nov/20 ] |
|
One way to achieve this is to wrap javax.jcr.query.QueryManager in Magnolia and override the QueryManager#createQuer(statement, language) method. If the language argument doesn't match that of the underlying search provider (e.g. "ES") we throw an exception. With this approach we can reuse existing APIs and "just" need to adapt call sites to specify their queries in the right language. Note, the QueryManager#getSupportedQueryLanguages method allows callers to discover the supported languages. |