Skip to content

feat(google): group→Google-Group binding model and CRUD API#91

Merged
BK1031 merged 1 commit into
mainfrom
bk1031/google-group-bindings
Jun 23, 2026
Merged

feat(google): group→Google-Group binding model and CRUD API#91
BK1031 merged 1 commit into
mainfrom
bk1031/google-group-bindings

Conversation

@BK1031

@BK1031 BK1031 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

PR 2 of the Sentinel-group → Google-Group sync feature. Adds the mapping table and its admin API. Still no Google API calls.

What's here

  • GroupGoogleBinding model (group_google_binding): 1:1 mapping of a Sentinel group_idgoogle_group_email. Both columns unique (one Sentinel group projects onto one Google Group, and each Google Group is driven by a single Sentinel group). AutoMigrated.
  • Service layer: GetAllGoogleBindings, GetGoogleBindingForGroup, CreateGoogleBinding, DeleteGoogleBinding (delete scoped to group_id + id, mirroring the discord binding).
  • sentinel:all-gated CRUD endpoints:
    • GET /google/group-bindings (optional ?group_id= filter)
    • POST /google/group-bindings (validates email format)
    • DELETE /google/group-bindings/:bindingID?group_id=

Design notes

  • 1:1 chosen over the discord-style multi-binding/OR model — outbound projection has no need for it, and uniqueness keeps the reconcile trivial.
  • Email is stored (not Google's internal group id) since it's what admins know and the Directory API accepts it as the groupKey.
  • No group-existence check against core on create (matches the discord binding); reconcile is the source of truth for correctness.

Not in this PR

  • Google Admin SDK Directory client + reconcile engine + cron (PR 3)
  • Infra: k8s manifest, deploy.yml, kerbecs gateway route (PR 4)

Verification

  • go build ./... + go vet ./... pass

Add GroupGoogleBinding (1:1 Sentinel group <-> Google Group email) with
AutoMigration, a service layer, and sentinel:all-gated CRUD endpoints
(GET/POST/DELETE /google/group-bindings). No Google API calls yet — this
is just the mapping table the reconcile engine will read.
@BK1031 BK1031 merged commit 56ad677 into main Jun 23, 2026
18 checks passed
@BK1031 BK1031 deleted the bk1031/google-group-bindings branch June 23, 2026 01:57
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.

1 participant