From fbcac585cf626917e2baf1d0065c7b632341ba01 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Wed, 19 Jul 2023 21:01:23 +0200 Subject: ref: Move auth functions to service --- pkg/ext/auth_test.go | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 pkg/ext/auth_test.go (limited to 'pkg/ext/auth_test.go') diff --git a/pkg/ext/auth_test.go b/pkg/ext/auth_test.go deleted file mode 100644 index dc72a0c..0000000 --- a/pkg/ext/auth_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build unit - -package ext - -import ( - "testing" - - "git.sr.ht/~gabrielgio/img/pkg/testkit" -) - -func TestReadWriteToken(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - key []byte - token *Token - }{ - { - name: "Normal write", - key: []byte("AES256Key-32Characters1234567890"), - token: &Token{ - UserID: 3, - Username: "username", - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - data, err := WriteToken(tc.token, tc.key) - testkit.TestFatalError(t, "WriteToken", err) - - token, err := ReadToken(data, tc.key) - testkit.TestFatalError(t, "ReadToken", err) - - testkit.TestValue(t, "ReadWriteToken", token, tc.token) - }) - } -} -- cgit v1.2.3