source-cooperative / source-cooperative/source.coop

Add the Service Account account type

Open
#545 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
26
Forks
9
Avg merge
1d 7h
Merged PRs (30d)
42

Description

Phase 2 — The principal.

Today
Two account types, individual and organization. Roughly 48 places across 20 files branch on which.

Do

  • Add AccountType.SERVICE.
  • Add an explicit owner_account_id and an index for it.
  • Mint ids in a reserved svc-- namespace (ID_REGEX forbids -- in a human-chosen id, so the prefix cannot be forged).
  • Restrict a service account to read_data / write_data memberships — never owners or maintainers.

Done when

  • A service account can be created.
  • It appears on the two membership-management pages, visually distinguished, since that is where an owner revokes its grant.
  • It cannot be invited as owner or maintainer, cannot create products or organizations, and cannot hold the admin flag.

Watch

  • The default at every branch site is exclude; inclusion needs a reason.
  • Most of those sites are the binary isIndividualAccount / isOrganizationalAccount helpers, which would render a machine as an organization profile rather than failing.
  • Membership listing currently returns false for any third account type and must be widened for exactly those two pages.
  • An account id is also the first segment of a public URL, so each service account consumes a name and gets a profile route.

Open question carried from the epic: what "capped by the owner" means when the owner is an organization — which is also the recommended default. Organizations never authenticate, and the membership lookup returns rows where the organization is the member, which is not the same thing.

Depends on source-cooperative/source.coop#543 and source-cooperative/source.coop#544.


Part of source-cooperative/source.coop#491.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the isIndividualAccount and isOrganizationalAccount helpers across the stated branch sites, then inspect ID_REGEX, membership listing, and the two membership-management pages. Confirm how account creation, ownership, invitations, product and organization creation, admin flags, and public profile routes handle the new type. Done means service accounts use the reserved namespace, have the stated ownership and membership limits, and appear correctly on both pages.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authorization, backend-api-design, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.