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
Thomas/event service #525
base: main
Are you sure you want to change the base?
Thomas/event service #525
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
7 Ignored Deployments
|
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.
Some changes! Also make sure you pull again because I just merged from main
@@ -36,6 +36,10 @@ export const getEnv = () => { | |||
RSVPForm: { | |||
ResumeStorageBucketName: 'rsvp-resume-hacker-2023', | |||
}, | |||
EventService: { | |||
authServiceUrl: process.env.EVENT_AUTH_SERVICE_URL, |
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.
Would be better to put authServiceUrl outside the EventService since it is shared between this and Podium
(path.pathname === '/api/events' && method === 'GET') || | ||
// has {user_id} in path | ||
(path.pathname.startsWith('/api/events/') && | ||
path.pathname.split('/').length === 3 && |
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.
I think path.pathname.split('/').length
should be 4 instead of 3 if you're trying to match for /api/events/[eventId]
request.nextUrl.pathname = '/api/error'; | ||
return NextResponse.redirect(request.nextUrl); | ||
} | ||
} |
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.
Should also handle case where regular user is trying to access admin-only endpoints
|
||
async function get(req: NextApiRequest, res: NextApiResponse) { | ||
let { event_id } = req.query; | ||
const isAdmin = true; |
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.
Let's just set isAdmin to false since that's what it was originally
req: NextApiRequest, | ||
res: NextApiResponse | ||
) { | ||
let event_id = req.query.event_id; |
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.
Should check method == GET
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.
Maybe remove? Along with styles.css, nx-welcome.tsx and other starter files
@@ -24,7 +24,7 @@ import { getEnv } from '@hibiscus/env'; | |||
|
|||
@injectable() | |||
export class HibiscusSupabaseClient { | |||
private client: SupabaseClient; | |||
private client: SupabaseClient<'events'>; |
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.
I think should probably revert this change? Since you're calling createClient from supabase-js directly in the repository.ts now.
query = query.gte('end_time', after.toISOString()); | ||
} | ||
|
||
query.order('start_time', { ascending: false }); |
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.
Start time should be ordered ascending = true
endTime: data.end_time, | ||
location: data.location, | ||
description: data.description, | ||
eventTags: data.event_tags, |
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.
eventTags and industryTags should be mapped to a list of string of the tag (same for /getEvents), currently returns entire tag object
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
9632465 | Triggered | Generic Password | 6c0d9b4 | apps/event-service/configs/env.local.yml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
Description
Before pushing to Prod
EVENT_AUTH_SERVICE_URL
andEVENT_MASTER_TOKEN
env variablesBattlepass