Skip to content

feat(cli): add --private flag for login-gated share links#33

Open
abhinav-1504 wants to merge 2 commits into
optiqor:mainfrom
abhinav-1504:feat/cli-private-share
Open

feat(cli): add --private flag for login-gated share links#33
abhinav-1504 wants to merge 2 commits into
optiqor:mainfrom
abhinav-1504:feat/cli-private-share

Conversation

@abhinav-1504
Copy link
Copy Markdown

What

Adds --private flag to the analyze command. When passed alongside
--share, the upload request includes X-Optiqor-Private: 1 so the
sandbox receiver can return a login-gated URL (backend Phase 2 work).

Why

Fixes #23

How

  • Registered --private bool flag on analyze next to --share
  • Fails closed: --private without --share returns an error
  • share.Upload() accepts a new private bool param and conditionally
    sets X-Optiqor-Private: 1 on the POST request
  • Printed suffix changes to (uploaded · login-gated) when private=true
  • Honours offline mode — no upload attempted when sandbox is unreachable

Testing

  • go test ./internal/share/... -v — 11/11 PASS
  • go build ./... — clean
  • Tested locally with ./cmd/optiqor/demo/values.yaml:
    • --share alone → URL printed
    • --private alone → error returned
    • --share --private → URL printed with login-gated suffix
    • --help--private flag listed correctly

Checklist

  • PR title follows Conventional Commits (feat(scope): subject)
  • No unrelated changes pulled in
  • No LLM calls or telemetry introduced
  • No proprietary backend imports

@abhinav-1504 abhinav-1504 requested a review from btwshivam as a code owner May 21, 2026 05:43
@github-actions
Copy link
Copy Markdown

First PR — welcome aboard!

A few things to expect:

  1. CI: every PR runs build + race tests + lint on Ubuntu and macOS. If something fails, the log will tell you exactly which gate.
  2. DCO: every commit needs Signed-off-by:. git commit -s adds it automatically.
  3. Conventional Commits: PR titles like feat(analyze): new rule or fix(cli): handle X. We squash-merge by default.
  4. Review: a maintainer will review within 72 hours. Suggestions are conversations, not orders — push back if something doesn't fit your context.

If you get stuck, reply here or jump to Discussions. We want this PR to land.

@github-actions github-actions Bot added testing Test coverage and golden fixtures area/cli Cobra CLI commands and UX area/share Share-link feature (internal/share) size/M 51–200 lines labels May 21, 2026
@abhinav-1504 abhinav-1504 force-pushed the feat/cli-private-share branch from 0071703 to 8f48b45 Compare May 21, 2026 05:46
@abhinav-1504
Copy link
Copy Markdown
Author

abhinav-1504 commented May 21, 2026

Hello @btwshivam, Ready for review. All CI checks pass and DCO is signed.
Tested locally:

  • --share alone ->URL printed
  • --private without --share -> error returned (fails closed)
  • --share --private -> URL printed with login-gated suffix
  • 11/11 unit tests pass including two new ones for the private header

@abhinav-1504
Copy link
Copy Markdown
Author

Hi @btwshivam , just following up on this PR. All CI checks are passing and the implementation has been tested locally as mentioned above.

Could you please take another look when possible? Thanks.

Signed-off-by: Abhinav Singh Chauhan <abhinavsinghc48@gmail.com>
@abhinav-1504 abhinav-1504 force-pushed the feat/cli-private-share branch from 8f48b45 to d3083c5 Compare May 24, 2026 06:18
@abhinav-1504
Copy link
Copy Markdown
Author

Hi @btwshivam, resolved the merge conflicts and force-pushed. Branch is clean and all checks are passing. Ready for review.

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

Labels

area/cli Cobra CLI commands and UX area/share Share-link feature (internal/share) size/M 51–200 lines testing Test coverage and golden fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): add --private flag for login-gated share links

1 participant