From e1bd5ec1c939f5431925ab3bb83352d0a275ebd9 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Wed, 7 Sep 2022 17:44:07 +0200 Subject: Refactor: Remove the usage of the FSM in other internal packages This removes the FSM from being imported and thus used in other internal packages such as `oauth` or `server`. The benefit is that it becomes much easier now to reason about the FSM as it's only used in the public package. Additionally, we do not have to re-initialize the server and the oauth structure with the FSM pointer. --- internal/server/instituteaccess.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'internal/server/instituteaccess.go') diff --git a/internal/server/instituteaccess.go b/internal/server/instituteaccess.go index e948480..0cad158 100644 --- a/internal/server/instituteaccess.go +++ b/internal/server/instituteaccess.go @@ -3,7 +3,6 @@ package server import ( "fmt" - "github.com/jwijenbergh/eduvpn-common/internal/fsm" "github.com/jwijenbergh/eduvpn-common/internal/oauth" "github.com/jwijenbergh/eduvpn-common/internal/types" ) @@ -56,19 +55,17 @@ func (institute *InstituteAccessServer) init( displayName map[string]string, serverType string, supportContact []string, - fsm *fsm.FSM, ) error { errorMessage := fmt.Sprintf("failed initializing institute server %s", url) institute.Base.URL = url institute.Base.DisplayName = displayName institute.Base.SupportContact = supportContact - institute.Base.FSM = fsm institute.Base.Type = serverType endpoints, endpointsErr := APIGetEndpoints(url) if endpointsErr != nil { return &types.WrappedErrorMessage{Message: errorMessage, Err: endpointsErr} } - institute.OAuth.Init(endpoints.API.V3.Authorization, endpoints.API.V3.Token, fsm) + institute.OAuth.Init(endpoints.API.V3.Authorization, endpoints.API.V3.Token) institute.Base.Endpoints = *endpoints return nil } -- cgit v1.2.3