diff --git a/spec/feature-auth.md b/spec/feature-auth.md new file mode 100644 index 0000000..0f016ed --- /dev/null +++ b/spec/feature-auth.md @@ -0,0 +1,76 @@ +# Feature Request: Authentication Support + +**Context:** +We are upgrading the "LiteRequest" Tauri + Vue application. Currently, it supports Headers, Params, and Body. +**Goal:** Add a dedicated **"Auth"** tab in the Request Configuration area to support common authentication methods. + +## 1. Functional Requirements + +### 1.1 Supported Auth Types +The user should be able to select one of the following from a dropdown: +1. **No Auth** (Default) +2. **Basic Auth**: Inputs for `Username` and `Password`. +3. **Bearer Token**: Input for `Token` (e.g., JWT). +4. **API Key**: Inputs for `Key`, `Value`, and a selection for `Add To` ("Header" or "Query Params"). + +### 1.2 State Management +* Update `stores/requestStore.ts` to include an `auth` state object. +* **Structure:** + ```typescript + state: { + // ... existing state + auth: { + type: 'none', // 'none' | 'basic' | 'bearer' | 'api_key' + basic: { username: '', password: '' }, + bearer: { token: '' }, + apiKey: { key: '', value: '', addTo: 'header' } // addTo: 'header' | 'query' + } + } + ``` +* **Persistence:** These values should be saved to `localStorage` along with the request history (careful note: in a real app we would encrypt this, but for this local MVP, plain text storage is acceptable). + +## 2. UI/UX Design + +### 2.1 Request Panel Update +* In `RequestPanel.vue`, add a new Tab labeled **"Auth"** (place it first, before "Params"). +* **Layout:** + * **Type Selector:** A styled `