minimal webfinger (#5373)

* initial webfinger stub

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* add webfinger to proxy, return current host

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* some cleanup

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* allow passing multiple rel params

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* introduce interfaces

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* parse oidc auth token

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* add templating, drop chain, use map of relation providers

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* fix ocis url yaml

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* fix typos

Co-authored-by: Dominik Schmidt <dschmidt@owncloud.com>

* switch to userinfo claims

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* readme cleanup

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* add TODO.md with ideas

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* replace subject on authenticated request responses

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* Apply suggestions from code review

Co-authored-by: Martin <github@diemattels.at>

* markdown lint

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* return a 401 when bearer token expired, some more docs

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* Apply suggestions from code review

Co-authored-by: Martin <github@diemattels.at>

* fix docs

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* clarify env var

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* extract handler func

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* use correct service in reflex.conf

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* test relations

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* Update services/webfinger/pkg/config/config.go

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Co-authored-by: Dominik Schmidt <dschmidt@owncloud.com>
Co-authored-by: Martin <github@diemattels.at>
This commit is contained in:
Jörn Friedrich Dreyer
2023-02-13 11:05:20 +01:00
committed by GitHub
parent 139cf79f61
commit 2c98d3246c
46 changed files with 2072 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
package command
import (
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
"github.com/owncloud/ocis/v2/ocis/pkg/command/helper"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
"github.com/owncloud/ocis/v2/services/webfinger/pkg/command"
"github.com/urfave/cli/v2"
)
// WebfingerCommand is the entrypoint for the webfinger command.
func WebfingerCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: cfg.Webfinger.Service.Name,
Usage: helper.SubcommandDescription(cfg.Webfinger.Service.Name),
Category: "services",
Before: func(c *cli.Context) error {
configlog.Error(parser.ParseConfig(cfg, true))
cfg.Webfinger.Commons = cfg.Commons
return nil
},
Subcommands: command.GetCommands(cfg.Webfinger),
}
}
func init() {
register.AddCommand(WebfingerCommand)
}

View File

@@ -48,6 +48,7 @@ import (
users "github.com/owncloud/ocis/v2/services/users/pkg/command"
web "github.com/owncloud/ocis/v2/services/web/pkg/command"
webdav "github.com/owncloud/ocis/v2/services/webdav/pkg/command"
webfinger "github.com/owncloud/ocis/v2/services/webfinger/pkg/command"
"github.com/thejerf/suture/v4"
)
@@ -112,6 +113,7 @@ func NewService(options ...Option) (*Service, error) {
s.ServicesRegistry[opts.Config.Thumbnails.Service.Name] = thumbnails.NewSutureService
s.ServicesRegistry[opts.Config.Web.Service.Name] = web.NewSutureService
s.ServicesRegistry[opts.Config.WebDAV.Service.Name] = webdav.NewSutureService
s.ServicesRegistry[opts.Config.Webfinger.Service.Name] = webfinger.NewSutureService
s.ServicesRegistry[opts.Config.Frontend.Service.Name] = frontend.NewSutureService
s.ServicesRegistry[opts.Config.OCDav.Service.Name] = ocdav.NewSutureService
s.ServicesRegistry[opts.Config.Gateway.Service.Name] = gateway.NewSutureService