Compare commits

...

9 Commits

Author SHA1 Message Date
dependabot[bot] bb9aa6b55d Bump vite-plus from 0.1.20 to 0.1.24
Bumps [vite-plus](https://github.com/voidzero-dev/vite-plus/tree/HEAD/packages/cli) from 0.1.20 to 0.1.24.
- [Release notes](https://github.com/voidzero-dev/vite-plus/releases)
- [Commits](https://github.com/voidzero-dev/vite-plus/commits/v0.1.24/packages/cli)

---
updated-dependencies:
- dependency-name: vite-plus
  dependency-version: 0.1.24
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-15 18:00:23 +00:00
Gregory Schier 3de9a1edd4 Persist response filter per request 2026-06-11 09:09:12 -07:00
Gregory Schier 1b28dfd9d1 Actually fix overflowing text when Input has right slot items 2026-06-03 12:44:33 -07:00
Saverio Cannone 9f51c61447 Fix: long model names overflowing in delete dialog (#468) 2026-05-26 23:16:50 -07:00
zPush b17ccbeebe Fix: Secret input field texts were bleeding under obscure toggle button (#461)
Co-authored-by: Gregory Schier <gschier1990@gmail.com>
2026-05-21 09:36:20 -07:00
Jeroen van der Merwe 463cc6f5a3 feat: Extract authentication when using the cURL importer (#423) 2026-05-21 09:00:22 -07:00
dependabot[bot] 1307ea4e67 Bump ws from 8.19.0 to 8.20.1 (#464)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-21 07:58:42 -07:00
dependabot[bot] 710b8e34ac Bump postcss from 8.5.6 to 8.5.14 (#449)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-21 07:26:54 -07:00
Stijn Brouwers f251772a4a feat(cookies): Allow manually adding cookies to the cookiejar (#457)
Co-authored-by: Stijn BROUWERS <stijn.brouwers@ext.ec.europa.eu>
2026-05-20 07:43:03 -07:00
11 changed files with 881 additions and 266 deletions
+3 -3
View File
@@ -290,10 +290,10 @@ function BaseInput({
<HStack
className={classNames(
inputWrapperClassName,
"w-full min-w-0 px-2",
"flex-1 min-w-0 px-2",
fullHeight && "h-full",
leftSlot ? "pl-0.5 -ml-2" : null,
rightSlot ? "pr-0.5 -mr-2" : null,
leftSlot ? "pl-0" : null,
rightSlot ? "pr-0" : null,
)}
>
<Editor
@@ -69,6 +69,7 @@ function HttpTextViewer({ response, text, language, pretty, className }: HttpTex
text={text}
language={language}
stateKey={`response.body.${response.id}`}
filterStateKey={`response.body.${response.requestId}`}
pretty={pretty}
className={className}
onFilter={filterCallback}
@@ -16,6 +16,7 @@ interface Props {
text: string;
language: EditorProps["language"];
stateKey: string | null;
filterStateKey?: string | null;
pretty?: boolean;
className?: string;
onFilter?: (filter: string) => {
@@ -27,16 +28,25 @@ interface Props {
const useFilterText = createGlobalState<Record<string, string | null>>({});
export function TextViewer({ language, text, stateKey, pretty, className, onFilter }: Props) {
export function TextViewer({
language,
text,
stateKey,
filterStateKey,
pretty,
className,
onFilter,
}: Props) {
const filterKey = filterStateKey ?? stateKey;
const [filterTextMap, setFilterTextMap] = useFilterText();
const filterText = stateKey ? (filterTextMap[stateKey] ?? null) : null;
const filterText = filterKey ? (filterTextMap[filterKey] ?? null) : null;
const debouncedFilterText = useDebouncedValue(filterText);
const setFilterText = useCallback(
(v: string | null) => {
if (!stateKey) return;
setFilterTextMap((m) => ({ ...m, [stateKey]: v }));
if (!filterKey) return;
setFilterTextMap((m) => ({ ...m, [filterKey]: v }));
},
[setFilterTextMap, stateKey],
[filterKey, setFilterTextMap],
);
const isSearching = filterText != null;
@@ -64,7 +74,7 @@ export function TextViewer({ language, text, stateKey, pretty, className, onFilt
nodes.push(
<div key="input" className="w-full !opacity-100">
<Input
key={stateKey ?? "filter"}
key={filterKey ?? "filter"}
validate={!filteredResponse.error}
hideLabel
autoFocus
@@ -76,7 +86,7 @@ export function TextViewer({ language, text, stateKey, pretty, className, onFilt
defaultValue={filterText}
onKeyDown={(e) => e.key === "Escape" && toggleSearch()}
onChange={setFilterText}
stateKey={stateKey ? `filter.${stateKey}` : null}
stateKey={filterKey ? `filter.${filterKey}` : null}
/>
</div>,
);
@@ -97,12 +107,12 @@ export function TextViewer({ language, text, stateKey, pretty, className, onFilt
return nodes;
}, [
canFilter,
filterKey,
filterText,
filteredResponse.error,
filteredResponse.isPending,
isSearching,
language,
stateKey,
setFilterText,
toggleSearch,
]);
@@ -35,10 +35,15 @@ export async function deleteModelWithConfirm(
<>
the following?
<Prose className="mt-2">
<ul>
<ul className="space-y-1">
{models.map((m) => (
<li key={m.id}>
<InlineCode>{resolvedModelName(m)}</InlineCode>
<InlineCode
className="inline-block truncate align-bottom max-w-full"
title={resolvedModelName(m)}
>
{resolvedModelName(m)}
</InlineCode>
</li>
))}
</ul>
+2 -2
View File
@@ -98,7 +98,7 @@
"babel-plugin-react-compiler": "^1.0.0",
"decompress": "^4.2.1",
"internal-ip": "^8.0.0",
"postcss": "^8.5.6",
"postcss": "^8.5.14",
"postcss-nesting": "^13.0.2",
"rollup": "^4.60.3",
"tailwindcss": "^3.4.17",
@@ -107,6 +107,6 @@
"vite-plugin-svgr": "^4.5.0",
"vite-plugin-top-level-await": "^1.5.0",
"vite-plugin-wasm": "^3.5.0",
"vite-plus": "^0.1.20"
"vite-plus": "^0.1.24"
}
}
+1 -1
View File
@@ -32,6 +32,6 @@
"babel-plugin-react-compiler": "^1.0.0",
"typescript": "^5.8.3",
"vite": "npm:@voidzero-dev/vite-plus-core@^0.1.20",
"vite-plus": "^0.1.20"
"vite-plus": "^0.1.24"
}
}
+618 -242
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -121,7 +121,7 @@
"npm-run-all": "^4.1.5",
"typescript": "^5.8.3",
"vite": "npm:@voidzero-dev/vite-plus-core@^0.1.20",
"vite-plus": "^0.1.20",
"vite-plus": "^0.1.24",
"vitest": "npm:@voidzero-dev/vite-plus-test@^0.1.20"
},
"overrides": {
+1 -1
View File
@@ -6,7 +6,7 @@
"build:main": "esbuild src/index.ts --bundle --platform=node --outfile=../../crates-tauri/yaak-app-client/vendored/plugin-runtime/index.cjs"
},
"dependencies": {
"ws": "^8.18.0"
"ws": "^8.20.1"
},
"devDependencies": {
"@types/ws": "^8.5.13"
+93 -6
View File
@@ -181,6 +181,78 @@ export function convertCurl(rawData: string) {
};
}
interface ExtractedAuthentication {
authenticationType: string | null;
authentication: Record<string, string>;
filteredHeaders: HttpUrlParameter[]; // headers without authorization
}
function extractAuthenticationFromHeaders(headers: HttpUrlParameter[]): ExtractedAuthentication {
const authorizationHeaderIndex = headers.findIndex(
(h) => h.name.toLowerCase() === "authorization",
);
const authorizationHeader = headers[authorizationHeaderIndex];
if (authorizationHeader == null) {
return {
authenticationType: null,
authentication: {},
filteredHeaders: headers,
};
}
const value = authorizationHeader.value.trim();
const spaceIndex = value.indexOf(" ");
if (spaceIndex <= 0) {
return {
authenticationType: null,
authentication: {},
filteredHeaders: headers,
};
}
const scheme = value.slice(0, spaceIndex).toLowerCase();
const credentials = value.slice(spaceIndex + 1).trim();
// Bearer authentication (RFC 6750)
if (scheme === "bearer") {
const filteredHeaders = headers.filter((_, i) => i !== authorizationHeaderIndex);
return {
authenticationType: "bearer",
authentication: { token: credentials, prefix: "Bearer" },
filteredHeaders,
};
}
// Basic authentication (RFC 7617)
if (scheme === "basic") {
try {
const decoded = Buffer.from(credentials, "base64").toString();
const colonIndex = decoded.indexOf(":");
if (colonIndex > 0) {
const filteredHeaders = headers.filter((_, i) => i !== authorizationHeaderIndex);
return {
authenticationType: "basic",
authentication: {
username: decoded.slice(0, colonIndex),
password: decoded.slice(colonIndex + 1),
},
filteredHeaders,
};
}
} catch {
// Invalid base64, keep header as-is
}
}
return {
authenticationType: null,
authentication: {},
filteredHeaders: headers,
};
}
function importCommand(parseEntries: string[], workspaceId: string) {
// ~~~~~~~~~~~~~~~~~~~~~ //
// Collect all the flags //
@@ -323,8 +395,23 @@ function importCommand(parseEntries: string[], workspaceId: string) {
});
}
// Extract authentication from Authorization headers (Bearer/Basic)
const {
authenticationType: extractedAuthenticationType,
authentication: extractedAuthentication,
filteredHeaders,
} = extractAuthenticationFromHeaders(headers);
// Use extracted authentication from header if found, otherwise fall back to -u/--user parsing
const finalAuthenticationType = extractedAuthenticationType || authenticationType;
const finalAuthentication = extractedAuthenticationType
? extractedAuthentication
: authentication;
// Body (Text or Blob)
const contentTypeHeader = headers.find((header) => header.name.toLowerCase() === "content-type");
const contentTypeHeader = filteredHeaders.find(
(header) => header.name.toLowerCase() === "content-type",
);
const mimeType = contentTypeHeader ? contentTypeHeader.value.split(";")[0]?.trim() : null;
// Extract boundary from Content-Type header for multipart parsing
@@ -398,7 +485,7 @@ function importCommand(parseEntries: string[], workspaceId: string) {
value: decodeURIComponent(parameter.value || ""),
})),
};
headers.push({
filteredHeaders.push({
name: "Content-Type",
value: "application/x-www-form-urlencoded",
enabled: true,
@@ -419,7 +506,7 @@ function importCommand(parseEntries: string[], workspaceId: string) {
form: formDataParams,
};
if (mimeType == null) {
headers.push({
filteredHeaders.push({
name: "Content-Type",
value: "multipart/form-data",
enabled: true,
@@ -442,9 +529,9 @@ function importCommand(parseEntries: string[], workspaceId: string) {
urlParameters,
url,
method,
headers,
authentication,
authenticationType,
headers: filteredHeaders,
authentication: finalAuthentication,
authenticationType: finalAuthenticationType,
body,
bodyType,
folderId: null,
+136
View File
@@ -332,6 +332,142 @@ describe("importer-curl", () => {
});
});
test("Imports Bearer token from Authorization header", () => {
expect(convertCurl('curl -H "Authorization: Bearer token123" https://yaak.app')).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: "https://yaak.app",
authenticationType: "bearer",
authentication: {
token: "token123",
prefix: "Bearer",
},
headers: [],
}),
],
},
});
});
test("Trims whitespace before Bearer token from Authorization header", () => {
expect(convertCurl('curl -H "Authorization: Bearer token123" https://yaak.app')).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: "https://yaak.app",
authenticationType: "bearer",
authentication: {
token: "token123",
prefix: "Bearer",
},
headers: [],
}),
],
},
});
});
test("Imports Basic auth from Authorization header (base64 decoded)", () => {
expect(
convertCurl('curl -H "Authorization: Basic dXNlcjpwYXNzd29yZA==" https://yaak.app'),
).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: "https://yaak.app",
authenticationType: "basic",
authentication: {
username: "user",
password: "password",
},
headers: [],
}),
],
},
});
});
test("Authorization header takes precedence over -u flag", () => {
expect(
convertCurl('curl -u admin:secret -H "Authorization: Bearer token123" https://yaak.app'),
).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: "https://yaak.app",
authenticationType: "bearer",
authentication: {
token: "token123",
prefix: "Bearer",
},
headers: [],
}),
],
},
});
});
test("Authorization header extraction is case-insensitive", () => {
expect(convertCurl('curl -H "authorization: bearer lowercaseToken" https://yaak.app')).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: "https://yaak.app",
authenticationType: "bearer",
authentication: {
token: "lowercaseToken",
prefix: "Bearer",
},
headers: [],
}),
],
},
});
});
test("Preserves other headers when extracting Authorization", () => {
expect(
convertCurl('curl -H "Authorization: Bearer token123" -H "X-Custom: value" https://yaak.app'),
).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: "https://yaak.app",
authenticationType: "bearer",
authentication: {
token: "token123",
prefix: "Bearer",
},
headers: [{ name: "X-Custom", value: "value", enabled: true }],
}),
],
},
});
});
test("Invalid base64 in Basic auth keeps header in headers", () => {
expect(
convertCurl('curl -H "Authorization: Basic not-valid-base64!!!" https://yaak.app'),
).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: "https://yaak.app",
headers: [{ name: "Authorization", value: "Basic not-valid-base64!!!", enabled: true }],
}),
],
},
});
});
test("Imports cookie as header", () => {
expect(convertCurl('curl --cookie "foo=bar" https://yaak.app')).toEqual({
resources: {