Skip to content

Conversation

@ArtificialOwl
Copy link
Member

@ArtificialOwl ArtificialOwl commented Jun 16, 2025

PR to support the Internal Link feature while using global scale.

Internal links generated on one instance should be able to link to the correct (local/shared) file when used by an other account from another instance within the same global scale.

synopsis

1. identity token

  • each instance generates a small unique token,
  • unique token is made publicly available using a discovery endpoint,
  • all instances request each others to discover each others token

2. internal link

  • On the front-end, the generated link now contains the local identity token:
    https://nc1.example.net/gf/<token>/<fileid>
  • When opened by a user with no account on the current (slave) instance, redirection is made to the master (+sso), which will keep forwarding user to its own instance, keeping the path /gf/<token>/<fileid> while navigating on the (slave) instance forwarded user has its account.

3. search

  • Token and fileid is used to get data about the remote file and its parents, searching for the shares that could provide local access to the remote file,
  • The local file id is extracted from the share mount point and parent line

Expected behavior

Concept can be fully approached with a 3 instances setup:

  • Alice has its account on instance 1,
  • Bob has its account on instance 2,
  • Charlie has its account instance 3,
  • All files/folders are originally created on instance 1 but not under Alice,
  • A top folder is shared, and a file in a subfolder will be used to create internal links,
  • For each shares, each account will create a link: link1, link2, link3 which all link to the same file,
  • Each account will use the 3 links:

link1

  • file is local to instance1, Alice will get direct access to the file,
  • instance2 will request instance1 to get the correct shared folder and the path to get to the file,
  • instance3 will request instance1 to get the correct shared folder and the path to get to the file.

link2

  • instance1 will be redirected by instance2 to instance1 and identified the link as local file, file id is extracted from the redirection data,
  • instance2 is local and Bob will get direct access to the shared file,
  • instance3 will be redirected by instance2 to instance1 to get the correct shared folder and the path to get to the file,

link3

  • instance1 will be redirected by instance3 to instance1 and identified the link as local file, file id is extracted from the redirection data,
  • instance2 will be redirected by instance3 to instance1 to get the correct shared folder and the path to get to the file,
  • instance3 is local and Charlie will get direct access to the shared file,

Tested use cases:

To complete those cases:

  • Denise has its account on instance 1, and get a share of the top folder
  • Eve has its account on instance 2, and get a share of the top folder
  • Frank has its account on instance 3, and get only access to a sub folder

user shares

  • link1, instance1, Alice
  • link1, instance2, Bob
  • link1, instance3, Charlie
  • link1, instance1, Denise
  • link1, instance2, Eve
  • link1, instance3, Frank
  • link2, instance1, Alice
  • link2, instance2, Bob
  • link2, instance3, Charlie
  • link2, instance1, Denise
  • link2, instance2, Eve
  • link2, instance3, Frank
  • link3, instance1, Alice
  • link3, instance2, Bob
  • link3, instance3, Charlie
  • link3, instance1, Denise
  • link3, instance2, Eve
  • link3, instance3, Frank

team shares

  • link1, instance1, Alice
  • link1, instance2, Bob
  • link1, instance3, Charlie
  • link1, instance1, Denise
  • link1, instance2, Eve
  • link1, instance3, Frank
  • link2, instance1, Alice
  • link2, instance2, Bob
  • link2, instance3, Charlie
  • link2, instance1, Denise
  • link2, instance2, Eve
  • link2, instance3, Frank
  • link3, instance1, Alice
  • link3, instance2, Bob
  • link3, instance3, Charlie
  • link3, instance1, Denise
  • link3, instance2, Eve
  • link3, instance3, Frank

requirements

manual testing

  • get NC32,
  • apply this PR, core PR and circles PR,
  • run ./occ globalsiteselector:discovery on every instance of the globalscale
  • run ./occ globalsiteselector:discovery --current to display list of globalscale identity token
  • generate internal link from any front-end and add the token to it:
    • https://nc1.example.net/gf/<token>/<fileid>
  • test the new link on all instances of the globalscale

@ArtificialOwl ArtificialOwl force-pushed the enh/noid/get-gs-token branch 3 times, most recently from 58f2551 to 26981b7 Compare June 19, 2025 17:50
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/get-gs-token branch from 26981b7 to c04e3fb Compare June 24, 2025 21:38
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/get-gs-token branch 2 times, most recently from d0537e5 to 7fd06b3 Compare July 1, 2025 21:30
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/get-gs-token branch from 7fd06b3 to 60f5106 Compare July 2, 2025 13:34
@ArtificialOwl ArtificialOwl changed the title identify instance by token internal link across global scale Sep 25, 2025
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/get-gs-token branch 3 times, most recently from ed2d615 to bd96e25 Compare September 29, 2025 11:24
@ArtificialOwl
Copy link
Member Author

ArtificialOwl commented Sep 29, 2025

All use cases has been tested and are fully working.

last task before merge:

  • comments on the last fixes
  • front-end needs to add the local instance token when generating internal-link
  • tests

@ArtificialOwl ArtificialOwl marked this pull request as ready for review September 29, 2025 11:35
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/get-gs-token branch from bd96e25 to 8e7e0a1 Compare October 1, 2025 11:55
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/get-gs-token branch 2 times, most recently from 4012772 to f08e3ce Compare October 14, 2025 13:57
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/get-gs-token branch 2 times, most recently from f8532e7 to 3cd348b Compare October 22, 2025 22:59
Signed-off-by: Maxence Lange <[email protected]>
Signed-off-by: Maxence Lange <[email protected]>
@ArtificialOwl ArtificialOwl force-pushed the enh/noid/get-gs-token branch 3 times, most recently from 4b2958e to 51df6aa Compare January 14, 2026 14:35
Signed-off-by: Maxence Lange <[email protected]>
@ArtificialOwl ArtificialOwl merged commit b87cbd5 into master Jan 14, 2026
46 of 55 checks passed
@ArtificialOwl ArtificialOwl deleted the enh/noid/get-gs-token branch January 14, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants