Skip to content

CELDEV-1334 Add current-wiki REST reference ADR - #31

Open
fpichler wants to merge 2 commits into
devfrom
feature/CELDEV-1334
Open

CELDEV-1334 Add current-wiki REST reference ADR#31
fpichler wants to merge 2 commits into
devfrom
feature/CELDEV-1334

Conversation

@fpichler

@fpichler fpichler commented Jul 31, 2026

Copy link
Copy Markdown
Member

https://synjira.atlassian.net/browse/CELDEV-1334

Summary

  • record canonical local document and space references as the convention for current-wiki REST endpoints
  • reject wiki-qualified inputs, including qualifiers naming the current wiki
  • require an explicit authorization and disclosure contract for future cross-wiki APIs

Coordinated delivery

Draft 1 of 4 for CELDEV-1334:

  1. CELDEV-1334 Add current-wiki REST reference ADR #31
  2. CELDEV-1334 Add navigation REST API celements-base#309
  3. CELDEV-1334 Manage navigation REST artifact celements-parent-poms#142
  4. CELDEV-1334 Deploy navigation REST component celements-web#556

Validation

  • documentation reviewed against NAVIGATION_API_PLAN.md
  • coordinated local build, REST contract tests, WAR packaging, and runtime smoke checks completed
  • manually tested and approved by the requester

@fpichler
fpichler force-pushed the feature/CELDEV-1334 branch from 0270c83 to 961d511 Compare July 31, 2026 21:54
@fpichler
fpichler requested a review from msladek July 31, 2026 22:07
@fpichler
fpichler marked this pull request as ready for review July 31, 2026 22:07
Comment on lines +24 to +25
- Reject malformed, noncanonical, or wiki-qualified input references.
- Reject a wiki-qualified input even when its qualifier names the current wiki.

@msladek msladek Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think wiki qualification alone should determine whether an input crosses the tenant boundary. currentWiki:Space.Doc still resolves inside the endpoint’s current-wiki scope. We should accept it after verifying that the wiki component equals the actual current wiki and reject only references naming another wiki. This retains canonical local responses and the cross-wiki security boundary without forcing clients to strip an otherwise valid current-wiki qualifier.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right that currentWiki:Space.Doc does not itself cross the tenant boundary. Its rejection is nevertheless intentional, but for canonicalization and disclosure: the request already defines the wiki scope, and current-wiki endpoints accept one wire representation so clients do not depend on a deployment-specific wiki identifier.

I updated the ADR in c4a09ad to make that distinction explicit. CELDEV-1334 and the linked implementation in celements/celements-base#309 specify and test rejection of every qualified reference. If we want both local and same-wiki-qualified inputs accepted, we should reopen that coordinated contract rather than change this ADR alone.


- Reject malformed, noncanonical, or wiki-qualified input references.
- Reject a wiki-qualified input even when its qualifier names the current wiki.
- Serialize response references canonically and locally.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also question the decision to serialize responses locally. Returning Space.Doc loses the reference’s wiki identity: if that value crosses into a request handled by another wiki, it can silently resolve as a different document. Returning the canonical qualified reference (wiki:Space.Doc) preserves provenance and allows the receiving boundary to reject mismatched wiki qualifiers. Combined with accepting qualified input only when its qualifier matches the actual current wiki, this also gives us a safe round-trip contract: the API accepts its own output.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The local reference is intentionally contextual to the wiki serving the response, just like the relative url; it is not a globally transferable identifier. Within that scope the API already accepts its own output.

I replaced the ambiguous "portable" wording in c4a09ad with the explicit consequence that clients moving a reference between request contexts must retain source-wiki context separately. Returning wiki:Space.Doc would expose a deployment-specific wiki identifier and reverse the local-reference contract in CELDEV-1334 and celements/celements-base#309. A real cross-wiki handoff needs a separate tenant-identity, authorization, and disclosure contract.

Comment on lines +35 to +45
## Consequences

- Current-wiki endpoints have an unambiguous tenant boundary.
- Clients cannot use a current-wiki endpoint as a cross-wiki discovery
mechanism.
- Request validation must distinguish canonical local references from malformed,
noncanonical, and wiki-qualified input.
- Responses remain portable because their references do not depend on the
current wiki name.
- Cross-wiki use cases require deliberate API design rather than an implicit
extension of a local endpoint.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the consequences section largely repeats the decision as outcomes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I rewrote the section in c4a09ad around the actual trade-offs: callers with qualified current-wiki references must normalize them, response references require request-wiki context, payloads do not expose or depend on internal wiki names, validators can reject qualifiers uniformly, and cross-wiki use requires a separate contract.

@msladek msladek Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repeated rationale obscures the ADR’s core decision.

Same points repeat:

  • Internal/deployment-specific wiki names: Context and Consequences.
  • Contextual/non-portable references: Context, Decision, and Consequences.
  • Separate cross-wiki contract: three times.
  • Uniform qualifier rejection: Decision and Consequences.

I’d prefer a concise ADR without repetitive wording.

@msladek msladek assigned fpichler and unassigned msladek Aug 13, 2026
@fpichler fpichler assigned msladek and unassigned fpichler Aug 13, 2026
@fpichler
fpichler requested a review from msladek August 13, 2026 12:14

@msladek msladek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also see DM

Comment on lines +39 to +40
- Clients holding qualified references, including references qualified with the
current wiki, must serialize them locally before calling these endpoints.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherWiki:Space.Doc must not be normalized to local Space.Doc

Comment on lines +35 to +45
## Consequences

- Current-wiki endpoints have an unambiguous tenant boundary.
- Clients cannot use a current-wiki endpoint as a cross-wiki discovery
mechanism.
- Request validation must distinguish canonical local references from malformed,
noncanonical, and wiki-qualified input.
- Responses remain portable because their references do not depend on the
current wiki name.
- Cross-wiki use cases require deliberate API design rather than an implicit
extension of a local endpoint.

@msladek msladek Aug 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repeated rationale obscures the ADR’s core decision.

Same points repeat:

  • Internal/deployment-specific wiki names: Context and Consequences.
  • Contextual/non-portable references: Context, Decision, and Consequences.
  • Separate cross-wiki contract: three times.
  • Uniform qualifier rejection: Decision and Consequences.

I’d prefer a concise ADR without repetitive wording.

@msladek msladek assigned fpichler and unassigned msladek Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants