-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add build script and enhance OAuth token handling #777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pre-stage
Are you sure you want to change the base?
Conversation
shobhitupadhyayy
commented
Sep 4, 2025
- Introduced a new build.sh script for region selection and OAuth login.
- Added app.json to .gitignore and included manifest.json in API .gitignore.
- Updated package dependencies for improved functionality.
- Implemented saveOAuthToken endpoint for secure token handling.
- Enhanced region configuration and API host management in constants.
- Added error handling and logging improvements in auth service.
- Introduced a new build.sh script for region selection and OAuth login. - Added app.json to .gitignore and included manifest.json in API .gitignore. - Updated package dependencies for improved functionality. - Implemented saveOAuthToken endpoint for secure token handling. - Enhanced region configuration and API host management in constants. - Added error handling and logging improvements in auth service.
There was a problem hiding this comment.
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 introduces OAuth authentication functionality with multi-region support for a Contentstack migration application. It adds comprehensive OAuth token handling, region configuration management, and automated setup workflows.
- Adds OAuth authentication flow with PKCE security implementation
- Introduces multi-region support with automated region selection and configuration
- Implements secure token storage and refresh mechanisms with database persistence
Reviewed Changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
build.sh | New setup script for region selection, OAuth login, and migration execution |
api/sso.utils.js | OAuth configuration utility with multi-region support and app management |
api/src/services/auth.service.ts | Enhanced auth service with OAuth token handling and refresh functionality |
api/src/routes/auth.routes.ts | New OAuth token save endpoint route |
api/src/models/types.ts | Added RefreshTokenResponse interface for OAuth responses |
api/src/controllers/auth.controller.ts | New controller method for OAuth token handling |
api/src/constants/index.ts | Regional API host configurations for OAuth endpoints |
api/package.json | Updated dependencies including marketplace SDK and express-session |
api/.gitignore | Added manifest.json to ignored files |
.talismanrc | Updated security scan configuration with new file checksums |
Files not reviewed (1)
- api/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
api/src/services/auth.service.ts:1
- The openBrowser function is called but not defined or imported. This will cause a runtime error.
import { Request } from "express";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…cies - Removed redundant variables for client_id and client_secret in saveOAuthToken function. - Updated logging to use a centralized logger instead of console methods. - Removed unnecessary deletion of code_verifier from the request session. - Updated package.json to remove outdated "api" dependency.
- Modified build.sh to append '/v2/auth/save-token' to the redirect_uri. - Updated auth.service.ts to use the correct redirect_uri for token requests. - Ensured consistency in region configuration and API endpoint handling.