aboutsummaryrefslogtreecommitdiff
path: root/internal/cryptoutil/sha1_test.go
diff options
context:
space:
mode:
authorE99p1ant <i@github.red>2022-06-05 13:34:21 +0800
committerGitHub <noreply@github.com>2022-06-05 13:34:21 +0800
commita328e7ccc4f94e19cddfe5894636228663f5c7fa (patch)
tree34d827770f004a40eb8dc1feb44109e63452d5a0 /internal/cryptoutil/sha1_test.go
parent155cae1de8916fc3fde78f350763034b7422caee (diff)
access_token: encrypt access token with SHA256 (#7008)
* access_token: encrypt access token with SHA256 * revert list access token * fix lint * generate schemadoc * add database migrations * fix tests * fix tests * add test case for access token golden * fix test in postgres * `Sha256` -> `SHA256` * Use GORM for migration * task generate-schemadoc * Use unique * change migration name * allow read * task generate-schemadoc * add changelog * fix lint error * update changelog * remove Debug * add comments Co-authored-by: Joe Chen <jc@unknwon.io>
Diffstat (limited to 'internal/cryptoutil/sha1_test.go')
-rw-r--r--internal/cryptoutil/sha1_test.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/internal/cryptoutil/sha1_test.go b/internal/cryptoutil/sha1_test.go
deleted file mode 100644
index c9795c98..00000000
--- a/internal/cryptoutil/sha1_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2020 The Gogs Authors. All rights reserved.
-// Use of this source code is governed by a MIT-style
-// license that can be found in the LICENSE file.
-
-package cryptoutil
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestSHA1(t *testing.T) {
- tests := []struct {
- input string
- output string
- }{
- {input: "", output: "da39a3ee5e6b4b0d3255bfef95601890afd80709"},
- {input: "The quick brown fox jumps over the lazy dog", output: "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"},
- {input: "The quick brown fox jumps over the lazy dog.", output: "408d94384216f890ff7a0c3528e8bed1e0b01621"},
- }
- for _, test := range tests {
- t.Run(test.input, func(t *testing.T) {
- assert.Equal(t, test.output, SHA1(test.input))
- })
- }
-}