mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-04 10:00:10 -05:00
8e028f17e9
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
27 lines
767 B
Go
27 lines
767 B
Go
package relations
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/opencloud-eu/opencloud/services/webfinger/pkg/webfinger"
|
|
)
|
|
|
|
func TestOpenidDiscovery(t *testing.T) {
|
|
provider := OpenIDDiscovery("http://issuer.url")
|
|
|
|
jrd := webfinger.JSONResourceDescriptor{}
|
|
|
|
provider.Add(context.Background(), &jrd)
|
|
|
|
if len(jrd.Links) != 1 {
|
|
t.Errorf("provider returned wrong number of links: %v, expected 1", len(jrd.Links))
|
|
}
|
|
if jrd.Links[0].Href != "http://issuer.url" {
|
|
t.Errorf("provider returned wrong issuer link href: %v, expected %v", jrd.Links[0].Href, "http://issuer.url")
|
|
}
|
|
if jrd.Links[0].Rel != "http://openid.net/specs/connect/1.0/issuer" {
|
|
t.Errorf("provider returned wrong openid connect rel: %v, expected %v", jrd.Links[0].Href, OpenIDConnectRel)
|
|
}
|
|
}
|