Skip to content

fix(scope): publish/label with the active repo scope's visibility#129

Merged
christophergeyer merged 1 commit into
mainfrom
feat/scope-public-attributed
May 30, 2026
Merged

fix(scope): publish/label with the active repo scope's visibility#129
christophergeyer merged 1 commit into
mainfrom
feat/scope-public-attributed

Conversation

@christophergeyer
Copy link
Copy Markdown
Member

Problem

load_publish_auth_context built the current_user (and project) scope_request with a hardcoded visibility="private", ignoring roar scope use. So with the active repo scope set to public ("public attributed"), roar register and roar label sync still requested a private scope — and the server fell back to the legacy anonymous public bucket (owner 0000…) — instead of the authenticated user's own public-attributed scope. roar scope status reported public while the publish payload said private.

Change

Resolve scope_request visibility from the active RepoScope.mode:

active scope scope_request
public {owner_resolution: current_user, visibility: "public"} (attributed)
anonymous omitted → server uses the anonymous public scope
private / project / unset visibility: "private" (unchanged)

So roar scope use public + register/label sync now lands in the authenticated user's public-attributed scope (anonymous-readable, but owned by them). Pairs with server-side owner_resolution=current_user support in treqs-inc/glaas-api#47.

Tests

tests/unit/test_publish_auth_context.py: adds active-public → public current_user scope, and active-anonymous → omitted scope_request. Existing private / project-bound / no-binding cases unchanged. Full unit suite green (one pre-existing, unrelated telemetry-endpoint env test aside).

Follow-up (not in this PR)

The roar register/put --public flag still routes to the anonymous bucket. Flipping it to attributed changes auth requirements (attributed needs login/SSH; --anonymous becomes the explicit unattributed path) and touches the publish-runtime plumbing + anonymous-public registration-session logic, so it's a focused follow-up to land after the active-scope path is validated end-to-end on dev.

🤖 Generated with Claude Code

load_publish_auth_context built the current_user (and project) scope_request
with a hardcoded visibility="private", ignoring `roar scope use`. So with the
active scope set to `public` (public attributed), register and label sync still
requested a private scope and the server fell back to the anonymous public
bucket, instead of the user's own public-attributed scope.

Resolve scope_request visibility from the active RepoScope mode:
  public    -> "public" (attributed)
  anonymous -> omit scope_request (server uses the anonymous public scope)
  private / project / unset -> "private" (unchanged)

So `roar scope use public` + register/label sync now lands in the authenticated
user's public-attributed scope (anonymous-readable but owned by them). Pairs
with server-side owner_resolution=current_user support (treqs-inc/glaas-api#47).

Note: the `roar register/put --public` flag still routes to the anonymous
bucket; flipping it to attributed changes auth requirements and is a focused
follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@christophergeyer christophergeyer merged commit 106b2c8 into main May 30, 2026
23 of 24 checks passed
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.

3 participants