mirror of
https://github.com/go-acme/lego
synced 2026-03-14 14:35:48 +01:00
35 lines
622 B
Go
35 lines
622 B
Go
package api
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func Test_decodeEABHmac(t *testing.T) {
|
|
testCases := []struct {
|
|
desc string
|
|
hmac string
|
|
}{
|
|
{
|
|
desc: "RawURLEncoding",
|
|
hmac: "BAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVSwWIzNHKC0UMHJZJT8OHx",
|
|
},
|
|
{
|
|
desc: "URLEncoding",
|
|
hmac: "nKTo9Hu8fpCqWPXx-25LVbZrJWxcHISsr4qHrRR0j5U=",
|
|
},
|
|
}
|
|
|
|
for _, test := range testCases {
|
|
t.Run(test.desc, func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
v, err := decodeEABHmac(test.hmac)
|
|
require.NoError(t, err)
|
|
|
|
assert.NotEmpty(t, v)
|
|
})
|
|
}
|
|
}
|