Skip to content

Cli oauth auth link#24

Merged
TheSlowpes merged 17 commits into
mainfrom
cli-oauth-auth-link
May 12, 2026
Merged

Cli oauth auth link#24
TheSlowpes merged 17 commits into
mainfrom
cli-oauth-auth-link

Conversation

@TheSlowpes

Copy link
Copy Markdown
Member

This pull request introduces significant improvements to the Zoom CLI's OAuth authorization code flow, enhances the flexibility of meeting and user attribute handling, and adds comprehensive operator documentation for the CLI. The main changes include a new manual OAuth flow for easier authentication testing, improved server binding for OAuth callbacks, refactoring of OAuth-related methods for clarity and reuse, and making several struct fields in the Zoom client optional to better support partial updates and cleaner JSON. Additionally, a detailed skill documentation file is added to guide users in operating the CLI.

OAuth Authorization Flow Improvements:

  • Added a --manual flag to the auth authorization-code command, enabling a manual OAuth flow where users can paste back the callback URL or authorization code, making it easier to test with public redirect URIs or without a local callback server. [1] [2] [3]
  • Introduced a --listen-addr flag to allow the CLI's OAuth callback server to bind to a local address (e.g., localhost:8080), supporting scenarios where the registered redirect URI is public (e.g., via ngrok) but the server should listen locally. [1] [2] [3]
  • Improved user-facing messages to display the correct authorization URL and clarify the callback server address and flow. [1] [2]

OAuth Method Refactoring and Robustness:

  • Refactored the Zoom client OAuth logic by extracting AuthorizationURL and ExchangeAuthorizationCode methods, improving code reuse and clarity. The callback handler now validates the OAuth state and handles errors more gracefully.
  • Added explicit error handling for invalid OAuth state and missing authorization codes, and ensured refresh tokens are stored when present.

Struct Field Flexibility:

  • Made several fields in MeetingAttributes, MeetingUpdateAttributes, and UserAttributes pointers or optional (using omitempty), allowing partial updates and cleaner JSON payloads in create/update operations. [1] [2] [3]

Documentation and Usability:

  • Added a comprehensive SKILL.md for the zoom-cli-operator skill, providing detailed instructions, usage patterns, and best practices for using the Zoom CLI, including authentication, command discovery, and safe operation guidelines.

Most Important Changes:

OAuth Authorization Flow Enhancements:

  • Added --manual and --listen-addr flags to the auth authorization-code command, enabling manual OAuth flows and flexible callback server binding for easier authentication testing and compatibility with public redirect URIs. [1] [2] [3] [4]
  • Improved CLI output and usage examples to guide users through both manual and local callback OAuth flows. [1] [2]

OAuth Client Refactoring and Robustness:

  • Refactored OAuth logic in the client: extracted AuthorizationURL and ExchangeAuthorizationCode methods, improved state validation, and handled errors and refresh tokens more robustly.

Struct Flexibility for API Operations:

  • Made fields in MeetingAttributes, MeetingUpdateAttributes, and UserAttributes optional (pointers or omitempty), supporting partial updates and cleaner JSON in create/update requests. [1] [2] [3]

Documentation Improvements:

  • Added a detailed skills/zoom-cli-operator/SKILL.md file, documenting CLI usage, authentication flows, command discovery, and safe operation guidelines for users and developers.

Copilot AI 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.

Pull request overview

This PR enhances the go-zoom CLI and SDK to make OAuth authorization-code flows easier to test (including a manual paste-back option), allow more flexible callback server binding, and make several meeting/user request attributes optional for cleaner JSON payloads. It also adds operator-focused CLI documentation under skills/.

Changes:

  • Added --manual and --listen-addr options to auth authorization-code, and updated the flow to print the real Zoom authorization URL.
  • Refactored OAuth client logic by extracting AuthorizationURL and ExchangeAuthorizationCode, adding explicit invalid-state handling and refresh token storage.
  • Made various meeting/user request attributes optional (pointers / omitempty) and added skills/zoom-cli-operator/SKILL.md operator documentation.

Reviewed changes

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

Show a summary per file
File Description
cmd/go-zoom/auth.go Adds manual OAuth flow + configurable callback bind address; updates server flow and messaging.
zoom/client/client.go Refactors OAuth into reusable methods; adds state validation error and refresh token persistence.
zoom/client/meeting.go Makes meeting create/update attributes more optional via pointers/omitempty.
zoom/client/user.go Makes Feature optional via pointer for cleaner request payloads.
zoom/models/meetings.go Adds omitempty broadly and converts some nested settings fields to pointers.
skills/zoom-cli-operator/SKILL.md Adds comprehensive CLI operator guidance and usage patterns.
Comments suppressed due to low confidence (1)

cmd/go-zoom/auth.go:114

  • If --redirect-uri has no path (e.g. http://localhost:8080), callbackPath is set to /. The code then registers a callback handler on / and later also registers a separate root handler on /, which will panic due to duplicate ServeMux registrations. Consider requiring a non-empty redirect URI path (e.g. /oauth/callback) or skipping the extra / handler when callbackPath == "/".
	callbackPath := redirectURL.Path
	if callbackPath == "" {
		callbackPath = "/"
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/go-zoom/auth.go
Comment thread cmd/go-zoom/auth.go
Comment thread zoom/models/meetings.go Outdated
Comment thread zoom/client/meeting.go
Comment thread zoom/client/user.go
Agent-Logs-Url: https://github.com/Hawkeye-Claims/go-zoom/sessions/2552f763-0451-4cc4-93b1-9af12d5b6106

Co-authored-by: TheSlowpes <47455257+TheSlowpes@users.noreply.github.com>
@TheSlowpes
TheSlowpes merged commit 02ec6df into main May 12, 2026
2 checks passed
@TheSlowpes
TheSlowpes deleted the cli-oauth-auth-link branch May 12, 2026 21:32
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.

3 participants