Skip to content

Conversation

@ArtificialOwl
Copy link
Member

@ArtificialOwl ArtificialOwl commented Jun 16, 2025

Allow a modification of the behavior on internal-link request ('/index.php/f/12345')

Any listener can change the value of the FileId or even force a new Response() to be sent back to the client.

@ArtificialOwl ArtificialOwl added this to the Nextcloud 32 milestone Jun 25, 2025
@ArtificialOwl ArtificialOwl added the 3. to review Waiting for reviews label Jun 25, 2025
@ArtificialOwl ArtificialOwl marked this pull request as ready for review June 25, 2025 18:12
@ArtificialOwl ArtificialOwl requested a review from a team as a code owner June 25, 2025 18:12
@ArtificialOwl ArtificialOwl requested review from Altahrim, nfebe and provokateurin and removed request for a team June 25, 2025 18:12
@ArtificialOwl ArtificialOwl force-pushed the feat/noid/internal-lint-request-event branch from b30bcd4 to b8c8a4c Compare June 25, 2025 18:13
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

Not really happy about this hack 🤷‍♀️

@ArtificialOwl ArtificialOwl force-pushed the feat/noid/internal-lint-request-event branch from e9eb8cf to dcfe94a Compare June 25, 2025 19:56
@sorbaugh sorbaugh requested a review from provokateurin August 13, 2025 07:20
This was referenced Aug 22, 2025
This was referenced Sep 2, 2025
This was referenced Sep 25, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@ArtificialOwl ArtificialOwl force-pushed the feat/noid/internal-lint-request-event branch from dcfe94a to 5fcb7c2 Compare October 1, 2025 21:38
@ArtificialOwl
Copy link
Member Author

Not really happy about this hack 🤷‍♀️

went to something simpler: no changes are made to the file id, just the possibility to create a new Response

@come-nc
Copy link
Contributor

come-nc commented Oct 7, 2025

Please explain the usecase better.
In nextcloud/globalsiteselector#177 you seem to expect fileId to be a composed field with two parts split by a dot.
But here you simply but the file id in the event, so it should be an int?

@ArtificialOwl
Copy link
Member Author

I think I see the confusion with expecting fileid to be an int, but fileid was already considered string in that part of code, hence the cast.

Maybe rename the parameter ?

Regarding use-cases, the approach is to keep the same endpoint but store more data in the 'fileid' parameter.
an app intercept the event and generate its own Response instead of the default one which is a redirect to the file viewer.

The instant use of this feature is to store the identity of the local instance when creating internal link in a global scale env.
The end result is to have an internal link generated on instance A to redirect to a local file when used on instance B.

@come-nc
Copy link
Contributor

come-nc commented Oct 9, 2025

I think I see the confusion with expecting fileid to be an int, but fileid was already considered string in that part of code, hence the cast.

But even your example in the description uses an int: "Allow a modification of the behavior on internal-link request ('/index.php/f/12345')"

Maybe rename the parameter ?

Regarding use-cases, the approach is to keep the same endpoint but store more data in the 'fileid' parameter. an app intercept the event and generate its own Response instead of the default one which is a redirect to the file viewer.

Why do you want to reuse the same endpoint for something else? You can use your own endpoint with your own parameters.

The instant use of this feature is to store the identity of the local instance when creating internal link in a global scale env. The end result is to have an internal link generated on instance A to redirect to a local file when used on instance B.

I did not understand yet who is generating the link. The global scale PR says "On the front-end, the generated link now contains the local identity token:
https://nc1.example.net/f/<token>.<fileid>", but does not contain any modification to frontend files.

@susnux
Copy link
Contributor

susnux commented Oct 9, 2025

Frontend wise its also easy to just use a new endpoint for GS instead, so we can have a clean API if that is what you requested.

E.g. we could also generate links for /gs/12314 instead of /f/1234 if global scale is used.

@ArtificialOwl
Copy link
Member Author

closing, will allow globalsiteselector to manage root path

1 similar comment
@ArtificialOwl
Copy link
Member Author

closing, will allow globalsiteselector to manage root path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants