Skip to content

Generate embed_key at project creation time#118

Merged
Yashb404 merged 2 commits into
feat/keys-freshfrom
copilot/sub-pr-116-again
Feb 11, 2026
Merged

Generate embed_key at project creation time#118
Yashb404 merged 2 commits into
feat/keys-freshfrom
copilot/sub-pr-116-again

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 11, 2026

Addresses feedback from PR #116: newly published projects lacked embed_key until the owner viewed them, preventing immediate VIP link sharing.

Changes

  • publish_handler: Generate embed_key during INSERT using encode(gen_random_bytes(24), 'base64')
  • get_project handler: Retain lazy generation as fallback for pre-existing projects
// Before: embed_key was NULL for new projects
INSERT INTO projects (slug, image_tag, markdown, owner_id, owner_username, shell, embed_token) 
VALUES ($1, $2, $3, $4, $5, $6, gen_random_uuid()::text)

// After: embed_key generated immediately
INSERT INTO projects (slug, image_tag, markdown, owner_id, owner_username, shell, embed_token, embed_key) 
VALUES ($1, $2, $3, $4, $5, $6, gen_random_uuid()::text, encode(gen_random_bytes(24), 'base64'))

VIP links now work immediately after publishing without requiring the owner to view the project first.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Added embed_key generation in INSERT statement using encode(gen_random_bytes(24), 'base64')
- Ensures VIP links are immediately available after project publishing
- Lazy generation in get_project handler still works as fallback for migrated projects

Co-authored-by: Yashb404 <139128977+Yashb404@users.noreply.github.com>
Copilot AI changed the title [WIP] Update secure embed authorization implementation based on feedback Generate embed_key at project creation time Feb 11, 2026
Copilot AI requested a review from Yashb404 February 11, 2026 04:46
@Yashb404 Yashb404 marked this pull request as ready for review February 11, 2026 04:50
@Yashb404 Yashb404 merged commit f8cd379 into feat/keys-fresh Feb 11, 2026
@Yashb404 Yashb404 deleted the copilot/sub-pr-116-again branch February 11, 2026 04:50
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