feat: validate API auth type field with enum instead of bare string
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 78/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- api, authentication
Research direction
Start in src/types/config.ts and inspect apiAuthSchema, including how its type field is consumed. Done means the schema accepts apiKey, bearer, and basic while rejecting other values; check the surrounding configuration validation or existing schema tests if present.
Written by the indexing model from the issue text.
Description
Problem
In `src/types/config.ts`, the API auth schema uses a bare string for the `type` field:
```ts
const apiAuthSchema = z.object({
type: z.string(), // no validation
header: z.string(),
placeholder: z.string().optional(),
})
```
Typos like `apikey` instead of `apiKey`, or `bearer-token` instead of `bearer`, only fail at runtime when the playground tries to construct auth headers.
Suggested Fix
```ts
const apiAuthSchema = z.object({
type: z.enum(['apiKey', 'bearer', 'basic']),
header: z.string(),
placeholder: z.string().optional(),
})
```
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 1
- Avg merge
- 12h 29m
- Merged PRs (30d)
- 12
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raystack/chronicle
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 4/5 3-5 days Newbie friendliness 65/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in raystack/chronicle
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
TanStack/tanstack.com#1293 ·