Skip to content

Commit 9ffb771

Browse files
committed
finish up logging changes
1 parent 2b1f982 commit 9ffb771

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

β€Žbin/test-auth-flow.tsβ€Ž

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,20 +318,30 @@ class CLIAuthFlowTester {
318318
async runFullFlow(): Promise<boolean> {
319319
console.log(`\nπŸš€ Starting MCP Server Authorization Flow Test`);
320320
console.log(`πŸ“‘ Server URL: ${this.serverUrl}`);
321+
321322
if (this.autoRedirect) {
322-
console.log(`πŸ€– Auto-redirect mode: Enabled\n`);
323+
console.log(`πŸ€– Auto-redirect mode: Enabled`);
323324
} else {
324-
console.log(`πŸ‘€ Manual authorization mode\n`);
325+
console.log(`πŸ‘€ Manual authorization mode`);
325326
}
327+
328+
if (this.logOptions.verbose) {
329+
console.log(`πŸ” Verbose output: Enabled`);
330+
}
331+
332+
if (!this.logOptions.redactSensitiveData) {
333+
console.log(`⚠️ Token redaction: Disabled`);
334+
}
335+
console.log("");
326336

327337
try {
328338
// Step 1: Metadata Discovery
329339
await this.executeStep('metadata_discovery');
330-
console.log("");
340+
if (this.logOptions.verbose) console.log("");
331341

332342
// Step 2: Client Registration
333343
await this.executeStep('client_registration');
334-
console.log("");
344+
if (this.logOptions.verbose) console.log("");
335345

336346
// Step 3: Authorization Redirect Preparation
337347
await this.executeStep('authorization_redirect');
@@ -355,19 +365,24 @@ class CLIAuthFlowTester {
355365

356366
// Step 5: Validate Authorization Code
357367
await this.executeStep('authorization_code');
358-
console.log("");
368+
if (this.logOptions.verbose) console.log("");
359369

360370
// Step 6: Exchange Code for Tokens
361371
await this.executeStep('token_request');
362-
console.log("");
372+
if (this.logOptions.verbose) console.log("");
363373

364374
// Step 7: Validate the token by calling tools/list
365375
await this.executeStep('validate_token');
366376
console.log("");
367377

368378
// Final summary
369379
console.log("πŸŽ‰ AUTHORIZATION FLOW COMPLETED SUCCESSFULLY!");
370-
console.log("βœ… All steps completed without errors");
380+
if (!this.logOptions.verbose) {
381+
// Show a compact summary of completed steps in non-verbose mode
382+
console.log("βœ… Steps completed: metadata β†’ client registration β†’ authorization β†’ token exchange β†’ validation");
383+
} else {
384+
console.log("βœ… All steps completed without errors");
385+
}
371386
console.log("πŸ”‘ Access token obtained and ready for use");
372387

373388
return true;
@@ -407,7 +422,7 @@ async function main(): Promise<void> {
407422
break;
408423
}
409424
}
410-
425+
411426
if (!serverUrl) {
412427
console.error("❌ Server URL is required");
413428
console.error("Usage: npx tsx test-auth-flow.ts <server-url> [OPTIONS]");
@@ -432,7 +447,7 @@ async function main(): Promise<void> {
432447
verbose,
433448
noRedact
434449
});
435-
450+
436451
const success = await tester.runFullFlow();
437452

438453
process.exit(success ? 0 : 1);

0 commit comments

Comments
Β (0)