Skip to content

[Feature Request] gem4gov: add a license-assignment command (batchUpdateUserLicenses) #121

Description

@JohnHales

Feature Description

The gem4gov license group wraps distributeLicenseConfig (distribute) and lists configs (list), but has no user-assignment command. Add gem4gov license assign (plus unassign/reconcile) wrapping the public Discovery Engine batchUpdateUserLicenses REST method, mirroring the existing distribute command's structure.

Use Case

Assigning a license to an individual user currently requires the Gemini Enterprise console "Manage users" page or a manually created REST call (grep -n batchUpdateUserLicenses gem4gov.py → no matches). A CLI command makes assignment scriptable, idempotent, and auditable — producing cleaner audit evidence for license oversight.

Proposed Solution

Add gem4gov license assign wrapping the documented API. Verified schema (Google's public "Get subscriptions and assign licenses" docs):
POST https://{us|eu|}discoveryengine.googleapis.com/v1/projects/{PROJECT_ID}/locations/{LOCATION}/userStores/default_user_store:batchUpdateUserLicenses
body { inlineSource: { userLicenses: [{ userPrincipal, licenseConfig }], updateMask: { paths: ["userPrincipal","licenseConfig"] } }, deleteUnassignedUserLicenses: bool }.
Note: v1 (not v1alpha), default_user_store, licenseConfig is the project-level config path. Unassign = omit licenseConfig + deleteUnassignedUserLicenses: true.

Compliance & Deployment Context

  • Target Deployment Type(s):
    • US Region Restricted (e.g., Access Policy constraint)
    • FedRAMP Medium
    • FedRAMP High
    • DoD IL4
    • DoD IL5
    • All / General
  • Relevant NIST 800-53r5 Controls: AC-2 (account management) — auditable, repeatable license assignment.

Reusability Check

Stellar Engine prioritizes reusability.

  • I have checked if this functionality can be achieved by extending an existing module or blueprint. (Extends the existing license group; no wrapper exists anywhere in the repo.)
  • I have verified that this does not duplicate existing functionality. (Checked all 61 open/closed issues; [Feature Request] Convert gem4gov-cli Python tool to Terraform #100 proposes converting the CLI to Terraform — if that lands, this ask translates to the TF implementation.)

Alternatives Considered

Console clicks (not scriptable/auditable at scale); hand-rolled REST calls (works, but every operator reinvents the request shape).

Additional Context

Verified at main @ 3728fc98. Related: #100 (CLI→Terraform conversion).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Level of Effort - MediumModerate task requiring thought and testing; typically takes a couple of days to a weekPriority - MediumStandard features and non-blocking bugs; important for the current milestone but not urgentenhancementNew feature or requestgemini for governmentGemini for Government (G4G) related

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions