Skip to content

Version 9.0.0#422

Open
nulltoken wants to merge 9 commits into
masterfrom
ntk/addRoute
Open

Version 9.0.0#422
nulltoken wants to merge 9 commits into
masterfrom
ntk/addRoute

Conversation

@nulltoken

@nulltoken nulltoken commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

  • I have run npm test locally and all tests are passing.
  • I have added/updated tests for any new behavior.
  • If this is a significant change, an issue has already been created where the problem / solution was discussed: [N/A, or add link to issue here]

PR Description

  • Drop Node.js 20 support
  • Add Node.js 26 support
  • Better documentation
  • Drop Express dependency to reduce bundle size and exposure to vulnerabilities
  • Introduce service.addRoute() to expose additional routes next to OIDC endpoints. May be useful when willing to stub some vendor specific management routes for instance.

@nulltoken nulltoken force-pushed the ntk/addRoute branch 5 times, most recently from cf27e66 to 951ba8f Compare June 4, 2026 07:58
@nulltoken nulltoken changed the title [WIP] Version 9.0 Version 9.0.0 Jun 5, 2026
@nulltoken nulltoken requested a review from poveden June 5, 2026 09:39
@nulltoken nulltoken force-pushed the ntk/addRoute branch 3 times, most recently from 6ea5680 to 0069ffd Compare June 6, 2026 03:32
@nulltoken nulltoken force-pushed the ntk/addRoute branch 2 times, most recently from 8cea1aa to 5c528ea Compare June 6, 2026 15:59
Comment thread src/lib/oauth2-service.http.ts Outdated
chunks.push(chunk);
});
req.on('end', () => {
resolve(Buffer.concat(chunks).toString('utf8'));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are assuming that the body is text, and UTF-8 to boot. I know that most likely it will be text, but not necessarily UTF-8:

Welcome to the world of encodings and charsets! 😜

So, to honor the "raw" in the function's name, I suggest that you return a Buffer instead of a string, and let the caller decide what to do... which will be, most surely, do toString('utf8'), but at least the intent will be clear.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment thread src/lib/oauth2-service.http.ts Outdated
});
}

return parsed as Record<string, unknown>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If parsed is an array, how does that translate to Record<string, unknown>? There are no key+value pairs in there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

* @param err The error to handle.
* @param res The server response object.
*/
export function errorHandler(err: unknown, res: ServerResponse): void {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps using Problem Details would be nicer?

For 400:

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "Bad Request",
  "detail": "The actual error message."
}

For 500:

HTTP/1.1 500 Internal Server Error
Content-Type: application/problem+json

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
  "title": "Internal Server Error",
  "detail": "Most certainly a bug in the library code. Check the logs for more details and report this to the maintainers."
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants