Conversation
|
@claude see suggestions above and apply, make sure lint and build are green. |
|
Claude finished @rebelchris's task in 5m 19s —— View job Security Fixes Applied
Summary of changes
Lint and build will be verified by CI on the pushed commit. |
|
🍹 The Update (preview) for dailydotdev/api/prod (at cdb7ba5) was successful. ✨ Neo ExplanationThis is a standard application version rollout deploying a new build across all API services, with accompanying DB and ClickHouse schema migrations. It also introduces a new scheduled job to clean up expired Better Auth sessions.Root Cause AnalysisA new version of the API application has been built and is being deployed. All services are being updated to run the new container image, and two new one-off migration jobs are being created to upgrade the database and ClickHouse schemas for the new version. Additionally, a brand-new CronJob ( Dependency ChainThe new container image version cascades uniformly across the entire workload fleet:
Risk AnalysisNo stateful resources (databases, storage buckets, persistent volumes) are being replaced or deleted. The migration jobs are ephemeral one-shot Kubernetes Jobs, which is the standard pattern here. The rolling update strategy on Deployments prevents downtime during the image swap. Resource Changes Name Type Operation
~ vpc-native-clean-gifted-plus-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-tag-recommendations-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-analytics-history-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generic-referral-reminder-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-stale-user-transactions-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-images-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-analytics-history-day-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-validate-active-users-cron kubernetes:batch/v1:CronJob update
~ vpc-native-personalized-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-current-streak-cron kubernetes:batch/v1:CronJob update
~ vpc-native-expire-super-agent-trial-cron kubernetes:batch/v1:CronJob update
~ vpc-native-sync-subscription-with-cio-cron kubernetes:batch/v1:CronJob update
~ vpc-native-calculate-top-readers-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-user-companies-cron kubernetes:batch/v1:CronJob update
~ vpc-native-daily-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-post-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-squad-posts-analytics-refresh-cron kubernetes:batch/v1:CronJob update
~ vpc-native-worker-job-deployment kubernetes:apps/v1:Deployment update
+ vpc-native-api-db-migration-7ec47bfc kubernetes:batch/v1:Job create
~ vpc-native-hourly-notification-cron kubernetes:batch/v1:CronJob update
+ vpc-native-clean-expired-better-auth-sessions-cron kubernetes:batch/v1:CronJob create
~ vpc-native-update-highlighted-views-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-source-public-threshold-cron kubernetes:batch/v1:CronJob update
~ vpc-native-generate-search-invites-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-updated-sync-cron kubernetes:batch/v1:CronJob update
~ vpc-native-clean-zombie-opportunities-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-posts-analytics-refresh-cron kubernetes:batch/v1:CronJob update
+ vpc-native-api-clickhouse-migration-7ec47bfc kubernetes:batch/v1:Job create
~ vpc-native-personalized-digest-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-update-trending-cron kubernetes:batch/v1:CronJob update
~ vpc-native-user-profile-analytics-clickhouse-cron kubernetes:batch/v1:CronJob update
~ vpc-native-temporal-deployment kubernetes:apps/v1:Deployment update
~ vpc-native-private-deployment kubernetes:apps/v1:Deployment update
- vpc-native-api-clickhouse-migration-141ec448 kubernetes:batch/v1:Job delete
~ vpc-native-bg-deployment kubernetes:apps/v1:Deployment update
- vpc-native-api-db-migration-141ec448 kubernetes:batch/v1:Job delete
~ vpc-native-agents-digest-cron kubernetes:batch/v1:CronJob update
~ vpc-native-check-analytics-report-cron kubernetes:batch/v1:CronJob update
~ vpc-native-update-achievement-rarity-cron kubernetes:batch/v1:CronJob update
... and 6 other changes |
- Remove userId from log calls in betterAuthBridge.ts to prevent clear-text logging of sensitive identifiers (CodeQL 43, 44) - Replace backtracking-prone email regex with safe string checks to prevent ReDoS vulnerability (CodeQL 50) - Apply rate limiting to all paths in wildcard /auth/* handler not just sign-up/sign-in (CodeQL 49) - Remove debug logging that exposed OTP values and verification data in plain text Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
@claude which of your concerns/improvements are still valid? |
|
Claude finished @rebelchris's task in 1m 13s —— View job Status Review of Previous Concerns
✅ Resolved
|
|
@claude fix this issue about ratelimitting it should apply it. |
|
Claude finished @rebelchris's task in 44s —— View job Rate Limiting Fix for Social Redirect Routes
SummaryAdded The two routes |
Co-authored-by: Chris Bongers <rebelchris@users.noreply.github.com>
| betterAuthSession: { | ||
| key: 'better-auth.session_token', |
There was a problem hiding this comment.
is this naming theirs or? thinking could be named generic but not blocking
There was a problem hiding this comment.
It's ours, but guess it needs to be unique to not collide with Kratos for example, think this is fine no?
There was a problem hiding this comment.
think I would not name it better auth, its clunky to name 3party products in first party cookies, but yeah its not crucial or if it adds a lot of stuff for you to retest
| employmentAgreementBucketName: adhoc-daily-api | ||
| brokkrOrigin: http://brokkr-grpc:50051 | ||
| mockExternalServices: true | ||
| betterAuthSecret: |
| @@ -0,0 +1,3 @@ | |||
| export const createAuthMiddleware = ( | |||
There was a problem hiding this comment.
why we have so many new mock files instead of just one with all the helpers?
There was a problem hiding this comment.
I think because of how they import they prefer file based overwrites I've had this issue before with feature ones.
| @@ -0,0 +1,100 @@ | |||
| import type { FastifyReply, FastifyRequest } from 'fastify'; | |||
|
|
|||
| export const getClientIp = (request: FastifyRequest): string => | |||
There was a problem hiding this comment.
We actually don't have this with x-forwarded-for test
| @@ -0,0 +1,100 @@ | |||
| import type { FastifyReply, FastifyRequest } from 'fastify'; | |||
There was a problem hiding this comment.
I'd just double check we're not introducing existing utilities here
| const isSignUpEmailPath = (request: FastifyRequest): boolean => | ||
| request.method === 'POST' && request.url.includes('/auth/sign-up/email'); | ||
|
|
||
| const isSignInEmailPath = (request: FastifyRequest): boolean => |
There was a problem hiding this comment.
doesn't ba should take care of this?
There was a problem hiding this comment.
It's for global rate limitting and turnstile though
Which part do you mean exactly?
No description provided.