Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Proposal: reject connect() on authentication error

Open
#47 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
node.js, typescript

Research direction

Start at the public connect() entry point and reproduce the provided authentication configuration with an incorrect sharedKey. Trace how connection and socket errors are surfaced, then verify that the authentication failure is observable through the connect() promise and that the existing error behavior remains covered.

Written by the indexing model from the issue text.

Description

Hi, I have a use case where authentication is required:

  const logger = new FluentClient("output", {
    socket: {
      host: "fluentd.local",
      port: 24224,
      timeout: 3000,
      disableReconnect: true,
      tls: {
        ca: require('fs').readFileSync('./fluentd.crt'),
      },
    },
    security: {
      clientHostname: "client.local",
      sharedKey: "incorrect",
      username: "ooo",
      password: "xxx"
    },
  });

  try {
    await logger.connect();
  } catch (err) {
    /* do something with err */
  }

When security is not correctly configured, connect() still resolves.

Though the error could be detected by logger.socketOn('error'), it's not synchronous with connect() and some mechanism to wait for the error (or to ensure no error thrown) is required.

If connect() can reject on error, it would be more easy to determine whether the client is authenticated successfully.

Dominant language
TypeScript
Stars
12
Forks
7
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fluent/fluent-logger-forward-node

All issues in fluent/fluent-logger-forward-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.