Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements a two-tier authorization system for the CHURRO application, adding both authentication and authorization controls on top of the existing SAML SSO integration. The implementation provides global access via eduPersonEntitlement attributes and per-application access via SUNet ID mappings.
Key Changes:
- Middleware-level authorization for routes (dashboard and application pages)
- API authorization wrapper for protecting API endpoints
- Authorization utility functions for checking access permissions
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 21 comments.
Show a summary per file
| File | Description |
|---|---|
| middleware.ts | Implements route-level authorization checks for dashboard and application pages, enforcing access control before page rendering |
| lib/auth-utils.ts | Adds authorization utility functions including global access checks, per-application access validation, and dashboard access control |
| lib/api-auth.ts | New file providing API authorization wrapper and helper functions for protecting API routes with authentication/authorization |
| app/api/acquia/applications/route.ts | Wraps existing API route with authorization check to require authentication before accessing applications data |
| app/api/acquia/views/route.ts | Wraps existing API route with authorization check to require authentication before accessing views metrics |
| app/api/acquia/visits/route.ts | Wraps existing API route with authorization check to require authentication before accessing visits metrics |
| app/applications/page.tsx | Converts to client component with authentication checks, loading states, and error handling for authorization failures |
| app/applications/[uuid]/page.tsx | Adds authorization error handling to detect and display 403 responses with user-friendly error messages |
| app/auth/test/page.tsx | Updates logout handler to support redirectTo parameter for improved test workflow |
| app/api/auth/logout/route.ts | Adds support for redirectTo query parameter with validation to prevent open redirect vulnerabilities |
| docs/SAML.md | Comprehensive documentation of the authorization system including configuration, components, and user experience |
| .github/copilot-instructions.md | Updates AI assistance guidelines with authorization system architecture and usage patterns |
| README.md | Adds authorization environment variables section to main documentation |
| .env.example | Provides example configuration for global entitlements and per-app access mappings |
| .gitignore | Adds .cache directory to ignored files |
Comments suppressed due to low confidence (1)
app/api/acquia/views/route.ts:43
- Inconsistent indentation. The if statement at line 28 should be indented at the same level as the previous if statement at line 20. This appears to be a result of wrapping the function with withApiAuthorization.
if (!process.env.ACQUIA_API_KEY || !process.env.ACQUIA_API_SECRET) {
console.error('❌ Missing required environment variables!');
console.error('Available env vars:', Object.keys(process.env).filter(k => k.startsWith('ACQUIA')));
return NextResponse.json(
{
error: 'Server configuration error: missing API credentials',
envCheck: {
ACQUIA_API_KEY: process.env.ACQUIA_API_KEY ? `${process.env.ACQUIA_API_KEY.substring(0, 8)}...` : 'missing',
ACQUIA_API_SECRET: process.env.ACQUIA_API_SECRET ? 'present' : 'missing',
ACQUIA_API_BASE_URL: process.env.ACQUIA_API_BASE_URL || 'missing',
ACQUIA_AUTH_BASE_URL: process.env.ACQUIA_AUTH_BASE_URL || 'missing'
}
},
{ status: 500 }
);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Implemented in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOT READY FOR REVIEW
Summary
Review By (Date)
Criticality
Review Tasks
Setup tasks and/or behavior to test
Front End Validation
Backend / Functional Validation
Code
Code security
General
Affected Projects or Products
Associated Issues and/or People
@mentionthem here)Resources