Skip to content

Scope Messaging SMS/MMS to FusionPBX-owned numbers (#512) - #523

Merged
danry25 merged 1 commit into
masterfrom
issue-512-messaging
Oct 17, 2026
Merged

danry25 merged 1 commit into
masterfrom
issue-512-messaging

Conversation

@danry25

@danry25 danry25 commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

0f2e8dc added FusionPBX API key auth to the NumberSearch lookup API, but the Messaging service changes for texting were not included. This adds them.

Accept a FusionPBX user's API key as a bearer token on the Messaging API alongside the existing ops Identity token. A new ApiAccessRequirement widens the "api" authorization policy to pass for either an authenticated ops user or a valid, enabled FusionPBX API key. Per-number ownership is then enforced inside each handler using the user's FusionPBX domain (v_destinations):

  • /message/send: the sending MSISDN must be owned by the key holder
  • /client/register: the number being registered must be owned
  • /message/all: FusionPBX callers must pass an asDialed they own; the unfiltered listing remains staff-only

Ops (Identity) requests and internal callers are unaffected.

Update the Scalar docs to describe both ways to authenticate, mark /login as staff only, describe the ownership restrictions on the affected endpoints, and stop labeling the bearer format as a JWT.

Adds a NumberSearch.DataAccess reference and FusionPBXConnectionString to the Messaging project, plus functional tests for the owned/unowned send cases (skipped unless FusionPBXTestApiKey is configured).

0f2e8dc added FusionPBX API key auth to the NumberSearch lookup API, but
the Messaging service changes for texting were not included. This adds
them.

Accept a FusionPBX user's API key as a bearer token on the Messaging API
alongside the existing ops Identity token. A new ApiAccessRequirement
widens the "api" authorization policy to pass for either an authenticated
ops user or a valid, enabled FusionPBX API key. Per-number ownership is
then enforced inside each handler using the user's FusionPBX domain
(v_destinations):

- /message/send: the sending MSISDN must be owned by the key holder
- /client/register: the number being registered must be owned
- /message/all: FusionPBX callers must pass an asDialed they own; the
  unfiltered listing remains staff-only

Ops (Identity) requests and internal callers are unaffected.

Update the Scalar docs to describe both ways to authenticate, mark /login
as staff only, describe the ownership restrictions on the affected
endpoints, and stop labeling the bearer format as a JWT.

Adds a NumberSearch.DataAccess reference and FusionPBXConnectionString to
the Messaging project, plus functional tests for the owned/unowned send
cases (skipped unless FusionPBXTestApiKey is configured).
@danry25
danry25 merged commit eb5e3fb into master Oct 17, 2026
0 of 3 checks passed
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.

1 participant