~bigbes/sr-ht-dolt

0f6d50a68d88bf7c94e65770e6fc50750bc73519 — Eugene Blikh 5 days ago 6288fc1
authn: gofmt the test files
3 files changed, 7 insertions(+), 7 deletions(-)

M authn/grpc_test.go
M authn/jwt_test.go
M authn/token_test.go
M authn/grpc_test.go => authn/grpc_test.go +1 -1
@@ 6,8 6,8 @@ import (
	"testing"
	"time"

	"sourcecraft.dev/bigbes/sr-ht-core/auth"
	"github.com/dolthub/dolt/go/libraries/doltcore/creds"
	"sourcecraft.dev/bigbes/sr-ht-core/auth"
)

func basicHeader(user, pass string) string {

M authn/jwt_test.go => authn/jwt_test.go +1 -1
@@ 7,8 7,8 @@ import (
	"testing"
	"time"

	"sourcecraft.dev/bigbes/sr-ht-core/auth"
	"github.com/dolthub/dolt/go/libraries/doltcore/creds"
	"sourcecraft.dev/bigbes/sr-ht-core/auth"
)

const testAud = "dolt.srht.bigb.es"

M authn/token_test.go => authn/token_test.go +5 -5
@@ 47,7 47,7 @@ func TestResolveBasic_UsernameTildeAndCaseInsensitive(t *testing.T) {

func TestResolveBasic_UsernameMismatch(t *testing.T) {
	withStubBackend(t, &stubBackend{users: map[string]auth.AuthContext{
		"bigbes": sampleUser(1, "bigbes", auth.USER_TYPE_USER),
		"bigbes":  sampleUser(1, "bigbes", auth.USER_TYPE_USER),
		"mallory": sampleUser(2, "mallory", auth.USER_TYPE_USER),
	}})
	pat := forgePAT("bigbes", "", time.Now().Add(time.Hour))


@@ 210,10 210,10 @@ func TestTokenGrantsAllow(t *testing.T) {
	}

	cases := []struct {
		name    string
		ac      *auth.AuthContext
		mode    core.AccessMode
		want    bool
		name string
		ac   *auth.AuthContext
		mode core.AccessMode
		want bool
	}{
		{"nil caller passes", nil, core.AccessRW, true},
		{"cookie (no bearer) passes", &auth.AuthContext{AuthMethod: auth.AUTH_COOKIE}, core.AccessRW, true},