Skip to content

feat: source validated org from license JWT; drop client-side org-scoping - #84

Merged
minarc merged 1 commit into
feat/plugin-data-dir-and-marketplace-descfrom
feat/org-from-license-jwt
Jul 8, 2026
Merged

minarc merged 1 commit into
feat/plugin-data-dir-and-marketplace-descfrom
feat/org-from-license-jwt

Conversation

@minarc

@minarc minarc commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Org-scope is now the license activator's decision, not the client's. The client trusts and displays the org the activator validated (the JWT org claim); it no longer fetches GitHub org membership or lets the user narrow it.

⛓️ Stacked on #83 (base = feat/plugin-data-dir-and-marketplace-desc, which is stacked on #82). Retarget to main as the stack merges.

Why

The license activator already issues a license for a specific GitHub org, minted into the JWT (org.login = "SkillBench-AI", org.id). Re-deriving/narrowing orgs on the client was the wrong layer and redundant.

Changes

  • jwt.getLicenseOrgs(token) — reads the validated org(s) from the JWT org.login (forward-compat with a plural orgs array), normalized lowercase, no expiry gate.
  • credstore — getAllowedGitHubOrgs() derives from the JWT; commitSignin({ jwt }) no longer takes/stores an org list; dropped the normalizeOrgList dependency.
  • repo-scope — gate on the JWT-derived org (case-insensitive); removed getRepoScopeOrgFilter + the resolveOrgScope narrowing.
  • signin.js — removed the --org/--orgs flag, parseOrgArgs, scopeAndCommit, the re-scope-in-place branch, all cliOrgs plumbing, and the GitHub org fetch.
  • license-activation — trySilentGhActivate just stores the JWT (no fetch/narrow).
  • Deleted lib/org-scope.js and lib/github-api.js; dropped the unused GitHub API URL constants from config.js (kept the read:org OAuth scope — the activator resolves the org server-side).
  • Docs — removed the "narrowing scope" / --org / SKILLMETER_REPO_SCOPE_ORGS / skillmeter.repoScopeOrgs guidance from README + signin SKILL.md.
  • Bumped plugin version to 0.19.0.

Behavior change

Telemetry now captures only in the single licensed org's repos (the JWT org), not across every GitHub org the user belongs to. A JWT without an org claim → no capture (safe fail, never over-captures).

Verification

  • jwt.getLicenseOrgs: org.login "SkillBench-AI" → ["skillbench-ai"]; no org → []; plural orgs → normalized; null → [].
  • getRepoScopeDecision: matching repo → allowed/github_org_match/remoteOrg; other org → github_org_mismatch; no license → not_activated.
  • Telemetry-gate golden diff byte-identical across all modes (org now sourced from the JWT instead of seeded orgs).
  • node --test skillmeter/test/harness.test.js → 20/20; claude plugin validate skillmeter → ✔.
  • Net: +85 / −374 (two modules removed).

🤖 Generated with Claude Code

…scoping

The license activator already validates and issues a license for a specific
GitHub org (minted into the JWT `org` claim). The client should not re-derive
or narrow orgs — it should trust and display the org the activator validated.

- jwt.getLicenseOrgs(token): read the validated org(s) from the JWT `org.login`
  (forward-compat with a plural `orgs` array), normalized lowercase. No expiry
  gate (identity/routing info).
- credstore.getAllowedGitHubOrgs() now derives from the JWT; commitSignin({jwt})
  no longer takes/stores an org list; drop the normalizeOrgList dependency.
- repo-scope: gate on the JWT-derived org (case-insensitive); remove the
  getRepoScopeOrgFilter + resolveOrgScope narrowing.
- signin.js: remove the --org/--orgs flag, parseOrgArgs, scopeAndCommit, the
  re-scope-in-place branch, all cliOrgs plumbing, and the GitHub org fetch.
- license-activation: trySilentGhActivate just stores the JWT (no org fetch/narrow).
- Delete lib/org-scope.js and lib/github-api.js; drop the now-unused GitHub API
  URL constants from config.js (keep the read:org OAuth scope for the activator).
- Docs: remove the "narrowing scope" / --org / SKILLMETER_REPO_SCOPE_ORGS /
  skillmeter.repoScopeOrgs guidance from README + signin SKILL.md.
- Bump plugin version to 0.19.0.

