Skip to content

GSuite offboarding - #39

Merged
betterclever merged 5 commits into
mainfrom
betterclever/gsuite-offboarding
Oct 26, 2025
Merged

betterclever merged 5 commits into
mainfrom
betterclever/gsuite-offboarding

Conversation

@betterclever

Copy link
Copy Markdown
Contributor

No description provided.

betterclever and others added 4 commits October 25, 2025 00:25
Implements GitHub issue #22 - Google Workspace license management component:
- Delete Google Workspace user accounts to automatically release all licenses
- Service account authentication via secrets adapter (ISecretsService)
- Comprehensive error handling with graceful failure responses
- Dry-run mode for safe testing and validation
- Full audit logging with before/after state tracking
- 10 comprehensive unit tests covering all scenarios
- Uses official Google Admin SDK with domain-wide delegation

Component ID: it-automation.google-workspace.user-delete
Tests: 10 passing, TypeScript: valid, All integration tests: passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +71 to +79
async function initializeGoogleClient(serviceAccountKey: string) {
const credentials = JSON.parse(serviceAccountKey);

const auth = new google.auth.GoogleAuth({
credentials,
scopes: [
'https://www.googleapis.com/auth/admin.directory.user'
],
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Configure domain impersonation for Google Admin client

The helper that builds the Google Admin SDK client only instantiates google.auth.GoogleAuth with the service account key and scopes, but never sets a subject (delegated admin email). Directory API operations such as users.get and users.delete require domain‑wide delegation to impersonate an administrator; without subject, the service account cannot access the Admin APIs and these calls will consistently return 403/insufficientPermissions even when the secret is valid. Since the component accepts no administrator email input, every production invocation will fail before it can delete a user. Consider accepting an admin email and initializing the auth client with it so the service account can act on behalf of a domain admin.

Useful? React with 👍 / 👎.

@betterclever
betterclever merged commit f70432a into main Oct 26, 2025
1 check passed
@LuD1161
LuD1161 deleted the betterclever/gsuite-offboarding branch December 19, 2025 13:20
betterclever added a commit that referenced this pull request Mar 6, 2026
…sync

fix(deploy): ensure backend reads full staging secret
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