mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
29 lines
805 B
Go
29 lines
805 B
Go
// Copyright (c) 2025 Tulir Asokan
|
|
//
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package federation_test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"maunium.net/go/mautrix/federation"
|
|
)
|
|
|
|
func TestServerKeyResponse_VerifySelfSignature(t *testing.T) {
|
|
cli := federation.NewClient("", nil, nil)
|
|
ctx := context.Background()
|
|
for _, name := range []string{"matrix.org", "maunium.net", "cd.mau.dev", "uwu.mau.dev"} {
|
|
t.Run(name, func(t *testing.T) {
|
|
resp, err := cli.ServerKeys(ctx, name)
|
|
require.NoError(t, err)
|
|
assert.NoError(t, resp.VerifySelfSignature())
|
|
})
|
|
}
|
|
}
|