Behavior change: telemetry now captures only in the single licensed org's repos
(the JWT org), not across every GitHub org the user belongs to. A JWT without an
org claim yields no capture (safe fail). Verified: telemetry-gate golden diff
byte-identical (org now sourced from the JWT), harness tests 20/20, plugin
validate passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (3)
  • main
  • dev
  • feature/*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5e8af97a-f8ce-4db2-9c38-452886d087c8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/org-from-license-jwt

Comment @coderabbitai help to get the list of available commands.

@minarc
minarc requested a review from TheStarkor July 8, 2026 14:05
@minarc
minarc merged commit 3249012 into feat/plugin-data-dir-and-marketplace-desc Jul 8, 2026
1 check passed
minarc added a commit that referenced this pull request Jul 8, 2026
…scoping (#84)

The license activator already validates and issues a license for a specific
GitHub org (minted into the JWT `org` claim). The client should not re-derive
or narrow orgs — it should trust and display the org the activator validated.

- jwt.getLicenseOrgs(token): read the validated org(s) from the JWT `org.login`
  (forward-compat with a plural `orgs` array), normalized lowercase. No expiry
  gate (identity/routing info).
- credstore.getAllowedGitHubOrgs() now derives from the JWT; commitSignin({jwt})
  no longer takes/stores an org list; drop the normalizeOrgList dependency.
- repo-scope: gate on the JWT-derived org (case-insensitive); remove the
  getRepoScopeOrgFilter + resolveOrgScope narrowing.
- signin.js: remove the --org/--orgs flag, parseOrgArgs, scopeAndCommit, the
  re-scope-in-place branch, all cliOrgs plumbing, and the GitHub org fetch.
- license-activation: trySilentGhActivate just stores the JWT (no org fetch/narrow).
- Delete lib/org-scope.js and lib/github-api.js; drop the now-unused GitHub API
  URL constants from config.js (keep the read:org OAuth scope for the activator).
- Docs: remove the "narrowing scope" / --org / SKILLMETER_REPO_SCOPE_ORGS /
  skillmeter.repoScopeOrgs guidance from README + signin SKILL.md.
- Bump plugin version to 0.19.0.

Behavior change: telemetry now captures only in the single licensed org's repos
(the JWT org), not across every GitHub org the user belongs to. A JWT without an
org claim yields no capture (safe fail). Verified: telemetry-gate golden diff
byte-identical (org now sourced from the JWT), harness tests 20/20, plugin
validate passes.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
minarc added a commit that referenced this pull request Jul 8, 2026
* feat: persist telemetry queue in ${CLAUDE_PLUGIN_DATA}; fill marketplace description

- paths.js: root LOG_DIR (queue + lock files) at ${CLAUDE_PLUGIN_DATA} when
  available, falling back to PLUGIN_ROOT/logs when unset (byte-identical to
  before). Fixes data loss: PLUGIN_ROOT is the install cache dir, wiped ~7 days
  after a plugin update, which stranded any un-drained queue.
- transfer.js: migrateLegacyQueue() copies sealed event logs (and seals the
  legacy active log) + pending transcripts forward from PLUGIN_ROOT/logs on
  first run; best-effort, copy + skip-existing, skips *.sent. Wired into
  session_start's prepareSession.
- marketplace.json: fill the empty skillmeter entry description + add a root
  marketplace description (clears `claude plugin validate` warning / blank card).
- Bump plugin version to 0.18.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat: source the validated org from the license JWT; drop client org-scoping (#84)

The license activator already validates and issues a license for a specific
GitHub org (minted into the JWT `org` claim). The client should not re-derive
or narrow orgs — it should trust and display the org the activator validated.

- jwt.getLicenseOrgs(token): read the validated org(s) from the JWT `org.login`
  (forward-compat with a plural `orgs` array), normalized lowercase. No expiry
  gate (identity/routing info).
- credstore.getAllowedGitHubOrgs() now derives from the JWT; commitSignin({jwt})
  no longer takes/stores an org list; drop the normalizeOrgList dependency.
- repo-scope: gate on the JWT-derived org (case-insensitive); remove the
  getRepoScopeOrgFilter + resolveOrgScope narrowing.
- signin.js: remove the --org/--orgs flag, parseOrgArgs, scopeAndCommit, the
  re-scope-in-place branch, all cliOrgs plumbing, and the GitHub org fetch.
- license-activation: trySilentGhActivate just stores the JWT (no org fetch/narrow).
- Delete lib/org-scope.js and lib/github-api.js; drop the now-unused GitHub API
  URL constants from config.js (keep the read:org OAuth scope for the activator).
- Docs: remove the "narrowing scope" / --org / SKILLMETER_REPO_SCOPE_ORGS /
  skillmeter.repoScopeOrgs guidance from README + signin SKILL.md.
- Bump plugin version to 0.19.0.

Behavior change: telemetry now captures only in the single licensed org's repos
(the JWT org), not across every GitHub org the user belongs to. A JWT without an
org claim yields no capture (safe fail). Verified: telemetry-gate golden diff
byte-identical (org now sourced from the JWT), harness tests 20/20, plugin
validate passes.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TheStarkor
TheStarkor deleted the feat/org-from-license-jwt branch September 21, 2026 18:39
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