Skip to content

feat(ocm): carry received webapp name in resources - #274

Merged
glpatcern merged 2 commits into
redact-app-error-logsfrom
received-webapp-resource-metadata
Nov 5, 2026
Merged

glpatcern merged 2 commits into
redact-app-error-logsfrom
received-webapp-resource-metadata

Conversation

@MahdiBaghbani

@MahdiBaghbani MahdiBaghbani commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

This PR is part of the cs3org/OCM-STA#20 and cs3org/OCM-STA#48

Summary

  • Read the received webapp name that Reva returns on sharedWithMe (remoteItem["@ocm.webApp"].appName, feat(ocm): expose received webapp metadata cs3org/reva#5853) and keep it on the resource as ocmWebApp: { appName }. The optional member is declared once on Resource, so IncomingShareResource inherits it, and the generated Graph types stay untouched.
  • Copy a string name as is, including "". A missing key, null, an array, or a non-string name leaves ocmWebApp off. Deciding what counts as usable (trim, empty) is left to the action in the next PR, so this layer keeps "no webapp" and "webapp without a name" apart.
  • Read only remoteItem. A descriptor on the permission and @libre.graph.permissions.actions are ignored, and ids, roles, and the grant still come from the existing permission mapping. The fixtures are the same bytes as the Reva goldens.
flowchart TD
    G["sharedWithMe DriveItem"] --> R["readReceivedOcmWebApp(remoteItem)"]
    R --> K{"@ocm.webApp is a plain object?"}
    K -->|"missing, null, or array"| O["ocmWebApp omitted"]
    K -->|"yes"| N{"appName is a string?"}
    N -->|"no"| O
    N -->|"yes, empty included"| C["resource.ocmWebApp = { appName }"]
Loading

@MahdiBaghbani MahdiBaghbani self-assigned this Sep 29, 2026
@MahdiBaghbani MahdiBaghbani added the enhancement New feature or request label Sep 29, 2026
@glpatcern
glpatcern force-pushed the received-webapp-resource-metadata branch from 76c484f to daf4a76 Compare October 6, 2026 15:52
@MahdiBaghbani
MahdiBaghbani force-pushed the received-webapp-resource-metadata branch from daf4a76 to 51eb857 Compare October 7, 2026 16:08
@rawe0
rawe0 force-pushed the received-webapp-resource-metadata branch from 51eb857 to 5ef7f18 Compare October 12, 2026 16:37
@rawe0
rawe0 self-requested a review October 21, 2026 14:32

@rawe0 rawe0 left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks fine to me, will this trigger if OCM isn't enabled?

@MahdiBaghbani

Copy link
Copy Markdown
Member Author

No, it won't

It only reads remoteItem["@ocm.webApp"] which Reva adds to sharedWithMe for received OCM shares and only when OCM is enabled

Without it the ocmWebApp stays unset and nothing else changes and it makes no request of its own

The Open remotely action (#276) is also hidden unless ocm.openRemotely is on and the share carries an app name

@rawe0
rawe0 self-requested a review October 22, 2026 14:32
@MahdiBaghbani
MahdiBaghbani force-pushed the received-webapp-resource-metadata branch from 3a4e32a to 5fcc037 Compare October 30, 2026 10:51
@MahdiBaghbani
MahdiBaghbani removed this pull request from stack #277 October 30, 2026 11:19
@MahdiBaghbani
MahdiBaghbani changed the base branch from cernbox to redact-app-error-logs October 30, 2026 11:19
@MahdiBaghbani
MahdiBaghbani added this pull request to stack #287 October 30, 2026 11:20
@glpatcern
glpatcern merged commit e6b15e4 into cernbox Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants