mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-21 09:06:46 +09:00
feat(acme): support EAB credentials
Co-authored-by: techknowlogick <164197+techknowlogick@users.noreply.github.com>
This commit is contained in:
1 parent
1c19e2ba43
commit
6a0e125018
6 files changed
+93
-2
No files matched your search
@@ -0,0 +1,29 @@
|
||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package setting
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"gitea.dev/modules/test"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestLoadAcmeEABFrom(t *testing.T) {
|
||||
t.Cleanup(test.MockVariableValue(&AcmeEABKID, ""))
|
||||
t.Cleanup(test.MockVariableValue(&AcmeEABHMAC, ""))
|
||||
|
||||
cfg, err := NewConfigProviderFromData(`
|
||||
[server]
|
||||
ACME_EAB_KID = kid
|
||||
ACME_EAB_HMAC = hmac
|
||||
`)
|
||||
assert.NoError(t, err)
|
||||
|
||||
loadAcmeEABFrom(cfg.Section("server"))
|
||||
|
||||
assert.Equal(t, "kid", AcmeEABKID)
|
||||
assert.Equal(t, "hmac", AcmeEABHMAC)
|
||||
}
|
||||
Reference in new issue
Block a user