api: Cleanup websocket protocol

This commit cleans up the websocket protocol to be in line with the
documentation.
This commit is contained in:
Tom 2023-07-13 15:54:45 +02:00
parent 16fa721048
commit 1c68893a02
31 changed files with 3549 additions and 120 deletions

View file

@ -0,0 +1,36 @@
package scopes
import (
"net/http"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/auth"
)
type Never struct {
component.Base
Dependencies struct {
Auth *auth.Auth
}
}
var (
_ component.ScopeProvider = (*Never)(nil)
)
const (
ScopeNever Scope = "never"
)
func (*Never) Scope() component.ScopeInfo {
return component.ScopeInfo{
Scope: ScopeNever,
Description: "scope that is never fullfilled",
DeniedMessage: "no one can do this",
TakesParam: false,
}
}
func (*Never) HasScope(string, *http.Request) (bool, error) {
return false, nil
}