mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-07 14:08:38 +00:00
* feat: add OAuth 1.0 authentication support Add full OAuth 1.0 (RFC 5849) authentication with support for HMAC-SHA1/256/512, RSA-SHA1/256/512, and PLAINTEXT signature methods. Includes UI components, bru/yml serialization, Postman import, code generation, CLI support, and comprehensive playwright and unit tests. * test: replace real-looking PEM literals with fake markers in oauth1 tests Avoid tripping secret scanners by using obviously fake BEGIN/END markers and non-sensitive base64 content in serialization and round-trip tests. * fix: remove invalid OAuth1 placeholder header from code generator OAuth1 requires runtime-computed nonce, timestamp, and signature that cannot be pre-computed for a static code snippet. Return an empty array instead of emitting an Authorization header with literal <signature>, <timestamp>, <nonce> placeholders. * fix: remove unreachable oauth1 case from WSAuth component The oauth1 switch branch was dead code since it was not in supportedAuthModes and the useEffect would reset it to 'none' before it could render. * fix: remove unused collectionPath param and use path.basename for filename extraction * refactor: rename OAuth1 fields for clarity - tokenSecret → accessTokenSecret - signatureMethod → signatureEncoding - addParamsTo value 'queryparams' → 'query' * refactor: rename addParamsTo to placement in OAuth1 auth * fix: add missing oauth1: null in buildOAuth2Config and upgrade @opencollection/types to 0.9.0 * test: add oauth1 import tests and fix missing oauth1: null in auth assertions * ci: add auth playwright tests workflow for Linux, macOS, and Windows * refactor: rename signatureEncoding to signatureMethod and fix timeline race condition - Rename OAuth1 signatureEncoding to signatureMethod across all packages - Fix timeline showing "No Headers/Body found" when request-sent IPC event arrives after response by retroactively updating the timeline entry - Store requestUid in timeline entries for precise matching - Correct timeline entry timestamp on retroactive update for proper sort order * ci: add OAuth1 CLI tests and reorganize auth actions under oauth1/ - Add CLI tests that run full BRU and YML collections via bru run - Add start-test-server actions for Linux, macOS, and Windows - Move auth e2e and setup actions under auth/oauth1/ directory - Fix Windows Playwright failures caused by unescaped backslashes in collectionPath template variable * ci: reorder auth tests to run E2E tests before CLI tests * ci: start test server after E2E tests to fix port 8081 conflict
bruno-converters
The converters package is responsible for converting collections from one format to a Bruno collection. It can be used as a standalone package or as a part of the Bruno framework.
Installation
npm install @usebruno/converters
Usage
Convert Postman collection to Bruno collection
const { postmanToBruno } = require('@usebruno/converters');
// Convert Postman collection to Bruno collection
const brunoCollection = postmanToBruno(postmanCollection);
Convert Postman Environment to Bruno Environment
const { postmanToBrunoEnvironment } = require('@usebruno/converters');
const brunoEnvironment = postmanToBrunoEnvironment(postmanEnvironment);
Convert Insomnia collection to Bruno collection
const { insomniaToBruno } = require('@usebruno/converters');
const brunoCollection = insomniaToBruno(insomniaCollection);
Convert OpenAPI specification to Bruno collection
const { openApiToBruno } = require('@usebruno/converters');
const brunoCollection = openApiToBruno(openApiSpecification);
Convert WSDL file to Bruno collection
import { wsdlToBruno } from '@usebruno/converters';
const brunoCollection = await wsdlToBruno(wsdlContent);
Example
const { postmanToBruno } = require('@usebruno/converters');
const fs = require('fs/promises');
const path = require('path');
async function convertPostmanToBruno(inputFile, outputFile) {
try {
// Read Postman collection file
const inputData = await fs.readFile(inputFile, 'utf8');
// Convert to Bruno collection
const brunoCollection = await postmanToBruno(JSON.parse(inputData));
// Save Bruno collection
await fs.writeFile(outputFile, JSON.stringify(brunoCollection, null, 2));
console.log('Conversion successful!');
} catch (error) {
console.error('Error during conversion:', error);
}
}
// Usage
const inputFilePath = path.resolve(__dirname, 'demo_collection.postman_collection.json');
const outputFilePath = path.resolve(__dirname, 'bruno-collection.json');
convertPostmanToBruno(inputFilePath, outputFilePath);
WSDL Import Features
The WSDL importer supports the following features:
- Service Discovery: Automatically extracts service endpoints from WSDL definitions
- Operation Mapping: Converts WSDL operations to Bruno HTTP requests
- SOAP Envelope Generation: Creates proper SOAP envelopes for each operation
- Header Configuration: Sets up appropriate Content-Type and SOAPAction headers
- Environment Variables: Creates environment variables for service base URLs
- Folder Organization: Groups operations by port type for better organization
WSDL Import Example
import { wsdlToBruno } from '@usebruno/converters';
import fs from 'fs/promises';
async function importWSDL() {
try {
// Read WSDL file
const wsdlContent = await fs.readFile('service.wsdl', 'utf8');
// Convert to Bruno collection
const brunoCollection = await wsdlToBruno(wsdlContent);
// Save Bruno collection
await fs.writeFile('soap-collection.json', JSON.stringify(brunoCollection, null, 2));
console.log('WSDL import successful!');
} catch (error) {
console.error('Error during WSDL import:', error);
}
}
importWSDL();
CLI Usage
You can also use the Bruno CLI to import WSDL files:
# Import WSDL file to a directory
bruno import wsdl --source service.wsdl --output ~/Desktop/soap-collection --collection-name "SOAP Service"
# Import WSDL from URL
bruno import wsdl --source https://example.com/service.wsdl --output ~/Desktop --collection-name "Remote SOAP Service"
# Import WSDL and save as JSON file
bruno import wsdl --source service.wsdl --output-file ~/Desktop/soap-collection.json --collection-name "SOAP Service"
Supported Formats
- Postman Collections (v2.1)
- Insomnia Collections (v4 and v5)
- OpenAPI Specifications (v3.0)
- WSDL Files (Web Services Description Language)
Dependencies
lodash- Utility functionsnanoid- UUID generationjs-yaml- YAML parsingxml2js- XML parsing for WSDL@usebruno/schema- Schema validation