From 819d7f9914cbb34abb76b932c05b030a34986ec2 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 6 Feb 2024 16:26:05 +0100 Subject: Server: Delete old files to prepare for new internal API --- internal/server/custom/custom.go | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 internal/server/custom/custom.go (limited to 'internal/server/custom') diff --git a/internal/server/custom/custom.go b/internal/server/custom/custom.go deleted file mode 100644 index 376bcd6..0000000 --- a/internal/server/custom/custom.go +++ /dev/null @@ -1,39 +0,0 @@ -package custom - -import ( - "context" - "net/url" - - "github.com/eduvpn/eduvpn-common/internal/server/api" - "github.com/eduvpn/eduvpn-common/internal/server/base" - "github.com/eduvpn/eduvpn-common/internal/server/institute" - "github.com/eduvpn/eduvpn-common/types/server" - "github.com/go-errors/errors" -) - -type ( - Server = institute.Server - Servers = institute.Servers -) - -func New(ctx context.Context, clientID string, u string) (*Server, error) { - pu, err := url.Parse(u) - if err != nil { - return nil, errors.WrapPrefix(err, "failed to parse custom server URL", 0) - } - b := base.Base{ - URL: u, - DisplayName: map[string]string{"en": pu.Hostname()}, - Type: server.TypeCustom, - } - if err := api.Endpoints(ctx, &b); err != nil { - return nil, err - } - API := b.Endpoints.API.V3 - - s := &Server{Basic: b} - // we set ISS to empty here as we do not want to have ISS enabled for custom servers - // Otherwise we would have to normalise the URL which the user has entered which is error prone - s.Auth.Init(clientID, "", API.Authorization, API.Token) - return s, nil -} -- cgit v1.2.3