Files
server/api/tokens_test.go
饺子w (Yumechi) ad977d3d9c feat: EdDSA token for database leakage/index mitigation (#971)
* feat: EdDSA token for database leakage/index mitigation

* [skip ci]: remove token from api output

* fix: e2e tests

* fixup! fix: e2e tests

* doc: document tokens are now optional fields for app and aclient

* fixup(doc): swagger version again

* address review comments

* address review comments
2026-06-28 14:58:20 +00:00

20 lines
608 B
Go

package api
import (
"regexp"
"testing"
"github.com/stretchr/testify/assert"
)
func TestTokenGeneration(t *testing.T) {
clientPub, clientPriv := generateClientToken()
assert.Regexp(t, regexp.MustCompile(`^gtfyc\.(.+)$`), clientPub)
assert.Regexp(t, regexp.MustCompile(`^gtfyc\.(.+)$`), clientPriv)
applicationPub, applicationPriv := generateApplicationToken()
assert.Regexp(t, regexp.MustCompile(`^gtfya\.(.+)$`), applicationPub)
assert.Regexp(t, regexp.MustCompile(`^gtfya\.(.+)$`), applicationPriv)
imageName := generateImageName()
assert.Regexp(t, regexp.MustCompile(`^(.+)$`), imageName)
}