mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2026-03-14 14:35:44 +01:00
Check for capability feature "federation-v2" for federated connections.
This commit is contained in:
parent
a256789f20
commit
fd651d7213
3 changed files with 10 additions and 0 deletions
|
|
@ -43,6 +43,9 @@ const (
|
|||
// Name of capability to enable the "v3" API for the signaling endpoint.
|
||||
FeatureSignalingV3Api = "signaling-v3"
|
||||
|
||||
// Name of capability that is set if the server supports Federation V2.
|
||||
FeatureFederationV2 = "federation-v2"
|
||||
|
||||
// minCapabilitiesCacheDuration specifies the minimum duration to cache
|
||||
// capabilities.
|
||||
// This could overwrite the "max-age" from a "Cache-Control" header.
|
||||
|
|
|
|||
4
hub.go
4
hub.go
|
|
@ -1281,6 +1281,10 @@ func (h *Hub) processHelloV2(ctx context.Context, client HandlerClient, message
|
|||
tokenString = message.Hello.Auth.helloV2Params.Token
|
||||
tokenClaims = &HelloV2TokenClaims{}
|
||||
case HelloClientTypeFederation:
|
||||
if !h.backend.capabilities.HasCapabilityFeature(ctx, url, FeatureFederationV2) {
|
||||
return nil, nil, ErrFederationNotSupported
|
||||
}
|
||||
|
||||
tokenString = message.Hello.Auth.federationParams.Token
|
||||
tokenClaims = &FederationTokenClaims{}
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -699,6 +699,9 @@ func registerBackendHandlerUrl(t *testing.T, router *mux.Router, url string) {
|
|||
if strings.Contains(t.Name(), "V3Api") {
|
||||
features = append(features, "signaling-v3")
|
||||
}
|
||||
if strings.Contains(t.Name(), "Federation") {
|
||||
features = append(features, "federation-v2")
|
||||
}
|
||||
signaling := map[string]interface{}{
|
||||
"foo": "bar",
|
||||
"baz": 42,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue