Compare commits
10 Commits
dbcd95eb62
...
173bc3967d
| Author | SHA1 | Date | |
|---|---|---|---|
| 173bc3967d | |||
| 795cd8335f | |||
| 0cf34c475b | |||
| 547ee715c0 | |||
| 4850da6f56 | |||
| 53ac0d29da | |||
| d90aaedc00 | |||
| 74defc48b9 | |||
| 9205b11dc3 | |||
| 8d0881db3f |
+1
-1
@@ -77,7 +77,7 @@ If someone is able to tamper with the OAuth2 responses then the entire OAuth2 fl
|
|||||||
|
|
||||||
This is a common and usually valid report but there is no easy solution without confusing and degrading the users experience.
|
This is a common and usually valid report but there is no easy solution without confusing and degrading the users experience.
|
||||||
|
|
||||||
Some endpoints, like the user create/register, can be used for username or emails enumeration based on various response heuristics - timing, specific error messages, etc.
|
Some endpoints, like the user create/register, can be used for usernames or emails enumeration based on various response heuristics - timing, specific error messages, etc.
|
||||||
|
|
||||||
In many places where applicable we've tried to minimize the impact by using constant time checks, returning non-descriptive error messages, applying an internal rate limit for some operations, etc. but it is not bulletproof and if somebody wants to find out if a user is registered they will be able to do it one way or another.
|
In many places where applicable we've tried to minimize the impact by using constant time checks, returning non-descriptive error messages, applying an internal rate limit for some operations, etc. but it is not bulletproof and if somebody wants to find out if a user is registered they will be able to do it one way or another.
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ builds:
|
|||||||
main: ./examples/base
|
main: ./examples/base
|
||||||
binary: pocketbase
|
binary: pocketbase
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X github.com/pocketbase/pocketbase.Version={{ .Version }}
|
- -s -w -X github.com/tabshift-gh/pocketbase.Version={{ .Version }}
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
goos:
|
goos:
|
||||||
|
|||||||
+5
-1
@@ -1,9 +1,13 @@
|
|||||||
## v0.37.5 (WIP)
|
## v0.37.5
|
||||||
|
|
||||||
- Fixed password fields not being detected as changed ([#7670](https://github.com/pocketbase/pocketbase/issues/7670)).
|
- Fixed password fields not being detected as changed ([#7670](https://github.com/pocketbase/pocketbase/issues/7670)).
|
||||||
|
|
||||||
- Added the local time zone name next to the `date` field label.
|
- Added the local time zone name next to the `date` field label.
|
||||||
|
|
||||||
|
- Reload trusted proxy info UI after settings save.
|
||||||
|
|
||||||
|
- Other minor improvements (skips the duplicated record ids from the `IN` expand list, reordered confirm-email-change error checks to minimize enumeration attacks, etc.).
|
||||||
|
|
||||||
|
|
||||||
## v0.37.4
|
## v0.37.4
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/pocketbase/pocketbase/actions/workflows/release.yaml" target="_blank" rel="noopener"><img src="https://github.com/pocketbase/pocketbase/actions/workflows/release.yaml/badge.svg" alt="build" /></a>
|
<a href="https://github.com/pocketbase/pocketbase/actions/workflows/release.yaml" target="_blank" rel="noopener"><img src="https://github.com/tabshift-gh/pocketbase/actions/workflows/release.yaml/badge.svg" alt="build" /></a>
|
||||||
<a href="https://github.com/pocketbase/pocketbase/releases" target="_blank" rel="noopener"><img src="https://img.shields.io/github/release/pocketbase/pocketbase.svg" alt="Latest releases" /></a>
|
<a href="https://github.com/tabshift-gh/pocketbase/releases" target="_blank" rel="noopener"><img src="https://img.shields.io/github/release/tabshift-gh/pocketbase.svg" alt="Latest releases" /></a>
|
||||||
<a href="https://pkg.go.dev/github.com/pocketbase/pocketbase" target="_blank" rel="noopener"><img src="https://godoc.org/github.com/pocketbase/pocketbase?status.svg" alt="Go package documentation" /></a>
|
<a href="https://pkg.go.dev/github.com/pocketbase/pocketbase" target="_blank" rel="noopener"><img src="https://godoc.org/github.com/tabshift-gh/pocketbase?status.svg" alt="Go package documentation" /></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[PocketBase](https://pocketbase.io) is an open source Go backend that includes:
|
[PocketBase](https://pocketbase.io) is an open source Go backend that includes:
|
||||||
@@ -17,6 +17,12 @@
|
|||||||
- convenient **Admin dashboard UI**
|
- convenient **Admin dashboard UI**
|
||||||
- and simple **REST-ish API**
|
- and simple **REST-ish API**
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> This is a fork of the great [pocketbase/pocketbase][] repository adapted for
|
||||||
|
> Tabshift's purposes.
|
||||||
|
|
||||||
|
[pocketbase/pocketbase]: https://github.com/pocketbase/pocketbase
|
||||||
|
|
||||||
**For documentation and examples, please visit https://pocketbase.io/docs.**
|
**For documentation and examples, please visit https://pocketbase.io/docs.**
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
@@ -32,7 +38,6 @@ The easiest way to interact with the PocketBase Web APIs is to use one of the of
|
|||||||
|
|
||||||
You could also check the recommendations in https://pocketbase.io/docs/how-to-use/.
|
You could also check the recommendations in https://pocketbase.io/docs/how-to-use/.
|
||||||
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
### Use as standalone app
|
### Use as standalone app
|
||||||
@@ -52,33 +57,34 @@ Here is a minimal example:
|
|||||||
0. [Install Go 1.25+](https://go.dev/doc/install) (_if you haven't already_)
|
0. [Install Go 1.25+](https://go.dev/doc/install) (_if you haven't already_)
|
||||||
|
|
||||||
1. Create a new project directory with the following `main.go` file inside it:
|
1. Create a new project directory with the following `main.go` file inside it:
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
```go
|
||||||
"log"
|
package main
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase"
|
import (
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"log"
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
"github.com/pocketbase/pocketbase"
|
||||||
app := pocketbase.New()
|
"github.com/pocketbase/pocketbase/core"
|
||||||
|
)
|
||||||
|
|
||||||
app.OnServe().BindFunc(func(se *core.ServeEvent) error {
|
func main() {
|
||||||
// registers new "GET /hello" route
|
app := pocketbase.New()
|
||||||
se.Router.GET("/hello", func(re *core.RequestEvent) error {
|
|
||||||
return re.String(200, "Hello world!")
|
|
||||||
})
|
|
||||||
|
|
||||||
return se.Next()
|
app.OnServe().BindFunc(func(se *core.ServeEvent) error {
|
||||||
})
|
// registers new "GET /hello" route
|
||||||
|
se.Router.GET("/hello", func(re *core.RequestEvent) error {
|
||||||
|
return re.String(200, "Hello world!")
|
||||||
|
})
|
||||||
|
|
||||||
if err := app.Start(); err != nil {
|
return se.Next()
|
||||||
log.Fatal(err)
|
})
|
||||||
}
|
|
||||||
}
|
if err := app.Start(); err != nil {
|
||||||
```
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
2. To init the dependencies, run `go mod init myapp && go mod tidy`.
|
2. To init the dependencies, run `go mod init myapp && go mod tidy`.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package apis
|
package apis
|
||||||
|
|
||||||
import "github.com/pocketbase/pocketbase/tools/router"
|
import "github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
|
|
||||||
// ApiError aliases to minimize the breaking changes with earlier versions
|
// ApiError aliases to minimize the breaking changes with earlier versions
|
||||||
// and for consistency with the JSVM binds.
|
// and for consistency with the JSVM binds.
|
||||||
|
|||||||
+4
-4
@@ -6,10 +6,10 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
func backupCreate(e *core.RequestEvent) error {
|
func backupCreate(e *core.RequestEvent) error {
|
||||||
|
|||||||
+4
-4
@@ -10,10 +10,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/filesystem/blob"
|
"github.com/tabshift-gh/pocketbase/tools/filesystem/blob"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBackupsList(t *testing.T) {
|
func TestBackupsList(t *testing.T) {
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/core/validators"
|
"github.com/tabshift-gh/pocketbase/core/validators"
|
||||||
"github.com/pocketbase/pocketbase/tools/filesystem"
|
"github.com/tabshift-gh/pocketbase/tools/filesystem"
|
||||||
)
|
)
|
||||||
|
|
||||||
func backupUpload(e *core.RequestEvent) error {
|
func backupUpload(e *core.RequestEvent) error {
|
||||||
|
|||||||
+2
-2
@@ -8,8 +8,8 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StaticWildcardParam is the name of Static handler wildcard parameter.
|
// StaticWildcardParam is the name of Static handler wildcard parameter.
|
||||||
|
|||||||
+4
-4
@@ -8,10 +8,10 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWrapStdHandler(t *testing.T) {
|
func TestWrapStdHandler(t *testing.T) {
|
||||||
|
|||||||
+4
-4
@@ -15,10 +15,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/filesystem"
|
"github.com/tabshift-gh/pocketbase/tools/filesystem"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -6,9 +6,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBatchRequest(t *testing.T) {
|
func TestBatchRequest(t *testing.T) {
|
||||||
|
|||||||
+5
-5
@@ -7,11 +7,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/auth"
|
"github.com/tabshift-gh/pocketbase/tools/auth"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/search"
|
"github.com/tabshift-gh/pocketbase/tools/search"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bindCollectionApi registers the collection api endpoints and the corresponding handlers.
|
// bindCollectionApi registers the collection api endpoints and the corresponding handlers.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
func collectionsImport(e *core.RequestEvent) error {
|
func collectionsImport(e *core.RequestEvent) error {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCollectionsImport(t *testing.T) {
|
func TestCollectionsImport(t *testing.T) {
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCollectionsList(t *testing.T) {
|
func TestCollectionsList(t *testing.T) {
|
||||||
|
|||||||
+4
-4
@@ -5,10 +5,10 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/cron"
|
"github.com/tabshift-gh/pocketbase/tools/cron"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bindCronApi registers the crons api endpoint.
|
// bindCronApi registers the crons api endpoint.
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -10,10 +10,10 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/filesystem"
|
"github.com/tabshift-gh/pocketbase/tools/filesystem"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
"golang.org/x/sync/semaphore"
|
"golang.org/x/sync/semaphore"
|
||||||
"golang.org/x/sync/singleflight"
|
"golang.org/x/sync/singleflight"
|
||||||
|
|||||||
+4
-4
@@ -10,10 +10,10 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFileToken(t *testing.T) {
|
func TestFileToken(t *testing.T) {
|
||||||
|
|||||||
+2
-2
@@ -4,8 +4,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bindHealthApi registers the health api endpoint.
|
// bindHealthApi registers the health api endpoint.
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHealthAPI(t *testing.T) {
|
func TestHealthAPI(t *testing.T) {
|
||||||
|
|||||||
+4
-4
@@ -10,9 +10,9 @@ import (
|
|||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/osutils"
|
"github.com/tabshift-gh/pocketbase/tools/osutils"
|
||||||
"github.com/pocketbase/pocketbase/ui"
|
"github.com/tabshift-gh/pocketbase/ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultInstallerFunc is the default PocketBase installer function.
|
// DefaultInstallerFunc is the default PocketBase installer function.
|
||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
// token for the systemSuperuser) to the installer UI so that users can
|
// token for the systemSuperuser) to the installer UI so that users can
|
||||||
// create their own custom superuser record.
|
// create their own custom superuser record.
|
||||||
//
|
//
|
||||||
// See https://github.com/pocketbase/pocketbase/discussions/5814.
|
// See https://github.com/tabshift-gh/pocketbase/discussions/5814.
|
||||||
func DefaultInstallerFunc(app core.App, systemSuperuser *core.Record, baseURL string) error {
|
func DefaultInstallerFunc(app core.App, systemSuperuser *core.Record, baseURL string) error {
|
||||||
if ui.DistDirFS == nil {
|
if ui.DistDirFS == nil {
|
||||||
color.Magenta("You can create your first superuser by running: %s superuser upsert EMAIL PASS", executablePath())
|
color.Magenta("You can create your first superuser by running: %s superuser upsert EMAIL PASS", executablePath())
|
||||||
|
|||||||
+3
-3
@@ -4,9 +4,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/search"
|
"github.com/tabshift-gh/pocketbase/tools/search"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bindLogsApi registers the request logs api endpoints.
|
// bindLogsApi registers the request logs api endpoints.
|
||||||
|
|||||||
+2
-2
@@ -4,8 +4,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestLogsList(t *testing.T) {
|
func TestLogsList(t *testing.T) {
|
||||||
|
|||||||
+5
-5
@@ -11,11 +11,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrRequestEntityTooLarge = router.NewApiError(http.StatusRequestEntityTooLarge, "Request entity too large", nil)
|
var ErrRequestEntityTooLarge = router.NewApiError(http.StatusRequestEntityTooLarge, "Request entity too large", nil)
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBodyLimitMiddleware(t *testing.T) {
|
func TestBodyLimitMiddleware(t *testing.T) {
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/store"
|
"github.com/tabshift-gh/pocketbase/tools/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDefaultRateLimitMiddleware(t *testing.T) {
|
func TestDefaultRateLimitMiddleware(t *testing.T) {
|
||||||
@@ -86,8 +86,8 @@ func TestDefaultRateLimitMiddleware(t *testing.T) {
|
|||||||
|
|
||||||
{"/rate/a", 0, false, 200},
|
{"/rate/a", 0, false, 200},
|
||||||
{"/rate/a", 800, false, 200}, // (fixed window check) wait enough to ensure that it can't fit more than 2 requests in 1s
|
{"/rate/a", 800, false, 200}, // (fixed window check) wait enough to ensure that it can't fit more than 2 requests in 1s
|
||||||
{"/rate/a", 500, false, 200},
|
{"/rate/a", 600, false, 200},
|
||||||
{"/rate/a", 800, false, 200},
|
{"/rate/a", 850, false, 200},
|
||||||
{"/rate/a", 0, false, 200},
|
{"/rate/a", 0, false, 200},
|
||||||
{"/rate/a", 0, false, 429},
|
{"/rate/a", 0, false, 429},
|
||||||
{"/rate/a", 0, false, 429},
|
{"/rate/a", 0, false, 429},
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPanicRecover(t *testing.T) {
|
func TestPanicRecover(t *testing.T) {
|
||||||
|
|||||||
+8
-8
@@ -12,13 +12,13 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/picker"
|
"github.com/tabshift-gh/pocketbase/tools/picker"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
"github.com/pocketbase/pocketbase/tools/search"
|
"github.com/tabshift-gh/pocketbase/tools/search"
|
||||||
"github.com/pocketbase/pocketbase/tools/subscriptions"
|
"github.com/tabshift-gh/pocketbase/tools/subscriptions"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ func realtimeConnect(e *core.RequestEvent) error {
|
|||||||
|
|
||||||
e.Response.Header().Set("Content-Type", "text/event-stream")
|
e.Response.Header().Set("Content-Type", "text/event-stream")
|
||||||
e.Response.Header().Set("Cache-Control", "no-store")
|
e.Response.Header().Set("Cache-Control", "no-store")
|
||||||
// https://github.com/pocketbase/pocketbase/discussions/480#discussioncomment-3657640
|
// https://github.com/tabshift-gh/pocketbase/discussions/480#discussioncomment-3657640
|
||||||
// https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering
|
// https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering
|
||||||
e.Response.Header().Set("X-Accel-Buffering", "no")
|
e.Response.Header().Set("X-Accel-Buffering", "no")
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/subscriptions"
|
"github.com/tabshift-gh/pocketbase/tools/subscriptions"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRealtimeConnect(t *testing.T) {
|
func TestRealtimeConnect(t *testing.T) {
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package apis
|
package apis
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bindRecordAuthApi registers the auth record api endpoints and
|
// bindRecordAuthApi registers the auth record api endpoints and
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
)
|
)
|
||||||
|
|
||||||
func recordConfirmEmailChange(e *core.RequestEvent) error {
|
func recordConfirmEmailChange(e *core.RequestEvent) error {
|
||||||
@@ -102,12 +102,6 @@ func (form *EmailChangeConfirmForm) parseToken() (*core.Record, string, error) {
|
|||||||
return nil, "", validation.NewError("validation_invalid_token_payload", "Invalid token payload - newEmail must be set.")
|
return nil, "", validation.NewError("validation_invalid_token_payload", "Invalid token payload - newEmail must be set.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure that there aren't other users with the new email
|
|
||||||
_, err := form.app.FindAuthRecordByEmail(form.collection, newEmail)
|
|
||||||
if err == nil {
|
|
||||||
return nil, "", validation.NewError("validation_existing_token_email", "The new email address is already registered: "+newEmail)
|
|
||||||
}
|
|
||||||
|
|
||||||
// verify that the token is not expired and its signature is valid
|
// verify that the token is not expired and its signature is valid
|
||||||
authRecord, err := form.app.FindAuthRecordByToken(form.Token, core.TokenTypeEmailChange)
|
authRecord, err := form.app.FindAuthRecordByToken(form.Token, core.TokenTypeEmailChange)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -118,5 +112,11 @@ func (form *EmailChangeConfirmForm) parseToken() (*core.Record, string, error) {
|
|||||||
return nil, "", validation.NewError("validation_token_collection_mismatch", "The provided token is for different auth collection.")
|
return nil, "", validation.NewError("validation_token_collection_mismatch", "The provided token is for different auth collection.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if there are other users with the new email
|
||||||
|
_, err = form.app.FindAuthRecordByEmail(form.collection, newEmail)
|
||||||
|
if err == nil {
|
||||||
|
return nil, "", validation.NewError("validation_invalid_token_email", "The new email address is invalid.")
|
||||||
|
}
|
||||||
|
|
||||||
return authRecord, newEmail, nil
|
return authRecord, newEmail, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordConfirmEmailChange(t *testing.T) {
|
func TestRecordConfirmEmailChange(t *testing.T) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/go-ozzo/ozzo-validation/v4/is"
|
"github.com/go-ozzo/ozzo-validation/v4/is"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/mails"
|
"github.com/tabshift-gh/pocketbase/mails"
|
||||||
)
|
)
|
||||||
|
|
||||||
func recordRequestEmailChange(e *core.RequestEvent) error {
|
func recordRequestEmailChange(e *core.RequestEvent) error {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordRequestEmailChange(t *testing.T) {
|
func TestRecordRequestEmailChange(t *testing.T) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
// note: for now allow superusers but it may change in the future to allow access
|
// note: for now allow superusers but it may change in the future to allow access
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordAuthImpersonate(t *testing.T) {
|
func TestRecordAuthImpersonate(t *testing.T) {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/auth"
|
"github.com/tabshift-gh/pocketbase/tools/auth"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordAuthMethodsList(t *testing.T) {
|
func TestRecordAuthMethodsList(t *testing.T) {
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/go-ozzo/ozzo-validation/v4/is"
|
"github.com/go-ozzo/ozzo-validation/v4/is"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/mails"
|
"github.com/tabshift-gh/pocketbase/mails"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
)
|
)
|
||||||
|
|
||||||
func recordRequestOTP(e *core.RequestEvent) error {
|
func recordRequestOTP(e *core.RequestEvent) error {
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordRequestOTP(t *testing.T) {
|
func TestRecordRequestOTP(t *testing.T) {
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/core/validators"
|
"github.com/tabshift-gh/pocketbase/core/validators"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordConfirmPasswordReset(t *testing.T) {
|
func TestRecordConfirmPasswordReset(t *testing.T) {
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/go-ozzo/ozzo-validation/v4/is"
|
"github.com/go-ozzo/ozzo-validation/v4/is"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/mails"
|
"github.com/tabshift-gh/pocketbase/mails"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
)
|
)
|
||||||
|
|
||||||
func recordRequestPasswordReset(e *core.RequestEvent) error {
|
func recordRequestPasswordReset(e *core.RequestEvent) error {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordRequestPasswordReset(t *testing.T) {
|
func TestRecordRequestPasswordReset(t *testing.T) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package apis
|
package apis
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordAuthRefresh(t *testing.T) {
|
func TestRecordAuthRefresh(t *testing.T) {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordConfirmVerification(t *testing.T) {
|
func TestRecordConfirmVerification(t *testing.T) {
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/go-ozzo/ozzo-validation/v4/is"
|
"github.com/go-ozzo/ozzo-validation/v4/is"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/mails"
|
"github.com/tabshift-gh/pocketbase/mails"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
)
|
)
|
||||||
|
|
||||||
func recordRequestVerification(e *core.RequestEvent) error {
|
func recordRequestVerification(e *core.RequestEvent) error {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordRequestVerification(t *testing.T) {
|
func TestRecordRequestVerification(t *testing.T) {
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/auth"
|
"github.com/tabshift-gh/pocketbase/tools/auth"
|
||||||
"github.com/pocketbase/pocketbase/tools/dbutils"
|
"github.com/tabshift-gh/pocketbase/tools/dbutils"
|
||||||
"github.com/pocketbase/pocketbase/tools/filesystem"
|
"github.com/tabshift-gh/pocketbase/tools/filesystem"
|
||||||
"github.com/pocketbase/pocketbase/tools/inflector"
|
"github.com/tabshift-gh/pocketbase/tools/inflector"
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/subscriptions"
|
"github.com/tabshift-gh/pocketbase/tools/subscriptions"
|
||||||
"github.com/pocketbase/pocketbase/ui"
|
"github.com/tabshift-gh/pocketbase/ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -56,7 +56,7 @@ func oauth2SubscriptionRedirect(e *core.RequestEvent) error {
|
|||||||
defer client.Unsubscribe(oauth2SubscriptionTopic)
|
defer client.Unsubscribe(oauth2SubscriptionTopic)
|
||||||
|
|
||||||
// temporary store the Apple user's name so that it can be later retrieved with the authWithOAuth2 call
|
// temporary store the Apple user's name so that it can be later retrieved with the authWithOAuth2 call
|
||||||
// (see https://github.com/pocketbase/pocketbase/issues/7090)
|
// (see https://github.com/tabshift-gh/pocketbase/issues/7090)
|
||||||
if data.AppleUser != "" && data.Error == "" && data.Code != "" {
|
if data.AppleUser != "" && data.Error == "" && data.Code != "" {
|
||||||
nameErr := parseAndStoreAppleRedirectName(
|
nameErr := parseAndStoreAppleRedirectName(
|
||||||
e.App,
|
e.App,
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/subscriptions"
|
"github.com/tabshift-gh/pocketbase/tools/subscriptions"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordAuthWithOAuth2Redirect(t *testing.T) {
|
func TestRecordAuthWithOAuth2Redirect(t *testing.T) {
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/auth"
|
"github.com/tabshift-gh/pocketbase/tools/auth"
|
||||||
"github.com/pocketbase/pocketbase/tools/dbutils"
|
"github.com/tabshift-gh/pocketbase/tools/dbutils"
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
)
|
)
|
||||||
|
|
||||||
func recordAuthWithOTP(e *core.RequestEvent) error {
|
func recordAuthWithOTP(e *core.RequestEvent) error {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordAuthWithOTP(t *testing.T) {
|
func TestRecordAuthWithOTP(t *testing.T) {
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/go-ozzo/ozzo-validation/v4/is"
|
"github.com/go-ozzo/ozzo-validation/v4/is"
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/dbutils"
|
"github.com/tabshift-gh/pocketbase/tools/dbutils"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
)
|
)
|
||||||
|
|
||||||
func recordAuthWithPassword(e *core.RequestEvent) error {
|
func recordAuthWithPassword(e *core.RequestEvent) error {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/dbutils"
|
"github.com/tabshift-gh/pocketbase/tools/dbutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordAuthWithPassword(t *testing.T) {
|
func TestRecordAuthWithPassword(t *testing.T) {
|
||||||
|
|||||||
+8
-8
@@ -10,14 +10,14 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/forms"
|
"github.com/tabshift-gh/pocketbase/forms"
|
||||||
"github.com/pocketbase/pocketbase/tools/filesystem"
|
"github.com/tabshift-gh/pocketbase/tools/filesystem"
|
||||||
"github.com/pocketbase/pocketbase/tools/inflector"
|
"github.com/tabshift-gh/pocketbase/tools/inflector"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/search"
|
"github.com/tabshift-gh/pocketbase/tools/search"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bindRecordCrudApi registers the record crud api endpoints and
|
// bindRecordCrudApi registers the record crud api endpoints and
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordCrudAuthOriginList(t *testing.T) {
|
func TestRecordCrudAuthOriginList(t *testing.T) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordCrudExternalAuthList(t *testing.T) {
|
func TestRecordCrudExternalAuthList(t *testing.T) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordCrudMFAList(t *testing.T) {
|
func TestRecordCrudMFAList(t *testing.T) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordCrudOTPList(t *testing.T) {
|
func TestRecordCrudOTPList(t *testing.T) {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordCrudSuperuserList(t *testing.T) {
|
func TestRecordCrudSuperuserList(t *testing.T) {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRecordCrudList(t *testing.T) {
|
func TestRecordCrudList(t *testing.T) {
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/mails"
|
"github.com/tabshift-gh/pocketbase/mails"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
"github.com/pocketbase/pocketbase/tools/search"
|
"github.com/tabshift-gh/pocketbase/tools/search"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEnrichRecords(t *testing.T) {
|
func TestEnrichRecords(t *testing.T) {
|
||||||
|
|||||||
+5
-5
@@ -13,11 +13,11 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
"github.com/pocketbase/pocketbase/ui"
|
"github.com/tabshift-gh/pocketbase/ui"
|
||||||
"golang.org/x/crypto/acme"
|
"golang.org/x/crypto/acme"
|
||||||
"golang.org/x/crypto/acme/autocert"
|
"golang.org/x/crypto/acme/autocert"
|
||||||
)
|
)
|
||||||
|
|||||||
+3
-3
@@ -4,9 +4,9 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/forms"
|
"github.com/tabshift-gh/pocketbase/forms"
|
||||||
"github.com/pocketbase/pocketbase/tools/router"
|
"github.com/tabshift-gh/pocketbase/tools/router"
|
||||||
)
|
)
|
||||||
|
|
||||||
// bindSettingsApi registers the settings api endpoints.
|
// bindSettingsApi registers the settings api endpoints.
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSettingsList(t *testing.T) {
|
func TestSettingsList(t *testing.T) {
|
||||||
|
|||||||
+2
-2
@@ -4,8 +4,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/apis"
|
"github.com/tabshift-gh/pocketbase/apis"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@ import (
|
|||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/go-ozzo/ozzo-validation/v4/is"
|
"github.com/go-ozzo/ozzo-validation/v4/is"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ package cmd_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/cmd"
|
"github.com/tabshift-gh/pocketbase/cmd"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSuperuserUpsertCommand(t *testing.T) {
|
func TestSuperuserUpsertCommand(t *testing.T) {
|
||||||
|
|||||||
+6
-6
@@ -9,12 +9,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/tools/cron"
|
"github.com/tabshift-gh/pocketbase/tools/cron"
|
||||||
"github.com/pocketbase/pocketbase/tools/filesystem"
|
"github.com/tabshift-gh/pocketbase/tools/filesystem"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/mailer"
|
"github.com/tabshift-gh/pocketbase/tools/mailer"
|
||||||
"github.com/pocketbase/pocketbase/tools/store"
|
"github.com/tabshift-gh/pocketbase/tools/store"
|
||||||
"github.com/pocketbase/pocketbase/tools/subscriptions"
|
"github.com/tabshift-gh/pocketbase/tools/subscriptions"
|
||||||
)
|
)
|
||||||
|
|
||||||
// App defines the main PocketBase app interface.
|
// App defines the main PocketBase app interface.
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
const CollectionNameAuthOrigins = "_authOrigins"
|
const CollectionNameAuthOrigins = "_authOrigins"
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewAuthOrigin(t *testing.T) {
|
func TestNewAuthOrigin(t *testing.T) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFindAllAuthOriginsByRecord(t *testing.T) {
|
func TestFindAllAuthOriginsByRecord(t *testing.T) {
|
||||||
|
|||||||
+11
-11
@@ -16,15 +16,15 @@ import (
|
|||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/tools/cron"
|
"github.com/tabshift-gh/pocketbase/tools/cron"
|
||||||
"github.com/pocketbase/pocketbase/tools/filesystem"
|
"github.com/tabshift-gh/pocketbase/tools/filesystem"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/logger"
|
"github.com/tabshift-gh/pocketbase/tools/logger"
|
||||||
"github.com/pocketbase/pocketbase/tools/mailer"
|
"github.com/tabshift-gh/pocketbase/tools/mailer"
|
||||||
"github.com/pocketbase/pocketbase/tools/routine"
|
"github.com/tabshift-gh/pocketbase/tools/routine"
|
||||||
"github.com/pocketbase/pocketbase/tools/store"
|
"github.com/tabshift-gh/pocketbase/tools/store"
|
||||||
"github.com/pocketbase/pocketbase/tools/subscriptions"
|
"github.com/tabshift-gh/pocketbase/tools/subscriptions"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
"golang.org/x/sync/semaphore"
|
"golang.org/x/sync/semaphore"
|
||||||
)
|
)
|
||||||
@@ -1233,7 +1233,7 @@ func normalizeSQLLog(sql string) string {
|
|||||||
|
|
||||||
func (app *BaseApp) initAuxDB() error {
|
func (app *BaseApp) initAuxDB() error {
|
||||||
// note: renamed to "auxiliary" because "aux" is a reserved Windows filename
|
// note: renamed to "auxiliary" because "aux" is a reserved Windows filename
|
||||||
// (see https://github.com/pocketbase/pocketbase/issues/5607)
|
// (see https://github.com/tabshift-gh/pocketbase/issues/5607)
|
||||||
dbPath := filepath.Join(app.DataDir(), "auxiliary.db")
|
dbPath := filepath.Join(app.DataDir(), "auxiliary.db")
|
||||||
|
|
||||||
concurrentDB, err := app.config.DBConnect(dbPath)
|
concurrentDB, err := app.config.DBConnect(dbPath)
|
||||||
@@ -1314,7 +1314,7 @@ func (app *BaseApp) registerBaseHooks() {
|
|||||||
Func: func(e *ModelEvent) error {
|
Func: func(e *ModelEvent) error {
|
||||||
if m, ok := e.Model.(FilesManager); ok && m.BaseFilesPath() != "" && supportFiles(e.Model) {
|
if m, ok := e.Model.(FilesManager); ok && m.BaseFilesPath() != "" && supportFiles(e.Model) {
|
||||||
// ensure that there is a trailing slash so that the list iterator could start walking from the prefix dir
|
// ensure that there is a trailing slash so that the list iterator could start walking from the prefix dir
|
||||||
// (https://github.com/pocketbase/pocketbase/discussions/5246#discussioncomment-10128955)
|
// (https://github.com/tabshift-gh/pocketbase/discussions/5246#discussioncomment-10128955)
|
||||||
prefix := strings.TrimRight(m.BaseFilesPath(), "/") + "/"
|
prefix := strings.TrimRight(m.BaseFilesPath(), "/") + "/"
|
||||||
|
|
||||||
// note: for now assume no context cancellation
|
// note: for now assume no context cancellation
|
||||||
|
|||||||
+6
-6
@@ -12,11 +12,11 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/tools/archive"
|
"github.com/tabshift-gh/pocketbase/tools/archive"
|
||||||
"github.com/pocketbase/pocketbase/tools/filesystem"
|
"github.com/tabshift-gh/pocketbase/tools/filesystem"
|
||||||
"github.com/pocketbase/pocketbase/tools/inflector"
|
"github.com/tabshift-gh/pocketbase/tools/inflector"
|
||||||
"github.com/pocketbase/pocketbase/tools/osutils"
|
"github.com/tabshift-gh/pocketbase/tools/osutils"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -145,7 +145,7 @@ func (app *BaseApp) CreateBackup(ctx context.Context, name string) error {
|
|||||||
//
|
//
|
||||||
// Note that if your pb_data has custom network mounts as subdirectories, then
|
// Note that if your pb_data has custom network mounts as subdirectories, then
|
||||||
// it is possible the restore to fail during the `os.Rename` operations
|
// it is possible the restore to fail during the `os.Rename` operations
|
||||||
// (see https://github.com/pocketbase/pocketbase/issues/4647).
|
// (see https://github.com/tabshift-gh/pocketbase/issues/4647).
|
||||||
func (app *BaseApp) RestoreBackup(ctx context.Context, name string) error {
|
func (app *BaseApp) RestoreBackup(ctx context.Context, name string) error {
|
||||||
if app.Store().Has(StoreKeyActiveBackup) {
|
if app.Store().Has(StoreKeyActiveBackup) {
|
||||||
return errors.New("try again later - another backup/restore operation has already been started")
|
return errors.New("try again later - another backup/restore operation has already been started")
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/archive"
|
"github.com/tabshift-gh/pocketbase/tools/archive"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCreateBackup(t *testing.T) {
|
func TestCreateBackup(t *testing.T) {
|
||||||
|
|||||||
+4
-4
@@ -12,10 +12,10 @@ import (
|
|||||||
_ "unsafe"
|
_ "unsafe"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/logger"
|
"github.com/tabshift-gh/pocketbase/tools/logger"
|
||||||
"github.com/pocketbase/pocketbase/tools/mailer"
|
"github.com/tabshift-gh/pocketbase/tools/mailer"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewBaseApp(t *testing.T) {
|
func TestNewBaseApp(t *testing.T) {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestImportCollections(t *testing.T) {
|
func TestImportCollections(t *testing.T) {
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/tools/dbutils"
|
"github.com/tabshift-gh/pocketbase/tools/dbutils"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/go-ozzo/ozzo-validation/v4/is"
|
"github.com/go-ozzo/ozzo-validation/v4/is"
|
||||||
"github.com/pocketbase/pocketbase/tools/auth"
|
"github.com/tabshift-gh/pocketbase/tools/auth"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -461,7 +461,7 @@ type OAuth2ProviderConfig struct {
|
|||||||
//
|
//
|
||||||
// This usually shouldn't be needed but some OAuth2 vendors, like the LinkedIn OIDC,
|
// This usually shouldn't be needed but some OAuth2 vendors, like the LinkedIn OIDC,
|
||||||
// may require manual adjustment due to returning error if extra parameters are added to the request
|
// may require manual adjustment due to returning error if extra parameters are added to the request
|
||||||
// (https://github.com/pocketbase/pocketbase/discussions/3799#discussioncomment-7640312)
|
// (https://github.com/tabshift-gh/pocketbase/discussions/3799#discussioncomment-7640312)
|
||||||
PKCE *bool `form:"pkce" json:"pkce"`
|
PKCE *bool `form:"pkce" json:"pkce"`
|
||||||
|
|
||||||
Name string `form:"name" json:"name"`
|
Name string `form:"name" json:"name"`
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/auth"
|
"github.com/tabshift-gh/pocketbase/tools/auth"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCollectionAuthOptionsValidate(t *testing.T) {
|
func TestCollectionAuthOptionsValidate(t *testing.T) {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/dbutils"
|
"github.com/tabshift-gh/pocketbase/tools/dbutils"
|
||||||
"github.com/pocketbase/pocketbase/tools/hook"
|
"github.com/tabshift-gh/pocketbase/tools/hook"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewCollection(t *testing.T) {
|
func TestNewCollection(t *testing.T) {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package core_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCollectionViewOptionsValidate(t *testing.T) {
|
func TestCollectionViewOptionsValidate(t *testing.T) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
)
|
)
|
||||||
|
|
||||||
const StoreKeyCachedCollections = "pbAppCachedCollections"
|
const StoreKeyCachedCollections = "pbAppCachedCollections"
|
||||||
@@ -299,7 +299,7 @@ func saveViewCollection(app App, newCollection, oldCollection *Collection) error
|
|||||||
// normalizeViewQueryId wraps (if necessary) the provided view query
|
// normalizeViewQueryId wraps (if necessary) the provided view query
|
||||||
// with a subselect to ensure that the id column is a text since
|
// with a subselect to ensure that the id column is a text since
|
||||||
// currently we don't support non-string model ids
|
// currently we don't support non-string model ids
|
||||||
// (see https://github.com/pocketbase/pocketbase/issues/3110).
|
// (see https://github.com/tabshift-gh/pocketbase/issues/3110).
|
||||||
func normalizeViewQueryId(app App, query string) (string, error) {
|
func normalizeViewQueryId(app App, query string) (string, error) {
|
||||||
query = strings.Trim(strings.TrimSpace(query), ";")
|
query = strings.Trim(strings.TrimSpace(query), ";")
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCollectionQuery(t *testing.T) {
|
func TestCollectionQuery(t *testing.T) {
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/tools/dbutils"
|
"github.com/tabshift-gh/pocketbase/tools/dbutils"
|
||||||
"github.com/pocketbase/pocketbase/tools/security"
|
"github.com/tabshift-gh/pocketbase/tools/security"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SyncRecordTableSchema compares the two provided collections
|
// SyncRecordTableSchema compares the two provided collections
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSyncRecordTableSchema(t *testing.T) {
|
func TestSyncRecordTableSchema(t *testing.T) {
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import (
|
|||||||
|
|
||||||
validation "github.com/go-ozzo/ozzo-validation/v4"
|
validation "github.com/go-ozzo/ozzo-validation/v4"
|
||||||
"github.com/pocketbase/dbx"
|
"github.com/pocketbase/dbx"
|
||||||
"github.com/pocketbase/pocketbase/core/validators"
|
"github.com/tabshift-gh/pocketbase/core/validators"
|
||||||
"github.com/pocketbase/pocketbase/tools/dbutils"
|
"github.com/tabshift-gh/pocketbase/tools/dbutils"
|
||||||
"github.com/pocketbase/pocketbase/tools/list"
|
"github.com/tabshift-gh/pocketbase/tools/list"
|
||||||
"github.com/pocketbase/pocketbase/tools/search"
|
"github.com/tabshift-gh/pocketbase/tools/search"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var collectionNameRegex = regexp.MustCompile(`^\w+$`)
|
var collectionNameRegex = regexp.MustCompile(`^\w+$`)
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ package core_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
"github.com/tabshift-gh/pocketbase/core"
|
||||||
"github.com/pocketbase/pocketbase/tests"
|
"github.com/tabshift-gh/pocketbase/tests"
|
||||||
"github.com/pocketbase/pocketbase/tools/types"
|
"github.com/tabshift-gh/pocketbase/tools/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCollectionValidate(t *testing.T) {
|
func TestCollectionValidate(t *testing.T) {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user