Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25.0

require (
firebase.google.com/go/v4 v4.19.0
github.com/android-sms-gateway/client-go v1.12.5
github.com/android-sms-gateway/client-go v1.12.7-0.20260509043819-901904d2dcae
github.com/ansrivas/fiberprometheus/v2 v2.6.1
github.com/capcom6/go-helpers v0.3.0
github.com/capcom6/go-infra-fx v0.5.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/android-sms-gateway/client-go v1.12.5 h1:LcfTIvtRxOujPxmtFfCjHuFiX5wFyjN9yqGE+82jZdw=
github.com/android-sms-gateway/client-go v1.12.5/go.mod h1:DQsReciU1xcaVW3T5Z2bqslNdsAwCFCtghawmA6g6L4=
github.com/android-sms-gateway/client-go v1.12.7-0.20260509043819-901904d2dcae h1:u9jWnKQ5LTNvMWCwmXUdTIEUvrruv/fgc3OwYK//DGY=
github.com/android-sms-gateway/client-go v1.12.7-0.20260509043819-901904d2dcae/go.mod h1:DQsReciU1xcaVW3T5Z2bqslNdsAwCFCtghawmA6g6L4=
github.com/andybalholm/brotli v1.2.1 h1:R+f5xP285VArJDRgowrfb9DqL18yVK0gKAW/F+eTWro=
github.com/andybalholm/brotli v1.2.1/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
github.com/ansrivas/fiberprometheus/v2 v2.6.1 h1:wac3pXaE6BYYTF04AC6K0ktk6vCD+MnDOJZ3SK66kXM=
Expand Down
6 changes: 4 additions & 2 deletions internal/sms-gateway/handlers/devices/permissions.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package devices

import "github.com/android-sms-gateway/client-go/smsgateway"

const (
ScopeList = "devices:list"
ScopeDelete = "devices:delete"
ScopeList = smsgateway.ScopeDevicesList
ScopeDelete = smsgateway.ScopeDevicesDelete
)
6 changes: 4 additions & 2 deletions internal/sms-gateway/handlers/inbox/permissions.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package inbox

import "github.com/android-sms-gateway/client-go/smsgateway"

const (
ScopeList = "inbox:list"
ScopeRefresh = "inbox:refresh"
ScopeList = smsgateway.ScopeInboxList
ScopeRefresh = smsgateway.ScopeInboxRefresh
)
4 changes: 3 additions & 1 deletion internal/sms-gateway/handlers/logs/permissions.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package logs

import "github.com/android-sms-gateway/client-go/smsgateway"

const (
ScopeRead = "logs:read"
ScopeRead = smsgateway.ScopeLogsRead
)
10 changes: 6 additions & 4 deletions internal/sms-gateway/handlers/messages/permissions.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
// Package messages defines permission scopes for message-related operations.
package messages

import "github.com/android-sms-gateway/client-go/smsgateway"

const (
// ScopeSend is the permission scope required for sending messages.
ScopeSend = "messages:send"
ScopeSend = smsgateway.ScopeMessagesSend
// ScopeRead is the permission scope required for reading individual messages.
ScopeRead = "messages:read"
ScopeRead = smsgateway.ScopeMessagesRead
// ScopeList is the permission scope required for listing messages.
ScopeList = "messages:list"
ScopeList = smsgateway.ScopeMessagesList
// ScopeExport is the permission scope required for exporting messages.
ScopeExport = "messages:export"
ScopeExport = smsgateway.ScopeMessagesExport
)
6 changes: 4 additions & 2 deletions internal/sms-gateway/handlers/settings/permissions.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package settings

import "github.com/android-sms-gateway/client-go/smsgateway"

const (
ScopeRead = "settings:read"
ScopeWrite = "settings:write"
ScopeRead = smsgateway.ScopeSettingsRead
ScopeWrite = smsgateway.ScopeSettingsWrite
)
4 changes: 3 additions & 1 deletion internal/sms-gateway/handlers/thirdparty/permissions.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package thirdparty

import "github.com/android-sms-gateway/client-go/smsgateway"

const (
ScopeTokensManage = "tokens:manage"
ScopeTokensManage = smsgateway.ScopeTokensManage
ScopeTokensRefresh = "tokens:refresh"
)
8 changes: 5 additions & 3 deletions internal/sms-gateway/handlers/webhooks/permissions.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package webhooks

import "github.com/android-sms-gateway/client-go/smsgateway"

const (
ScopeList = "webhooks:list"
ScopeWrite = "webhooks:write"
ScopeDelete = "webhooks:delete"
ScopeList = smsgateway.ScopeWebhooksList
ScopeWrite = smsgateway.ScopeWebhooksWrite
ScopeDelete = smsgateway.ScopeWebhooksDelete
)
52 changes: 51 additions & 1 deletion internal/sms-gateway/openapi/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,43 @@ const docTemplate = `{
"IncomingMessageTypeMmsDownloaded"
]
},
"smsgateway.JWTScope": {
"type": "string",
"enum": [
"devices:list",
"devices:delete",
"inbox:list",
"inbox:refresh",
"logs:read",
"messages:send",
"messages:read",
"messages:list",
"messages:export",
"settings:read",
"settings:write",
"tokens:manage",
"webhooks:list",
"webhooks:write",
"webhooks:delete"
],
"x-enum-varnames": [
"ScopeDevicesList",
"ScopeDevicesDelete",
"ScopeInboxList",
"ScopeInboxRefresh",
"ScopeLogsRead",
"ScopeMessagesSend",
"ScopeMessagesRead",
"ScopeMessagesList",
"ScopeMessagesExport",
"ScopeSettingsRead",
"ScopeSettingsWrite",
"ScopeTokensManage",
"ScopeWebhooksList",
"ScopeWebhooksWrite",
"ScopeWebhooksDelete"
]
},
"smsgateway.LimitPeriod": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -2038,11 +2075,24 @@ const docTemplate = `{
"maxLength": 21,
"example": "PyDmBQZZXYmyxMwED8Fzy"
},
"messageTypes": {
"description": "MessageTypes is the list of message types to export. By default, SMS messages are exported.",
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/smsgateway.IncomingMessageType"
}
},
"since": {
"description": "Since is the start of the time range to export.",
"type": "string",
"example": "2024-01-01T00:00:00Z"
},
"triggerWebhooks": {
"description": "TriggerWebhooks indicates whether to trigger webhooks for the exported messages.",
"type": "boolean",
"example": true
},
"until": {
"description": "Until is the end of the time range to export.",
"type": "string",
Expand Down Expand Up @@ -2293,7 +2343,7 @@ const docTemplate = `{
"type": "array",
"minItems": 1,
"items": {
"type": "string"
"$ref": "#/definitions/smsgateway.JWTScope"
}
},
"ttl": {
Expand Down
Loading