node-red-node-committer-autofill
v1.0.1
Published
Node-RED editor plugin that auto-fills committer info in Git nodes based on the current Node-RED user session.
Maintainers
Readme
node-red-node-committer-autofill
A Node-RED plugin that automatically fills Git committer details (name, email, username, org) for new users by looking them up from LDAP, GitHub, GitLab, a custom HTTP API, or directly from msg.payload.
Installation
# From your Node-RED user directory (usually ~/.node-red)
npm install node-red-node-committer-autofillOr via the Node-RED Palette Manager: search for autofill-committer.
Nodes
autofill-committer
The main processing node. Place it anywhere in your flow after you have a user identifier available.
Input
| Property | Type | Description |
|---|---|---|
| payload.username | string | The user identifier (field path is configurable) |
Output — adds the following to msg:
| Property | Type | Description |
|---|---|---|
| msg.committer | object | { name, email, username, org, author, date, signingKeyType } |
| msg.gitAuthorName | string | Shortcut: msg.committer.name |
| msg.gitAuthorEmail | string | Shortcut: msg.committer.email |
Node properties
| Property | Default | Description |
|---|---|---|
| Config | (required) | Reference to a committer-config node |
| User ID field | payload.username | Dot-path into msg that holds the user identifier |
| On missing | Use defaults | What to do when lookup fails: use defaults / throw error / skip |
committer-config (config node)
Stores shared credentials and default values. Referenced by one or more autofill-committer nodes.
| Property | Description |
|---|---|
| Source | msg.payload, GitHub API, GitLab API, LDAP/AD, or Custom HTTP |
| LDAP URL / Base DN / Filter | Used when source = LDAP |
| API Base URL / Token | Used when source = GitHub, GitLab, or Custom |
| Default Org | Fallback org when the profile has none |
| Email Domain | Appended to username when email is missing (e.g. @company.com) |
| Username Prefix | Prepended to every resolved username |
| Author Format | Full name <email>, display name only, or username only |
| Date Format | ISO 8601, RFC 2822, or Unix timestamp |
| Signing Key | None, GPG, or SSH |
| Cache TTL | Seconds to cache a profile (default 3600) |
| Retries | How many times to retry a failed lookup (default 3) |
Quick start
- Import
example-flow.jsoninto Node-RED (Menu → Import → select file). - Open the committer-config node and set your source + credentials.
- Deploy. POST to
/new-userwith{ "username": "jdoe" }. - The flow runs
git config --global user.name / user.emailand returns 200.
msg.committer shape
{
"name": "Jane Doe",
"email": "[email protected]",
"username": "jdoe",
"org": "my-org",
"author": "Jane Doe <[email protected]>",
"date": "2025-03-14T09:26:53.000Z",
"signingKeyType": "gpg"
}Source adapters
| Source | What it fetches |
|---|---|
| msg.payload | Uses the incoming msg.payload directly — no external call |
| github | GET /users/:username via GitHub REST API v3 |
| gitlab | GET /api/v4/users/:id via GitLab API v4 |
| ldap | LDAP search using ldapjs; attributes cn, mail, uid, o |
| custom | GET <apiUrl> with Bearer token; {{userId}} interpolated in URL |
Caching
Profiles are cached in-process (using node-cache) for the configured TTL.
Cache key: <source>::<userId>.
Restart Node-RED or reduce TTL to force fresh lookups.
License
MIT
