summaryrefslogtreecommitdiff
path: root/internal/server/server.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-07 15:41:16 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-07-07 15:41:16 +0200
commit7d67ce7f6a15970677b7d0b8f4912fe379862515 (patch)
tree62df25f68432308c048ffd8029bbe896f5fa4845 /internal/server/server.go
parent1865b016d0cca74cd3703db5a3b4217917988dec (diff)
Format: Run gofumpt
Diffstat (limited to 'internal/server/server.go')
-rw-r--r--internal/server/server.go25
1 files changed, 11 insertions, 14 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 5bc2ea1..719d8c8 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -36,8 +36,8 @@ type InstituteAccessServer struct {
// A secure internet server which has its own OAuth tokens
// It specifies the current location url it is connected to
type SecureInternetHomeServer struct {
- DisplayName string `json:"display_name"`
- OAuth oauth.OAuth `json:"oauth"`
+ DisplayName string `json:"display_name"`
+ OAuth oauth.OAuth `json:"oauth"`
// The home server has a list of info for each configured server location
BaseMap map[string]*ServerBase `json:"base_map"`
@@ -45,7 +45,7 @@ type SecureInternetHomeServer struct {
// We have the authorization URL template, the home organization ID and the current location
AuthorizationTemplate string `json:"authorization_template"`
HomeOrganizationID string `json:"home_organization_id"`
- CurrentLocation string `json:"current_location"`
+ CurrentLocation string `json:"current_location"`
}
type InstituteServers struct {
@@ -107,17 +107,16 @@ func (secure *SecureInternetHomeServer) GetOAuth() *oauth.OAuth {
return &secure.OAuth
}
-
-func (institute *InstituteAccessServer) GetTemplateAuth() (func(string) string) {
- return func(authURL string) string {
- return authURL
- }
+func (institute *InstituteAccessServer) GetTemplateAuth() func(string) string {
+ return func(authURL string) string {
+ return authURL
+ }
}
-func (secure *SecureInternetHomeServer) GetTemplateAuth() (func(string) string) {
- return func(authURL string) string {
- return util.ReplaceWAYF(secure.AuthorizationTemplate, authURL, secure.HomeOrganizationID)
- }
+func (secure *SecureInternetHomeServer) GetTemplateAuth() func(string) string {
+ return func(authURL string) string {
+ return util.ReplaceWAYF(secure.AuthorizationTemplate, authURL, secure.HomeOrganizationID)
+ }
}
func (institute *InstituteAccessServer) GetBase() (*ServerBase, error) {
@@ -186,7 +185,6 @@ func (secure *SecureInternetHomeServer) addLocation(locationServer *types.Discov
return base, nil
}
-
// Initializes the home server and adds its own location
func (secure *SecureInternetHomeServer) init(homeOrg *types.DiscoveryOrganization, homeLocation *types.DiscoveryServer, fsm *fsm.FSM, logger *log.FileLogger) error {
errorMessage := "failed initializing secure internet home server"
@@ -195,7 +193,6 @@ func (secure *SecureInternetHomeServer) init(homeOrg *types.DiscoveryOrganizatio
// New home organisation, clear everything
*secure = *&SecureInternetHomeServer{}
}
-
base, baseErr := secure.addLocation(homeLocation, fsm, logger)