@openbanto/connector-lineworks
v0.1.0
Published
LINE WORKS Bot connector plugin for OpenBanto — bridges a LINE WORKS Bot (Service Account / JWT auth, Bot API messaging, signed callbacks) to the OpenBanto gateway as an external plugin.
Maintainers
Readme
@openbanto/connector-lineworks
LINE WORKS Bot connector plugin for OpenBanto.
It bridges a LINE WORKS Bot to the OpenBanto gateway as an external plugin
— implemented against @openbanto/connector-sdk only, with no dependency on the
OpenBanto core.
- Auth: Service Account (JWT / RS256) → OAuth2 access token, cached in memory.
- Send: Bot API
POST /v1.0/bots/{botId}/{users|channels}/{id}/messages. - Receive: signed HTTP callback,
X-WORKS-Signature = Base64(HMAC-SHA256(rawBody, botSecret)).
Capabilities
| threading | messageEdits | reactions | attachments | |-----------|--------------|-----------|-------------| | no | no | no | no |
addReaction / removeReaction / editMessage are explicit no-ops (LINE WORKS
Bot API has no equivalent). replyMessage sends a fresh message to the same
source (there is no native threaded reply).
Setup (LINE WORKS Developer Console)
- Create a Bot in the LINE WORKS Developer Console. Note the Bot ID and generate a Bot Secret.
- Enable Callback on the Bot and register your Callback URL:
https://<your-gateway-host><webhookPath>(defaultwebhookPath=/webhooks/lineworks/<instance-id>). Subscribe to the message event. - Create an App (Service Account) to get Client ID and Client Secret,
and download the Service Account private key (
.pem). Note the Service Account ID. - Grant the app the
bot(orbot.message) OAuth scope.
Config (config.yaml)
connectors:
instances:
- type: lineworks
id: lw-support # instance id (used in sessionKey + default webhook path)
employee: banto # optional: OpenBanto employee this instance routes to
clientId: "abcd1234..."
clientSecret: "s3cr3t..."
serviceAccount: "xxxx.serviceaccount@yourdomain"
# privateKey: PEM string OR a path to a .pem/.key file — both accepted:
privateKey: /etc/openbanto/secrets/lineworks-private.pem
botId: "10012345"
botSecret: "botSecretForHmac..."
domainId: "400000000" # optional
channelId: "channel-uuid" # optional default channel for outbound-only use
webhookPath: /webhooks/lineworks/lw-support # optional; defaults from id
allowFrom: # optional: accept callbacks only from these ids
- "user-id-1"
- "channel-uuid"privateKey accepts either a PEM string inline or a filesystem path; a value
containing -----BEGIN is used verbatim, otherwise it is read as a file.
Notes / TODO(verify)
Two spots are marked // TODO(verify): in the source because the fetched docs
did not literally show them:
- Channel send path — mirrors the confirmed user path
(
/bots/{botId}/channels/{channelId}/messages); confirm on the console. - Exact scope —
botvs least-privilegebot.messagefor send-only.
License
MIT
