Skip to content

Adds command outlook calendargroup set. Closes #7109#7183

Open
MathijsVerbeeck wants to merge 1 commit intopnp:mainfrom
MathijsVerbeeck:add-outlook-calendargroup-set
Open

Adds command outlook calendargroup set. Closes #7109#7183
MathijsVerbeeck wants to merge 1 commit intopnp:mainfrom
MathijsVerbeeck:add-outlook-calendargroup-set

Conversation

@MathijsVerbeeck
Copy link
Copy Markdown
Contributor

Closes #7109

@MathijsVerbeeck MathijsVerbeeck changed the title Adds command ´outlook calendargroup set´. Closes #7109 Adds command outlook calendargroup set. Closes #7109 Apr 2, 2026
@Adam-it Adam-it self-assigned this Apr 3, 2026
@Adam-it Adam-it requested a review from Copilot April 3, 2026 21:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds the new Microsoft Graph-backed command m365 outlook calendargroup set to update a user’s Outlook calendar group name, including command implementation, tests, and documentation updates to surface it in the CLI docs.

Changes:

  • Implemented outlook calendargroup set command logic (Graph PATCH + lookup by name when needed)
  • Added a comprehensive Mocha test suite covering validation and app-only vs delegated behaviors
  • Documented the command and added it to the Outlook docs sidebar and command name registry

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/m365/outlook/commands/calendargroup/calendargroup-set.ts New command implementation to update a calendar group (by id or name) for me or a specified user
src/m365/outlook/commands/calendargroup/calendargroup-set.spec.ts New test suite covering validation, URL selection logic, scope checks, and error handling
src/m365/outlook/commands.ts Registers the new command name outlook calendargroup set for lazy-loading
docs/src/config/sidebars.ts Adds the command page to the Outlook → calendargroup section in the docs nav
docs/docs/cmd/outlook/calendargroup/calendargroup-set.mdx New documentation page for the command (usage/options/permissions/examples)

Comment on lines +70 to +72
const userIdentifier = args.options.userId ?? args.options.userName;
userUrl = `${this.resource}/v1.0/users('${userIdentifier}')`;
}
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

userIdentifier is interpolated into users('${userIdentifier}') without URL/OData escaping. A valid UPN can contain characters like ' (eg o'connor@contoso.com), which would break the request URL (and can enable crafted path/query injection). Consider using the /users/<id-or-upn> form or encoding the identifier first (eg formatting.encodeQueryParameter(...)).

Copilot uses AI. Check for mistakes.
Comment on lines +88 to +91

const userIdentifier = args.options.userId ?? args.options.userName;
userUrl = `${this.resource}/v1.0/users('${userIdentifier}')`;
}
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

Same issue in delegated mode: userIdentifier is interpolated into users('${userIdentifier}') without escaping. Since userName validation allows characters like ', this can produce invalid URLs or allow crafted inputs to alter the request path. Encode the identifier (eg formatting.encodeQueryParameter) or use the /users/<id-or-upn> style used elsewhere.

Copilot uses AI. Check for mistakes.
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.

New command: outlook calendargroup set

3 participants