Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add optional org_id filter to ListProjectsByUser

Aperta
#1,856 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
75/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
go
Ambito
api, backend

Direzione di ricerca

Inizia dal punto di ingresso ListProjectsByUser in internal/api/v1beta1connect/user.go e dalla definizione della request corrispondente in raystack/proton. Traccia come il core/project.Filter esistente riceve il Principal dell’utente, quindi replica la gestione di org_id di ListProjectsByCurrentUser. Il lavoro è completato quando un org_id non impostato o vuoto mantiene i risultati attuali e un valore impostato limita i risultati a quell’organizzazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is your feature request related to a problem? Please describe.
FrontierService.ListProjectsByUser returns every project a user has access to across all organizations, with no way to scope the result to one organization server-side. The request message only carries the user id:

message ListProjectsByUserRequest {
  string id = 1;
}

Callers that need "projects of user X within org Y" (a common multi-tenant lookup) have to fetch all of the user's projects and filter by org_id client-side. The sibling RPC ListProjectsByCurrentUser already supports exactly this filter, so the two contracts are inconsistent:

message ListProjectsByCurrentUserRequest {
  // org_id is optional and filter projects by org
  string org_id = 1;
  ...
}

Describe the solution you'd like
Add an optional org_id filter to the request, mirroring ListProjectsByCurrentUserRequest:

message ListProjectsByUserRequest {
  string id = 1;
  // org_id is optional and filters projects by org
  string org_id = 2;
}

Semantics:

  • org_id unset/empty → current behavior unchanged (projects across all orgs), so the change is fully backward compatible on the wire and in behavior.
  • org_id set → only projects belonging to that organization are returned.

The implementation looks small: the handler (internal/api/v1beta1connect/user.go → ListProjectsByUser) already builds a core/project.Filter, which supports OrgID alongside Principal — the new field just needs to be passed through, plus the proto change in raystack/proton.

Describe alternatives we've considered

  • Client-side filtering of the full ListProjectsByUser response by project.org_id — works, but transfers and transforms all projects across every org the user belongs to on each call.
  • ListProjectsByCurrentUser with org_id — only works for the authenticated user; it can't be used by a service user resolving another user's projects.
  • ListOrganizationProjects — scoped to the org but not filterable by user, so it would require intersecting two full listings client-side.

Additional context
We call this RPC from a backend service (service-user credentials) via the Go SDK (frontierv1beta1.ListProjectsByUserRequest) to resolve the projects a given user can access within one specific organization.

Lingua principale
Go
Stelle
344
Fork
47
Merge medio
4g 4h
PR unite (30g)
26

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di raystack/frontier

Tutte le issue di raystack/frontier

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.