Repository navigation
Scope Messaging SMS/MMS to FusionPBX-owned numbers (#512) - #523
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
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).