Skip to content

Commit d0cf1b2

Browse files
committed
0.10.0
1 parent 015dce9 commit d0cf1b2

File tree

6 files changed

+2
-122
lines changed

6 files changed

+2
-122
lines changed

TODO.md

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -97,77 +97,6 @@ tempDiv.innerHTML = `
9797

9898
## MEDIUM SECURITY ISSUES
9999

100-
### 4. Placeholder Webhook URL
101-
102-
**Severity**: MEDIUM
103-
**Location**: `src/constant.ts:8`
104-
105-
```typescript
106-
webhook_url: "https://webhook.site/your-webhook-endpoint" // Replace with actual webhook endpoint
107-
```
108-
109-
**Issue**: Placeholder webhook URL is checked into source code.
110-
111-
**Impact**:
112-
- If not replaced, webhooks will fail silently or leak data to webhook.site
113-
- Webhook.site is a public service where anyone can view requests
114-
- Sensitive job description data could be exposed
115-
116-
**Solution**:
117-
- [ ] Move webhook URL to environment variable
118-
- [ ] Set up actual webhook endpoint
119-
- [ ] Add validation to ensure webhook URL is properly configured
120-
- [ ] Consider webhook authentication/signing
121-
122-
---
123-
124-
### 5. Missing Environment Variable Configuration
125-
126-
**Severity**: MEDIUM
127-
**Location**: Project-wide
128-
129-
**Issue**: No environment variables are used. All configuration is hardcoded in `src/constant.ts`.
130-
131-
**Impact**:
132-
- Cannot have different configs for dev/staging/production
133-
- Secrets are exposed in git history forever
134-
- Makes it difficult to rotate keys or update endpoints
135-
136-
**Current hardcoded values**:
137-
- `directus_url`: Should support different environments
138-
- `directus_key`: MUST be in environment variables
139-
- `guest_user_id`: Should be in environment variables
140-
- `auth_idp_key`: Could be environment-specific
141-
- `auth_idp_logput_url`: Could be environment-specific
142-
- `webhook_url`: MUST be in environment variables
143-
- `onboarding_form_url`: Could be environment-specific
144-
145-
**Solution**:
146-
- [ ] Create `.env.example` file with all required variables
147-
- [ ] Add `.env` to `.gitignore` (already missing)
148-
- [ ] Update Astro config to load environment variables
149-
- [ ] Refactor `src/constant.ts` to use `import.meta.env.*`
150-
- [ ] Update deployment workflows to inject environment variables
151-
- [ ] Document all required environment variables in README
152-
153-
Example `.env.example`:
154-
```env
155-
# Directus Configuration
156-
PUBLIC_DIRECTUS_URL=https://directus.bounteer.com
157-
DIRECTUS_GUEST_TOKEN=your-guest-token-here
158-
DIRECTUS_GUEST_USER_ID=your-guest-user-id
159-
160-
# Authentication
161-
PUBLIC_AUTH_IDP_KEY=logto
162-
PUBLIC_AUTH_LOGOUT_URL=https://logto-app.bounteer.com/oidc/session/end
163-
164-
# Integrations
165-
WEBHOOK_URL=https://your-webhook-endpoint.com
166-
PUBLIC_ONBOARDING_FORM_URL=https://form.typeform.com/to/FOz4fXGm
167-
```
168-
169-
---
170-
171100
### 6. Contact Form Without Authentication
172101

173102
**Severity**: MEDIUM
@@ -226,48 +155,6 @@ const res = await fetch(`${EXTERNAL.directus_url}/items/message`, {
226155

227156
---
228157

229-
## LOW SECURITY ISSUES
230-
231-
### 8. TODO Comment About Authentication
232-
233-
**Severity**: LOW
234-
**Location**: `src/lib/utils.ts:316`
235-
236-
```typescript
237-
// TODO check if we are ussing the logged in user's session or a generic guest token
238-
```
239-
240-
**Issue**: Uncertainty about authentication mechanism.
241-
242-
**Solution**:
243-
- [ ] Review and document authentication flow
244-
- [ ] Clarify when session cookies vs guest token should be used
245-
- [ ] Update code comments with clear explanation
246-
247-
---
248-
249-
### 9. Missing .env File Configuration
250-
251-
**Severity**: LOW
252-
**Location**: `.gitignore:1-5`
253-
254-
**Issue**: `.gitignore` doesn't explicitly include `.env*` files (though no .env files currently exist).
255-
256-
**Current .gitignore**:
257-
```
258-
/.astro
259-
/node_modules
260-
.DS_Store
261-
/dist
262-
```
263-
264-
**Solution**:
265-
- [ ] Add `.env` and `.env.*` to `.gitignore`
266-
- [ ] Add `*.env.local` pattern
267-
- [ ] Ensure `.env.example` is NOT ignored
268-
269-
---
270-
271158
## RECOMMENDATIONS
272159

273160
### Immediate Actions Required

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@bounteer/page",
33
"type": "module",
4-
"version": "0.9.0",
4+
"version": "0.10.0",
55
"private": true,
66
"scripts": {
77
"dev": "astro dev",

src/components/interactive/RoleFitIndexForm.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ export default function RoleFitForm() {
204204
const filter = `filter[user_created][id][_eq]=${encodeURIComponent(userId)}`;
205205
const url = `${DIRECTUS_URL}/items/role_fit_index_submission?${fields}&${filter}&sort[]=-date_created&limit=1`;
206206

207-
// TODO the auth header is not using hte logged in user currently (using generic)
208207
const res = await fetch(url, {
209208
credentials: "include",
210209
headers: getAuthHeaders(me),
@@ -645,7 +644,7 @@ export default function RoleFitForm() {
645644
case "update":
646645
console.log("Record updated:", rec);
647646
if (!rec || String(rec.id) !== String(id)) return;
648-
// TODO check status
647+
649648
console.log("received:" + rec);
650649
// Handle status updates
651650
if (rec.status) {

src/components/interactive/TopUpCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ export default function TopUpCard({
143143

144144
});
145145

146-
// todo failed to fetch below
147146
const res = await fetch(`${webhookUrl}?${params.toString()}`, {
148147
method: "POST",
149148
});

src/lib/utils.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ export async function loadCredits(directusUrl: string): Promise<{
318318
credits: Credits;
319319
}> {
320320
try {
321-
// Check if user is logged in
322321
const user = await getUserProfile(directusUrl);
323322

324323
if (!user) {
@@ -349,8 +348,6 @@ export async function loadCredits(directusUrl: string): Promise<{
349348
}
350349
}
351350

352-
// TODO check if we are ussing the logged in user's session or a generic guest token
353-
// Helper function to get authorization headers
354351
export function getAuthHeaders(user: UserProfile | null = null): Record<string, string> {
355352
return user !== null
356353
? {} // No auth header needed for authenticated users (using session cookies)

src/pages/logout.astro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
}
5454
}
5555

56-
// TODO check how I can enforce react client hyration
57-
// Execute logout when page loads
5856
if (typeof window !== "undefined") {
5957
performLogout();
6058
}

0 commit comments

Comments
 (0)