diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-02-06 16:26:05 +0100 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-02-19 14:15:07 +0100 |
| commit | 819d7f9914cbb34abb76b932c05b030a34986ec2 (patch) | |
| tree | 7da743c1a0363e800a041e0310ca8cf441bc3f90 /internal/server/custom/custom.go | |
| parent | 4d26c8489b09acc98128715e9a2ed67558eb8105 (diff) | |
Server: Delete old files to prepare for new internal API
Diffstat (limited to 'internal/server/custom/custom.go')
| -rw-r--r-- | internal/server/custom/custom.go | 39 |
1 files changed, 0 insertions, 39 deletions
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 -} |
