MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / responsePhoneAPIKeyUnauthorized

Method responsePhoneAPIKeyUnauthorized

api/pkg/handlers/handler.go:41–47  ·  view source on GitHub ↗
(c fiber.Ctx, owner string, authCtx entities.AuthContext)

Source from the content-addressed store, hash-verified

39}
40
41func (h *handler) responsePhoneAPIKeyUnauthorized(c fiber.Ctx, owner string, authCtx entities.AuthContext) error {
42 return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
43 "status": "error",
44 "message": "You are not authorized to carry out the request for this phone number",
45 "data": fmt.Sprintf("The phone API key is does not have permission to carry out actions on the phone number [%s]. The API key is only configured for these phone numbers [%s]", owner, strings.Join(authCtx.PhoneNumbers, ",")),
46 })
47}
48
49func (h *handler) responseForbidden(c fiber.Ctx) error {
50 return c.Status(fiber.StatusForbidden).JSON(fiber.Map{

Callers 4

PostEventMethod · 0.80
PostReceiveMethod · 0.80
PostCallMissedMethod · 0.80
StoreMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected