mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
d465690630
* feat: rework token auth to allow ED25519/EC public keys Signed-off-by: evanebb <git@evanus.nl> * fix: shadow err variable to hopefully avoid data race Signed-off-by: evanebb <git@evanus.nl> * fix: apply golangci-lint feedback Signed-off-by: evanebb <git@evanus.nl> * fix: simplify public key loading by only supporting certificates, fixes ED25519 certificate handling Signed-off-by: evanebb <git@evanus.nl> * test: add golang-jwt based test auth server and test RSA/EC/ED25519 keys Signed-off-by: evanebb <git@evanus.nl> * fix: restrict allowed signing algorithms as recommended by library Signed-off-by: evanebb <git@evanus.nl> * test: add more bearer authorizer tests Signed-off-by: evanebb <git@evanus.nl> * fix: apply more golangci-lint feedback Signed-off-by: evanebb <git@evanus.nl> * test: ensure chmod calls run on test failure for authn errors test Signed-off-by: evanebb <git@evanus.nl> * fix: verify issued-at in given token if present Pulls the validation in-line with the old library Signed-off-by: evanebb <git@evanus.nl> --------- Signed-off-by: evanebb <git@evanus.nl>
22 lines
491 B
Go
22 lines
491 B
Go
package auth_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
auth "zotregistry.dev/zot/pkg/test/auth"
|
|
)
|
|
|
|
func TestBearerServer(t *testing.T) {
|
|
Convey("test MakeAuthTestServer() no serve key", t, func() {
|
|
So(func() { auth.MakeAuthTestServer("", "", "") }, ShouldPanic)
|
|
})
|
|
}
|
|
|
|
func TestBearerServerLegacy(t *testing.T) {
|
|
Convey("test MakeAuthTestServerLegacy() no serve key", t, func() {
|
|
So(func() { auth.MakeAuthTestServerLegacy("", "") }, ShouldPanic)
|
|
})
|
|
}
|