Repository navigation
feat(files): add folder uploads, content search, and sharing #8819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
waleedlatif1
wants to merge
6
commits into
staging
Choose a base branch
from
codex/files-folders-search-sharing
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,643
−653
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8a1b0ce
feat(files): add folder uploads, content search, and sharing
waleedlatif1 65e0eeb
fix(files): harden folder uploads and sharing boundaries
waleedlatif1 35958a8
fix(files): enforce live sharing checks and stabilize browser coverage
waleedlatif1 9beab14
fix(files): await browser readiness and guard sharing fixture cleanup
waleedlatif1 fd395b1
fix(files): instrument native directory readers in browser checks
waleedlatif1 1016982
fix(files): capture header baseline after permissions settle
waleedlatif1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import type { NextRequest } from 'next/server' | ||
| import { NextResponse } from 'next/server' | ||
| import { getPublicFolderContract } from '@/lib/api/contracts/public-shares' | ||
| import { parseRequest } from '@/lib/api/server' | ||
| import { OrchestrationError } from '@/lib/core/orchestration/types' | ||
| import { validateDeploymentAuth } from '@/lib/core/security/deployment-auth' | ||
| import { generateRequestId } from '@/lib/core/utils/request' | ||
| import { withRouteHandler } from '@/lib/core/utils/with-route-handler' | ||
| import { PublicShareAccessError, readPublicSharedFolder } from '@/lib/public-shares/access' | ||
| import { enforcePublicFileRateLimit } from '@/lib/public-shares/rate-limit' | ||
|
|
||
| export const dynamic = 'force-dynamic' | ||
|
|
||
| /** Public capabilities use the share authentication protocol rather than workspace membership. */ | ||
| export const GET = withRouteHandler( | ||
| async (request: NextRequest, context: { params: Promise<{ token: string }> }) => { | ||
| const headers = { 'Cache-Control': 'private, no-store' } | ||
| const limited = await enforcePublicFileRateLimit(request, 'metadata') | ||
| if (limited) { | ||
| limited.headers.set('Cache-Control', headers['Cache-Control']) | ||
| return limited | ||
| } | ||
| const parsed = await parseRequest(getPublicFolderContract, request, context) | ||
| if (!parsed.success) { | ||
| parsed.response.headers.set('Cache-Control', headers['Cache-Control']) | ||
| return parsed.response | ||
| } | ||
| try { | ||
| const page = await readPublicSharedFolder({ | ||
| token: parsed.data.params.token, | ||
| ...parsed.data.query, | ||
| authorize: (share) => | ||
| validateDeploymentAuth(generateRequestId(), share, request, undefined, 'file'), | ||
| }) | ||
| return NextResponse.json(page, { headers }) | ||
| } catch (error) { | ||
| if (error instanceof PublicShareAccessError) { | ||
| return NextResponse.json({ error: error.message }, { status: error.status, headers }) | ||
| } | ||
| if (error instanceof OrchestrationError && error.code === 'validation') { | ||
| return NextResponse.json({ error: error.message }, { status: 400, headers }) | ||
| } | ||
| throw error | ||
| } | ||
| } | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.