msteams

package
v0.25.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package msteams is the gateway's Microsoft Teams adapter over the Bot Framework: an Azure Bot registration POSTs activities to our webhook, and replies go back to the activity's serviceUrl as REST calls authenticated with an Azure AD client-credentials token. Inbound requests carry a Bot Framework JWT we verify against the published JWKS — Teams has no shared-secret HMAC, the JWT IS the sender authentication. Credentials (TEAMS_APP_ID, TEAMS_APP_PASSWORD, TEAMS_TENANT_ID) are read by the caller and passed to New; this package never reads the environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

Channel is a Microsoft Teams Bot Framework connection.

func New

func New(appID, appPassword, tenantID, mediaDir string) *Channel

New builds a Teams channel from the Azure Bot app id, its client secret, and the AAD tenant the bot is registered in. mediaDir is the gateway media spool inbound attachments are downloaded into; "" disables media handling.

func (*Channel) Handler

func (c *Channel) Handler(sink channels.Sink) http.Handler

Handler returns the webhook HTTP handler for POST /webhook/teams. It verifies the Bot Framework JWT, maps message activities to Inbound, and acks 200 only after every Deliver returned nil (503 makes the connector retry).

func (*Channel) Name

func (c *Channel) Name() string

Name returns the adapter identifier.

func (*Channel) Send

func (c *Channel) Send(ctx context.Context, conversation string, msg channels.Outbound) error

Send posts a reply. The conversation string carries "convID|serviceUrl" (see toInbound); the first "|" splits them because a serviceUrl never contains one. Text is chunked so an over-long agent reply never bounces.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL